Unable to find SIFT or xfeatures2d in OpenCV Python [duplicate]

♀尐吖头ヾ 提交于 2019-12-13 04:42:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!