Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found the error. I had to generate a new Ptr<SegmentLineDetector> x = createLineSegmentDetector()

so the code is the following:

Mat img_1_half;
vector<Vec4f> lines_1, lines_1_half;
Ptr<LineSegmentDetector> Line_Detector = createLineSegmentDetector();
Ptr<LineSegmentDetector> Line_Detector_2 = createLineSegmentDetector(); //new line

cout << "First image..." << endl;
Line_Detector->detect(img_1, lines_1);

cout << "Second image..." << endl;
resize(img_1, img_1_half, Size(img_1.cols / 2, img_1.rows / 2));    
Line_Detector_2->detect(img_1_half, lines_1_half);  //changed to Line_Detector_2