简体   繁体   中英

Cant use SIFT algorithm from opencv

I am trying to implement image stitching using opencv. specifically, I'm following this tutorial.

The problem I have is that the sift algorithm is not accessible. After looking around on the web, I found that the algorithm was patented or something and now it is not anymore and it was moved in the repo, and now I can't seem to find any useful tutorial for installing the correct things for using this algorithm.

Can anyone please explain what should be installed so that this line passes without errors? (line 54)

descriptor = cv2.xfeatures2d.SIFT_create()

Note: tried opencv 4 with opencv-contrib 4, working on windows.
Note 2: Other answers on stack overflow are not updated to the change that is mentioned above.

The sift algorithm is now free since March 2020, it has been transferred from OpenCV-Contrib (Non free) to the main repository of OpenCV (Free)

Sources:

https://piero.dev/2019/04/the-sift-patent-has-expired/#:~:text=As%20of%20March%207th%20of,on%201999-03-08

https://github.com/opencv/opencv/wiki/GSoC_2020#idea-better-sift-in-the-main-repository

https://github.com/opencv/opencv/issues/16736

The syntax changes from descriptor = cv2.xfeatures2d.SIFT_create () to descriptor = cv.SIFT_create ()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM