sift = cv2.xfeatures2d.SIFT_create()即使安装了contrib也无法正常工作 [英] sift = cv2.xfeatures2d.SIFT_create() not working even though have contrib installed

查看:390
本文介绍了sift = cv2.xfeatures2d.SIFT_create()即使安装了contrib也无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在尝试使用:

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'

我正在使用Python 3.5.0opencv(3.4.3),而我只是在使用空闲状态.这是在我尝试安装TensorFlow并尝试四处查看并安装了opencv-contrib-python之后发生的,但是我仍然遇到相同的错误.预先谢谢您,如果没有提供足够的信息,我深表歉意.

I am using Python 3.5.0 and opencv(3.4.3) and I am just using idle. This occured after I tried to install TensorFlow and I have tried looking around and have installed opencv-contrib-python but I am still getting the same error. Thank you in advance and I apologise if I have not included enough info

推荐答案

我遇到了同样的问题.似乎SIRF和SURF 在opencv> 3.4.2.16 中不再可用.我选择了较旧的opencv-python和opencv-contrib-python版本,并解决了此问题.这是关于opencv-python的历史版本,我使用以下代码:

I had the same problem. It seems that SIRF and SURF are no longer available in opencv > 3.4.2.16. I chose an older opencv-python and opencv-contrib-python versions and solved this problem. Here is the history version about opencv-python, and I use the following code :

pip install opencv-python==3.4.2.16
pip install opencv-contrib-python==3.4.2.16

修改

对于Anaconda用户,只需此即可,而不是pip

For Anaconda User just this instead of pip

conda install -c menpo opencv

这将安装cv2 3.4.1以及运行SIFT所需的一切

this will install cv2 3.4.1 and everything you need to run SIFT

祝你好运〜

这篇关于sift = cv2.xfeatures2d.SIFT_create()即使安装了contrib也无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆