I had implemented LSD in my open CV project. Every thing worked well until I upgraded opencv version from 4.0.0 to 4.1.0. Now I get error as
cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/lsd.cpp:143: error: (-213:The function/feature is not implemented) Implementation has been removed due original code license issues in function 'LineSegmentDetectorImpl'
It seems that due to some liscense issue this feature has been removed. How do I address this problem.
The error is shown in the following part of code :
cv2.createLineSegmentDetector(0)
In opencv 4, it is now called FastLineDetector. You need to first install opencv-contrib-python by using pip install opencv-contrib-python
and then you can use the following implementation
img = cv2.imread(test_image, 0)
fld = cv2.ximgproc.createFastLineDetector()
lines = fld.detect(img)
result_img = fld.drawSegments(img,lines)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With