#include "iostream"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "cv.h"
#include "highgui.h"
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <opencv2/flann/flann.hpp>
#include <opencv2/legacy/legacy.hpp>
#include <vector>
using namespace cv;
using namespace std;
int main()
{
Mat image1,image2;
image1 = imread("C:\\lena.jpg",0);
image2 = imread("C:\\lena1.bmp",0);
vector<KeyPoint> keypointsA,keypointsB;
Mat descriptorsA,descriptorsB;
std::vector<DMatch> matches;
OrbFeatureDetector detector(400);
FREAK extractor;
BruteForceMatcher<Hamming> matcher;
detector.detect(image1,keypointsA);
detector.detect(image2,keypointsB);
extractor.compute(image1,keypointsA,descriptorsA);
extractor.compute(image2,keypointsB,descriptorsB);
matcher.match(descriptorsA, descriptorsB, matches);
int nofmatches = 30;
nth_element(matches.begin(),matches.begin()+nofmatches,matches.end());
matches.erase(matches.begin()+nofmatches+1,matches.end());
Mat imgMatch;
drawMatches(image1, keypointsA, image2, keypointsB, matches, imgMatch);
imshow("matches", imgMatch);
waitKey(0);
return 0;
}
this is a simple application to match points in two images...i have used Orb to detect keypoints and FREAK as descriptor on those keypoints...then brutforcematching to detect the corresponding points in two images...i have taken top 30 points that have best match...hope this helps you somewhat...