Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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)