所以我想尝试使用:
sift = cv2.xfeatures2d.SIFT_create()
Run Code Online (Sandbox Code Playgroud)
它出现了这个错误:
cv2.error: OpenCV(3.4.3) 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'
Run Code Online (Sandbox Code Playgroud)
我正在使用Python 3.5.0,opencv(3.4.3)我只是闲着.这是在我尝试安装TensorFlow之后发生的,我试过环顾四周并安装了opencv-contrib-python但是我仍然遇到同样的错误.提前谢谢你,如果我没有提供足够的信息,我会道歉
这一行:
sift = cv2.xfeatures2d.SIFT_create()
Run Code Online (Sandbox Code Playgroud)
返回错误:
Traceback (most recent call last):
File "C:/Python27/openCVskrypty/GUI/SOLUTION2.py", line 11, in <module>
sift = cv2.xfeatures2d.SIFT_create()
AttributeError: 'module' object has no attribute 'xfeatures2d'
Run Code Online (Sandbox Code Playgroud)
我读了一些关于这个错误的内容,它出现在OpenCV 3.0版中.这很奇怪,因为我有2.4.11版本.
我检查dir(cv2),我没有xfeatures2d模块.有谁知道为什么?我可以单独下载吗?
感谢您帮忙解决这个问题.