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
2 | No.2 Revision |
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