Ask Your Question

How to compile nonfree module in opencv 3.0 beta ?

asked 2014-12-27 08:33:57 -0500

krammer gravatar image

I have compiled opencv using the instructions at

but there is no support for SIFT or SURF. I searched them in the install directory, but they are not there. I had tried the same instructions with opencv-2.4.9 and nonfree modules did compile. How to achieve the same with opencv 3.0 ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-27 08:57:28 -0500

berak gravatar image

updated 2014-12-27 08:58:42 -0500

in 3.0, SIFT and SURF were moved to the opencv_contrib repo

you will need to clone/fork/download that, and add that to your (main opencv) cmake;

cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules

then, after building,

#include "opencv2/xfeatures2d/nonfree.hpp"

Ptr<xfeatures2d::SURF> surf = xfeatures2d::SURF::create(); // note extra namespace

don't forget to link to opencv_xfeatures2d(.lib)

edit flag offensive delete link more


I built OpenCV with the modules as you're mentioning but It always throws me an error after including it. Also what do you mean by "link to opencv_xfeatures2d(.lib)?

maystroh10 gravatar imagemaystroh10 ( 2015-06-30 08:47:12 -0500 )edit

you should check the flag OPENCV_ENABLE_NON_FREE before generate the solution in cmake

pmendozav gravatar imagepmendozav ( 2017-07-11 16:05:49 -0500 )edit

Question Tools

1 follower


Asked: 2014-12-27 08:33:57 -0500

Seen: 17,286 times

Last updated: Dec 27 '14