Ask Your Question

Use sift and surf in latest release (4.1.1) on Ubuntu 18.04?

asked 2019-11-11 07:27:51 -0500

swiss_knight gravatar image


While importing cv2 which I instealled using pip, I encountered this message, hence I'm no more able to run an old demonstration code that compared different keypoints detectors and descriptirs which i build a few (2~) years ago:

error: OpenCV(4.1.1) /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


Is there a way to use these algorithms again without compiling opencv?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-11-11 07:34:27 -0500

berak gravatar image

as long as it's python installed via pip -- there's not much you can do about it (apart from installing versions < 3.4.2) . a decision was made there, not to support nonfree code, and that's it.

if you need SIFT or SURF, you HAVE TO BUILD FROM SRC using the OPENCV_ENABLE_NONFREE=ON cmake flag.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-11-11 07:27:51 -0500

Seen: 841 times

Last updated: Nov 11 '19