问题
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!
回答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.
来源:https://stackoverflow.com/questions/50479607/unable-to-find-sift-or-xfeatures2d-in-opencv-python