加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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,需要导入opencv_contrib
解决方法是安装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

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有