Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include "opencv2/calib3d/calib3d.hpp"
  2. #include "opencv2/imgproc/imgproc.hpp"
  3. #include "opencv2/highgui/highgui.hpp"
  4. #include "opencv2/contrib/contrib.hpp"
  5.  
  6. #include <stdio.h>
  7.  
  8. using namespace cv;
  9.  
  10. int main(int argc, char** argv)
  11. {
  12. Mat img = imread("pileczka_L.png");
  13.  
  14. Mat edges = img.clone();
  15. Canny(img, edges, 150, 450);
  16. imwrite("MiI-Kontur.png", edges);
  17.  
  18. Mat filled = edges.clone();
  19. cvtColor(edges, filled, CV_GRAY2RGB);
  20. floodFill(filled, Point(700, 400), CV_RGB(255, 255, 255));
  21. floodFill(filled, Point(0, 0), CV_RGB(0, 255, 0));
  22. imwrite("MiI-Obszar.png", filled);
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement