Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "WallFinder.h"
- #include "opencv\cv.h"
- #include "opencv2\highgui\highgui.hpp"
- using namespace std;
- using namespace cv;
- int main()
- {
- Mat skel;
- Mat image=imread("InputImage2.jpg",1);
- cvtColor(image,image,CV_BGR2GRAY);
- threshold(image,image,50,255,THRESH_BINARY_INV);
- WallFinder wall;
- wall.setLineLengthAndGap(100,20);
- wall.setMinVote(80);
- skel=wall.skeleton(image);
- wall.findLines(skel);
- wall.showLinesOnImage(skel);
- namedWindow("Detected Lines on a 2D Floor Plan");
- imshow("Detected Lines on a 2D Floor Plan",skel);
- waitKey(0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement