This line:
sift = cv2.xfeatures2d.SIFT_create()
return error:
Traceback (most recent call last):
File \"C:/Python27/openC
After executing the command:
pip install opencv-contrib-python
, I got the following error:
error: OpenCV(4.0.0) /Users/rene/build/skvark/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 'create'
Could solve it with the following command in anaconda:
conda install -c menpo opencv
Or with pip:
pip install opencv-python==3.4.2.17
pip install opencv-contrib-python==3.4.2.17
It doesn't work for OpenCV 4.0 due to US patent matter. Perhaps we shall give it a thumb up for this OpenSift effort:
https://github.com/robwhess/opensift
I think you should install opencv-contrib-python instead. The module you're using is not support in opencv-python. See opencv-contrib-python.
To install:
pip install opencv-contrib-python
I got the same error... I have used cv2.__version__
and cv2.__path__
to check the opencv version and path. Then I removed cv2 from site-packages. and install the following
pip install opencv-python==3.4.2.17
pip install opencv-contrib-python==3.4.2.17