Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SIFT and SURF were moved to opencv_contrib with opencv3, so you have to get the src of that and rebuild the opencv libs. please take a look at the readme for build instructions.

then the code changed since opencv2.4, you have to use it like:

#include "opencv2/xfeatures2d" // new module in opencv_contrib

Ptr<xfeatures2d::SIFT> sift = xfeatures2d::SIFT::create(0.3); // have to use Ptr and create()

std::vector<KeyPoint> keypoints; 
Mat descriptors;

sift->detectAndCompute(keypoints, Mat(), descriptors);

please also visit current tutorials

SIFT and SURF were moved to opencv_contrib with opencv3, so you have to get the src of that and rebuild the opencv libs. please take a look at the readme for build instructions.

then the code changed since opencv2.4, you have to use it like:

#include "opencv2/xfeatures2d" "opencv2/xfeatures2d.hpp" // new module in opencv_contrib

Ptr<xfeatures2d::SIFT> sift = xfeatures2d::SIFT::create(0.3); // have to use Ptr and create()

std::vector<KeyPoint> keypoints; 
Mat descriptors;

sift->detectAndCompute(keypoints, Mat(), descriptors);

please also visit current tutorials