카테고리 없음

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

충연 2020. 1. 16. 11:23

Problem:

sift = cv2.xfeatures2d.SIFT_create()
>> AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'



Reason:

SIFT is a patented algorithm, hence not available in each OpenCV version


Solution:

Install OpenCV and its contrib part simultaneously

pip install opencv-python==3.3.0.10 opencv-contrib-python==3.3.0.10
or
pip install opencv-python==3.4.2.16 opencv-contrib-python==3.4.2.16