Skip to content

Commit

Permalink
more schtuff
Browse files Browse the repository at this point in the history
  • Loading branch information
raffy4284 committed Dec 6, 2015
1 parent 68fc37d commit 180dbb7
Show file tree
Hide file tree
Showing 64 changed files with 5,228 additions and 0 deletions.
Binary file added Blend
Binary file not shown.
36 changes: 36 additions & 0 deletions Blend.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;

Mat src; Mat dst;
char window_name1[] = "Unprocessed Image";
char window_name2[] = "Processed Image";

double alpha; /* Simple contrast control */
int beta; /* Simple brightness control */


int main( int argc, char** argv )
{
/// Load the source image
Mat dst, dst2;
Mat f0 = imread( argv[1], 1 );
Mat f1 = imread(argv[2],1);
Size size(f0.cols,f0.rows);
resize(f1,dst2,size);
alpha = 0.5; double beta; double input;
cout << "Simple Linear Blender" << endl;
cout << "Enter alpha [0-1]: ";
cin >> input;
alpha = input;

namedWindow("LinearBlend",1);
beta = 1.0-alpha;
addWeighted(f0, alpha,dst2,beta,0.0, dst);

imshow("Linear Blend", dst);
waitKey(0);
return 0;
}
Binary file added BlurImage
Binary file not shown.
45 changes: 45 additions & 0 deletions BlurImage.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <cv.h>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>

using namespace std;
using namespace cv;

Mat src; Mat dst;
char window_name1[] = "Unprocessed Image";
char window_name2[] = "Processed Image";

double alpha; /* Simple contrast control */
int beta; /* Simple brightness control */


int main( int argc, char** argv )
{
/// Load the source image
Mat image = imread( argv[1], 1 );
Mat new_image = Mat::zeros(image.size(), image.type());

std::cout << "Basic Linear Transforms " << std::endl;
std::cout << "------------------------" << std::endl;
std::cout << "* Enter the alpha value [1.0-3.0]: ";
std::cin >> alpha;
std::cout << "* Enter the beta value [0-100]: ";
std::cin >> beta;
for (int y = 0; y < image.rows; y++){
for(int x = 0; x < image.cols; x++){
for(int c = 0; c < 3; c++){
new_image.at<Vec3b>(y,x)[c] = saturate_cast<uchar>(alpha *(image.at<Vec3b>(y,x)[c]) + beta);
}
}
}
new_image = new_image.t();
namedWindow("Original Image", 1);
namedWindow("New Image", 1);

imshow("Original Image", image);
imshow("New Image", new_image);

waitKey();
return 0;
}
Loading

0 comments on commit 180dbb7

Please sign in to comment.