sift = cv2.xfeatures2d.SIFT_create() 即使安装了 contrib 也不起作用 [英] sift = cv2.xfeatures2d.SIFT_create() not working even though have contrib installed

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

问题描述

所以我正在尝试使用:

sift = cv2.xfeatures2d.SIFT_create()

它出现了这个错误:

cv2.error: OpenCV(3.4.3) C:projectsopencv-pythonopencv_contribmodulesxfeatures2dsrcsift.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天全站免登陆