我在我的开放简历项目中实施了 LSD。一切都很顺利,直到我将 opencv 版本从 4.0.0 升级到 4.1.0。现在我得到的错误是
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'
似乎由于某些许可证问题,此功能已被删除。我该如何解决这个问题。
该错误显示在以下代码部分中:
cv2.createLineSegmentDetector(0)
在 opencv 4 中,它现在称为 FastLineDetector。您需要首先使用以下命令安装 opencv-contrib-pythonpip install opencv-contrib-python
然后你可以使用以下实现
img = cv2.imread(test_image, 0)
fld = cv2.ximgproc.createFastLineDetector()
lines = fld.detect(img)
result_img = fld.drawSegments(img,lines)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)