Reputation: 37
I am getting some opencv errors with when using an open-source software library that uses for which it is a dependency. I have tried some of the suggestions listed here: AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' [Opencv 3.4.3]
What has been done so far:
sudo pip uninstall opencv-python
sudo pip uninstall opencv-python
pip install opencv-python==3.4.2.16 pip install opencv-contrib-python==3.4.2.16
pip3 install opencv-contrib-python==4.2.0.32
The latest error after calling "pip3 install opencv-contrib-python==4.2.0.32" is "OpenCV(3.4.4) ../opencv_contrib/modules/xfeatures2d/src/sift.cpp:1205: 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'"
Upvotes: 0
Views: 1205
Reputation: 5835
First the bad news: you won't be able to get SIFT or SURF from pre-built binaries > 3.4.2. This is because those algorithms are patented.
The good news is that the patent expired on March 7, 2020. The developers of OpenCV are aware of this issue and new binaries will eventually be built.
Until then you have 3 options:
Good luck
Starting with
SIFT is now included. This is noted in the Release Notes
Upvotes: 0
Reputation: 150
pip3 install opencv-contrib-python==4.2.0
For Anaconda User just this instead of pip
conda install -c menpo opencv
Upvotes: 0