#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;
}
この2つの画像内の点と一致するように、単純なアプリケーションである。私は、2枚の画像中の対応点を検出するbrutforcematching ...キーポイントとそれらのキーポイントに記述としてFREAKを検出するためにオーブを使用しています.. .iは最高のマッチを持つ上位30ポイントを取った...これがあなたに多少役立つことを願っています...
はい、私はそのようなものだったと思いました。私が知りませんが、ペアを選択するアルゴリズムがある場合は、キーポイントの検出器を使用する必要があります。それは私の論文では十分ではありません。私はフリークとpyrFASTを開発していると私は何が起こるか見るでしょう。 –
私は、キーポイントの位置(例えばpyrFASTを使用)が与えられると、このキーポイントの周りの小さな近隣の点のペア(!=キーポイント)の差の符号として記述子が計算されることを理解する。これは、あなたがそれに精通しているなら、BRIEFと非常に似ています。しかし、FREAKには、人間の視覚システムに触発された近所の場所をサンプリングする方法があります。 – remi
申し訳ありませんが、それは私にとって意味があります。はい、私はBRIEF(ランダムな場所をサンプリングします)とBRISK(円でサンプリング)を知っています。 FREAKも円形のサンプルですが、網膜のように冗長で粗いものがあります。私が気付かなかったのは、これがポイントを持っているキーポイントの近くで行われたということでした。ありがとう! –