FLANN特征匹配
FLANN特征匹配介绍
代码演示
FLANN特征匹配介绍
快速最近邻逼近搜索函数库(Fast Approximate Nearest Neighbor Search Library)
http://www.cs.ubc.ca/research/flann/
代码演示
#include <opencv2/opencv.hpp> #include <opencv2/xfeatures2d.hpp> #include <iostream> #include <math.h> using namespace cv; using namespace std; using namespace cv::xfeatures2d; int main(int argc, char** argv) { Mat img1 = imread("D:/vcprojects/images/box.png", IMREAD_GRAYSCALE); Mat img2 = imread("D:/vcprojects/images/box_in_scene.png", IMREAD_GRAYSCALE); if (!img1.data || !img2.data) { return -1; } imshow("object image", img1); imshow("object in scene", img2); // surf featurs extraction int minHessian = 400; Ptr<SURF> detecto