Ask Your Question
1

How to compile nonfree module in opencv 3.0 beta ?

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

krammer gravatar image

I have compiled opencv using the instructions at http://docs.opencv.org/doc/tutorials/...

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
4

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

berak gravatar image

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

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
surf->detect(...);
surf->compute(...);

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

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 17,905 times

Last updated: Dec 27 '14