python:解决不能使用sift
(2018-11-07 17:19:50)分类: python |
出现问题:Traceback (most recent call last): File "D:\hexinghua\hxh_python\hxh_matchTemplate\hxh_matchTemplate\test1.py", line 5, in SIFT() File "D:\hexinghua\hxh_python\hxh_matchTemplate\hxh_matchTemplate\test1.py", line 4, in SIFT sift = cv2.xfeatures2d.SIFT_create() 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' |
原因:
解决方法是安装opencv_contrib,pip
install opencv-contrib-python,但这种方法不能解决该问题
我的解决方法是:先卸载opencv,再将opencv版本改为3.4.2。
pip install
opencv-python==3.4.2.16
pip install
opencv-contrib-python==3.4.2.16
前一篇:python:写入txt文件