Surf missing in opencv 2.4 for python

不问归期 提交于 2019-12-23 07:48:14

问题


I'm trying to instantiate a SURF object in python using OpenCV as described here but this happens:

>>> import cv2
>>> cv2.__version__
'2.4.0'
>>> cv2.SURF()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SURF'

Does anyone know why this happens or if SURF is missing from the Python version of OpenCV?


回答1:


It is a regression which should be fixed in the next library update.

But SURF is not really absent. You still can access it via the generic wrappers:

surf_detector = cv2.FeatureDetector_create("SURF")
surf_descriptor = cv2.DescriptorExtractor_create("SURF")

Update: cv2.SURF() is restored in OpenCV 2.4.1



来源:https://stackoverflow.com/questions/10709610/surf-missing-in-opencv-2-4-for-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!