Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <opencv2/imgproc/imgproc.hpp>
  2. #include <opencv2/opencv.hpp>
  3. #include <opencv2/highgui/highgui_c.h>
  4.  
  5. using namespace cv;
  6. int main(int argc, char** argv)
  7. {
  8. namedWindow("Before" , CV_WINDOW_AUTOSIZE);
  9.  
  10. // Load the source image
  11. Mat src = imread( "kam.jpg", 1);
  12.  
  13. // Create a destination Mat object
  14. Mat dst;
  15. Mat out;
  16. Mat out1;
  17. // display the source image
  18. imshow("Before", src);
  19. for (int i=1; i<=10; i=i+2)
  20. {
  21. // smooth the image in the "src" and save it to "out1"
  22. blur(src, out1, Size(i,i));
  23. // Gaussian smoothing and median
  24. GaussianBlur( src, dst, Size( i, i ), 0, 0 );
  25. medianBlur(src,out,i);
  26. }
  27. imshow( "Gaussian filter", dst );
  28. imshow( "Median filter", out );
  29. imshow( "homogenous blur filter", out1 );
  30. waitKey(0);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement