dariahinz

kontur

Jan 12th, 2018
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /*
  2. * stereo_match.cpp
  3. * calibration
  4. *
  5. * Created by Victor Eruhimov on 1/18/10.
  6. * Copyright 2010 Argus Corp. All rights reserved.
  7. *
  8. */
  9.  
  10. #include "opencv2/calib3d/calib3d.hpp"
  11. #include "opencv2/imgproc/imgproc.hpp"
  12. #include "opencv2/highgui/highgui.hpp"
  13. #include "opencv2/contrib/contrib.hpp"
  14.  
  15. #include <stdio.h>
  16.  
  17. using namespace cv;
  18.  
  19. int main(int argc, char** argv)
  20. {
  21. Mat img = imread("pileczka_L.png");
  22.  
  23. Mat edges = img.clone();
  24. Canny(img, edges, 150, 450);
  25. imwrite("MiI-Kontur.png", edges);
  26.  
  27. Mat filled = edges.clone();
  28. cvtColor(edges, filled, CV_GRAY2RGB);
  29. floodFill(filled, Point(700, 400), CV_RGB(255, 255, 255));
  30. floodFill(filled, Point(0, 0), CV_RGB(0, 255, 0));
  31. imwrite("MiI-Obszar.png", filled);
  32.  
  33. return 0;
  34. }
Add Comment
Please, Sign In to add comment