0

I recently switch back to python for facial detection and pattern recognition using OpenCV 3.4.1 However when running OpenCV for point recongnition, I get the error

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

I have read that changing the line from sift = cv2.SIFT_create() to sift = sift = cv2.xfeatures2d.SIFT_create() should solve this.

However I get an error

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

Shouldnt xfeatures2d be included in OpenCV? Any suggestion on how to fix this? Thanks!

David Lie
  • 65
  • 2
  • 9

1 Answers1

1

I guess you installed opencv-python with pip. That package does not include contributed modules. To fix, uninstall opencv-python and install opencv-contrib-python instead.

skvark
  • 2,193
  • 2
  • 16
  • 12