问题
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