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

后端 未结 3 1376
太阳男子
太阳男子 2020-11-28 04:58

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         


        
相关标签:
3条回答
  • 2020-11-28 05:33

    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~

    0 讨论(0)
  • 2020-11-28 05:34

    Edit: The opencv-contrib-python-nonfree was removed from pypi.

    On Linux/ MacOS, I've found a better solution! To access nonfree detectors use: pip install opencv-contrib-python-nonfree

    0 讨论(0)
  • 2020-11-28 05:50

    It may be due to a mismatch of opencv version and opencv-contrib version. If you installed opencv from the source using CMake, and the source version is different from the version of opencv-contrib-python, uninstall the current opencv-contrib-python and do pip install opencv-contrib-python==<version of the source>.X or an another compatible version. One version setup that I have running is opencv source (3.2), opencv-python (3.4.0.14) and opencv-contrib-python (3.4.2.17)

    0 讨论(0)
提交回复
热议问题