Avinash793 / panoramic-image-stitching

Create panorama image using invariant features from given set of overlapping images.
MIT License
208 stars 61 forks source link

detect-feature_and_keypoints issue, cv2 function not recognized #7

Closed ThomasFaure-30 closed 3 years ago

ThomasFaure-30 commented 3 years ago

Hello ! I'd like to use your code for your program but i got an error message telling me this :

Traceback (most recent call last): File "C:\Users\thfaure\Desktop\Scripts_python\Panorama_avinashk442\stitch.py", line 35, in (result, matched_points) = panaroma.image_stitch([images[no_of_images-2], images[no_of_images-1]], match_status=True) File "C:\Users\thfaure\Desktop\Scripts_python\Panorama_avinashk442\panorama.py", line 11, in image_stitch (KeypointsA, features_of_A) = self.Detect_Feature_And_KeyPoints(imageA) File "C:\Users\thfaure\Desktop\Scripts_python\Panorama_avinashk442\panorama.py", line 43, in Detect_Feature_And_KeyPoints descriptors = cv2.xfeatures2d.SIFT_create() AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'

For the record i'm using python 3.9 and cv2 is on 4.5.1 version. It seems like the xfeatures2d is no longer a part of the opencv library ! I got the same error message for 2 and more numerous set of multiple images. Any clue ?

Avinash793 commented 3 years ago

@ThomasFaure-30 you can try to install opencv-contrib-python that that supports SIFT. https://stackoverflow.com/questions/37039224/attributeerror-module-object-has-no-attribute-xfeatures2d-python-opencv-2

pip3 uninstall opencv-python
pip3 install -U opencv-contrib-python==3.4.2.16
Avinash793 commented 3 years ago

@ThomasFaure-30 is above solved your problem? If so, can you please close this issue?

Avinash793 commented 7 months ago

@ThomasFaure-30 We have updated the repo with latest libraries as of 2024. You can now give a shot! Thanks!