Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2013
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include "WallFinder.h"
  2. #include "opencv\cv.h"
  3. #include "opencv2\highgui\highgui.hpp"
  4. using namespace std;
  5. using namespace cv;
  6. int main()
  7. {
  8. Mat skel;
  9. Mat image=imread("InputImage2.jpg",1);
  10. cvtColor(image,image,CV_BGR2GRAY);
  11. threshold(image,image,50,255,THRESH_BINARY_INV);
  12. WallFinder wall;
  13. wall.setLineLengthAndGap(100,20);
  14. wall.setMinVote(80);
  15. skel=wall.skeleton(image);
  16. wall.findLines(skel);
  17. wall.showLinesOnImage(skel);
  18. namedWindow("Detected Lines on a 2D Floor Plan");
  19. imshow("Detected Lines on a 2D Floor Plan",skel);
  20. waitKey(0);
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement