LineSegmentDetector

asked 2020-12-19 09:10:48 -0600

I need to show lines, but I have error this code:

QImage temp = nPixDst->pixmap().toImage();
Mat image = QImage2Mat( temp ) ;

cvtColor(image, image, COLOR_BGR2GRAY);
Canny(image, image, 50, 150, 3);

Ptr<LineSegmentDetector> ls = createLineSegmentDetector(LSD_REFINE_NONE);


vector<Vec4f> lines_std;

// Detect the lines
ls->detect(image, lines_std);


image = Scalar(0, 0, 0);

ls->drawSegments(image, lines_std);

nPixDst->setPixmap( QPixmap::fromImage( Mat2QImage( image )) );

image description

could you help me, please?

edit retag flag offensive close merge delete