不能使用 cv2.xfeatures2d.SIFT_create()

can't use cv2.xfeatures2d.SIFT_create()

我正在尝试关注 this tutorial

我安装了 OpenCV 3.3.1.11,但是当我检查安装的是哪个版本时,我发现是 4.1.2 我用的是 spyder 3.6

但是当我 运行 它时,我得到这个错误

error: OpenCV(4.1.2) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1207: 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::SIFT::create'

我尝试卸载 anaconda 并卸载所有 OpenCv 版本,但没有成功

我刚刚检查了我的一些 conda 环境。看起来你可以同时安装超过 1 个 opencv。

尝试在 Anaconda Promt 中编写此代码(激活您的环境后,如果您有的话):conda list.

然后通过输入以下内容将其与您的点数列表进行比较:点数列表

您是否在其中一个列表中看到了两个不同的 OpenCV?

如果是,请尝试删除不需要的那个。

否则,请尝试降级错误中显示的那个。