2
sift  = cv2.xfeatures2d.SIFT_create()             

AttributeError                         Traceback (most recent call last)
<ipython-input-49-11572687581a> in <module>()

      8 gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
      9 #create sift object
---> 10 sift  = cv2.xfeatures2d.SIFT_create()
     11 #calculate keypoints and their orientation
     12 keypoints,descriptors = sift.detectAndCompute(gray,None)

AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'

tripleee
  • 175,061
  • 34
  • 275
  • 318
Shobs
  • 21
  • 1
  • 5

2 Answers2

3

It looks like sift and surf have been depreciated.

sift = cv2.xfeatures2d.SIFT_create() not working even though have contrib installed

That thread has a similar question and the selected answer is this: https://stackoverflow.com/a/52514095/11013286

1

i may be wrong but i think cv2.xfeatures2d.SIFT_create() only works in the old version

Jawad
  • 11,028
  • 3
  • 24
  • 37
PizzaBoii
  • 11
  • 1