lsd.cpp:143: error: (-213:The function/feature is not implemented)

问题:

lsd.cpp:143: error: (-213:The function/feature is not implemented) Implementation has been removed due original code license issues in function ‘LineSegmentDetectorImpl’

最近在忙一个项目,初次用ubuntu 系统,编译opencv4.5版本,这个项目用到了边的LineSegmentDetection,自己安装网上的教程编译好了后,编译的具体方法参照如下blog,放入链接如下:
https://blog.csdn.net/yuhuqiao/article/details/84031224

这个问题可以看出因为版本比较高,尊重知识产权,在lsd.cpp中加入了这句话,所以不能使用lsd里面的函数,同时这个函数也在
imgproc这个模块中,所以编译后,只要
#include"opencv2/imgproc.hpp"
并且用到了lsd中的函数,就会出现上述错误,错误的源码如下:
lsd.cpp:143: error: (-213:The function/feature is not implemented)对于这个问题的解决,我找到了opencv4.5.0版本中的其他函数代替,具体的用法可以找到下面的链接,这样就可以用lsd的类似的功能了:
https://docs.opencv.org/4.1.0/d1/d9e/fld_lines_8cpp-example.html
最后,我展示了使用上述代码,编译和运行的结果,
建立文件lsd_test.cpp,复制代码进去,然后构建build 和 data 目录,在data目录下放入图片,因为代码中需要用到图片如下:
lsd.cpp:143: error: (-213:The function/feature is not implemented)
最后
cd build
在build的目录下打开终端,然后编译lsd_test.cpp
g++ pkg-config opencv --cflags …/lsd_test.cpp -o lsd_test pkg-config opencv --libs
运行
./lsd_test
我输入的图片是:
lsd.cpp:143: error: (-213:The function/feature is not implemented)
输出是:
lsd.cpp:143: error: (-213:The function/feature is not implemented)

希望能帮到大家。