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"

(if you want to use SIFT/SURF directly).

if you want to use the factory methods, just link the resp. 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 cmake;

cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules

then, after building,

#include "opencv2/xfeatures2d/nonfree.hpp"

(if if you want to use SIFT/SURF directly).directly, it's

xfeatures2d::SURF surf;

if you want to use the factory methods, just link the resp. lib.functions:

xfeatures2d::initModule_xfeatures2d(); // note additional namespace
Ptr<FeatureDetector> sift = FeatureDetector::create("SIFT");

last, you will have to link against opencv_xfeatures2d.

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"

if you want to use SIFT/SURF directly, it's

[EDIT: latest refactoring removed a lot of possibilities. you can't create a'stack' object anymore, also, the 'factory functions'(Algorithm) are gone. ]

xfeatures2d::SURF surf;

xfeatures2d::SURF surf;
Ptr<xfeatures2d::SURF> surf = xfeatures2d::SURF::create();

if you want the factory functions:

xfeatures2d::initModule_xfeatures2d(); // note additional namespace
Ptr<FeatureDetector> sift = FeatureDetector::create("SIFT");

last, you will have to link against opencv_xfeatures2d.