[英]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.我在 Windows 10 上安装了 python3 并通过 pip 添加了 OpenCV 和 OpenCV-contrib。 For the xfeatures_2d it gives the following error.对于 xfeatures_2d,它给出了以下错误。
Can I add that option using pip?我可以使用 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; 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 implementation) 这个算法是已获得专利并被排除在此配置中; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SURF::create'设置 OPENCV_ENABLE_NONFREE CMake 选项并在函数 'cv::xfeatures2d::SURF::create' 中重建库
As discussed in the comments, you can no longer get the non-free modules via pip
.正如评论中所讨论的,您无法再通过pip
获得非免费模块。 The PyPI package opencv-python-contrib
used to "erroneously" contain the non-free packages such as SIFT. PyPI 包opencv-python-contrib
用于“错误地”包含非自由包,例如 SIFT。 This was "fixed" recently, so they no longer install with newer versions of opencv-python-contrib
.这最近已“修复”,因此它们不再安装较新版本的opencv-python-contrib
。 From the GitHub issue tracker for the PyPI package :来自PyPI 包的GitHub 问题跟踪器:
Those algorithms have been included erroneously before because they were not properly protected in the upstream by the OPENCV_ENABLE_NONFREE flag.这些算法之前被错误地包括在内,因为它们在上游没有被 OPENCV_ENABLE_NONFREE 标志正确保护。
I am not a lawyer.我不是律师。 I'm not sure if I can redistribute those algorithms.我不确定我是否可以重新分发这些算法。
Edit: See: opencv/opencv_contrib#1668编辑:见: 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/]来源: [https://www.programmersought.com/article/36184723625/]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.