简体   繁体   中英

OpenCV xfeatures2d_SURF -213:The function/feature is not implemented

I'm on Windows 10 and installed python3 and added OpenCV and OpenCV-contrib via pip. For the xfeatures_2d it gives the following error.

Can I add that option using pip?

detector = cv.xfeatures2d_SURF.create(hessianThreshold=minHessian)

cv2.error: OpenCV(3.4.3) C:\\projects\\opencv-python\\opencv_contrib\\modules\\xfeatures2d\\src\\surf.cpp:1016: 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::SURF::create'

As discussed in the comments, you can no longer get the non-free modules via pip . The PyPI package opencv-python-contrib used to "erroneously" contain the non-free packages such as SIFT. This was "fixed" recently, so they no longer install with newer versions of opencv-python-contrib . From the GitHub issue tracker for the PyPI package :

Those algorithms have been included erroneously before because they were not properly protected in the upstream by the OPENCV_ENABLE_NONFREE flag.

I am not a lawyer. I'm not sure if I can redistribute those algorithms.

Edit: See: opencv/opencv_contrib#1668

This solution worked for me!

pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com opencv-contrib-python==3.4.2.17

source : [https://www.programmersought.com/article/36184723625/]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM