makelove/OpenCV-Python-Tutorial

Is createLineSegmentDetector not supported anymore for cv2?

yehia123 opened this issue · 2 comments

lsd = cv2.createLineSegmentDetector(0)
cv2.error: OpenCV(4.1.1) /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'

should be

do you install opencv-contrib-python ?

pip install opencv-contrib-python

There is an older implementation of:
https://github.com/primetang/LSD-OpenCV-MATLAB/tree/master/pylsd

Running this command solved my issue :
pip install pylsd

PyLSD is a layer over the LSD software (LSD - Line Segment Detector)