F.Dunbar
F.Dunbar

Reputation: 37

opencv error: error: OpenCV(4.2.0) /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1210: error: (-213:The function/feature is not implemented)

Trace

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:

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

Answers (2)

bfris
bfris

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:

  1. wait
  2. install an older version for now while you wait
  3. use one of the free algos developed by OpenCV
  4. compile OpenCV yourself with SIFT and SURF enabled

Good luck

UPDATE

Starting with

  • 3.4.11 and up (in the 3.X series)
  • 4.4.0 and up (in the 4.X series)

SIFT is now included. This is noted in the Release Notes

Upvotes: 0

Wahib Mzali
Wahib Mzali

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

Related Questions