Skip to content

Cannot use sift and other nonfree modules #132

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
simbaforrest opened this issue Oct 17, 2018 · 2 comments
Closed

Cannot use sift and other nonfree modules #132

simbaforrest opened this issue Oct 17, 2018 · 2 comments

Comments

@simbaforrest
Copy link

Expected behaviour

I was using opencv-contrib-python. I was hoping I can use:

sift = cv2.xfeatures2d_SURF.create()
kp = sift.detect(gray, None)

Actual behaviour

But when I run sift, there is the following error:

cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\surf.cpp:1016: 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 'cv::xfeatures2d::SURF::create'

Steps to reproduce

  • example code
import numpy as np
import cv2

gray = np.zeros((480,640), np.uint8)

sift = cv2.xfeatures2d_SURF.create()
kp = sift.detect(gray, None)

img = cv2.drawKeypoints(gray, kp)

cv2.imwrite('sift.jpg', img)
  • operating system: Win 10
  • architecture: x64
  • opencv-python version: 3.4.3
@simbaforrest
Copy link
Author

I suspect it is due to the compiler flag OPENCV_ENABLE_NONFREE has not been set during compilation.

@waveform80
Copy link

Duplicate of #126

@skvark skvark closed this as completed Oct 17, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants