Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/imgproc/imgproc.hpp>
- #include <opencv2/opencv.hpp>
- #include <opencv2/highgui/highgui_c.h>
- using namespace cv;
- int main(int argc, char** argv)
- {
- namedWindow("Before" , CV_WINDOW_AUTOSIZE);
- // Load the source image
- Mat src = imread( "kam.jpg", 1);
- // Create a destination Mat object
- Mat dst;
- Mat out;
- Mat out1;
- // display the source image
- imshow("Before", src);
- for (int i=1; i<=10; i=i+2)
- {
- // smooth the image in the "src" and save it to "out1"
- blur(src, out1, Size(i,i));
- // Gaussian smoothing and median
- GaussianBlur( src, dst, Size( i, i ), 0, 0 );
- medianBlur(src,out,i);
- }
- imshow( "Gaussian filter", dst );
- imshow( "Median filter", out );
- imshow( "homogenous blur filter", out1 );
- waitKey(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement