cmcguinness / focusstack

Simple Focus Stacking in Python: Merge a collection of photos taken at different focus depths into one image with sharp focus
Apache License 2.0
153 stars 47 forks source link

SIFT not supported #5

Open ngchanway opened 4 years ago

ngchanway commented 4 years ago

This is a wonderful repo. I have this issue while running your script cv2.error: OpenCV(4.1.2) /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'create'. Seems SIFT is no longer available in opencv > 3.4.2. Would there be an alternative?

momonala commented 4 years ago

You can use the ORB detector. Set use_sift to False on this line https://github.com/cmcguinness/focusstack/blob/master/FocusStack.py#L62

Or use the latest OpenCV 3: pip install opencv-contrib-python==3.4.2.17 opencv-python==3.4.2.17

RO360 commented 2 years ago

change this code as below for FocusStack.py 66 lines if use_sift: detector = cv2.SIFT_create() #xfeatures2d

refer: https://blog.csdn.net/pursuing2019/article/details/119523025