欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

opencv算法未实现与版权问题的解决

程序员文章站 2022-05-17 20:13:23
...

在使用opencv做图像匹配的时候报错:

cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function ‘cv::xfeatures2d::SIFT::create’

或者:

This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake op

报错原因:主要是版权的原因或者没有安装扩展库

解决方法:

如果运行OpenCV程序提示算法未实现,则安装opencv-contrib-python(注意版本):

pip install opencv-contrib-python

如果提示算法版权问题,则是版本的原因,可以通过安装低版本的opencv-contrib-python解决:

pip install --user opencv-contrib-python==3.3.0.10

3.4.2或以下的版本就可以