Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

opencv - sift = cv2.xfeatures2d.SIFT_create() not working even though have contrib installed

So I am trying to use:

sift = cv2.xfeatures2d.SIFT_create()

and it is coming up with this error:

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'

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

Edit

For Anaconda User just this instead of pip

conda install -c menpo opencv

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

good luck~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...