I\'m trying to add the xfeatures2d module from opencv_contrib to an existing OpenCV/Python project.
I\'ve downloaded the latest version of
I encountered this same issue. I'm using python 2.7.6 and OpenCv 3.0 with the additional non-free modules. I do have xfeatures2d present in available modules and can import it, however it was as though xfeatures2d didn't contain SIFT or SURF. No matter how I called them it was the same Error:
"AttributeError: 'module' object has no attribute 'SIFT'
I tried the different name spaces suggested, and only recently noticed this detail and GOT IT WORKING!
$ python
>>>import cv2
>>>help(cv2.xfeatures2d)
You'll notice that it replies that it is now referred to as...
FUNCTIONS
SIFT_create(...)
and
SURF_create(...)
So very simply - the namespace is NOT "cv2.SIFT()" or "cv2.xfeatures2d.SIFT" but rather
cv2.xfeatures2d.SIFT_create()
Please give it a shot!