Image-Stitching-OpenCV icon indicating copy to clipboard operation
Image-Stitching-OpenCV copied to clipboard

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

Open adhilartz opened this issue 3 years ago • 2 comments

python Image_Stitching.py [image1.jpg] [image2.jpg] Traceback (most recent call last): File "Image_Stitching.py", line 78, in main(sys.argv[1],sys.argv[2]) File "Image_Stitching.py", line 74, in main final=Image_Stitching().blending(img1,img2) File "Image_Stitching.py", line 9, in init self.sift=cv2.xfeatures2d.SIFT_create() AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'

adhilartz avatar Jun 03 '21 02:06 adhilartz

SIFT is a patented algorithm, hence not available in each open-cv version. try !pip install opencv-contrib-python

A7med01 avatar Sep 01 '21 08:09 A7med01

Hi @adhilartz

try to replace:

self.sift=cv2.xfeatures2d.SIFT_create()

to

self.sift=cv2.SIFT_create()

in latest versions of opencv-python SIFT migrated in core from xfeatures2d

Egorka avatar Sep 03 '21 14:09 Egorka