FAST實際上已經被OpenCV的實現,如果你想使用它們的實現。
編輯:這裏是我創建向你展示瞭如何使用快速檢測儀短的例子:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <vector>
using namespace std;
using namespace cv;
int main(int argc, char* argv[])
{
Mat far = imread("far.jpg", 0);
Mat near = imread("near.jpg", 0);
Ptr<FeatureDetector> detector = FeatureDetector::create("FAST");
vector<KeyPoint> farPoints;
detector->detect(far, farPoints);
Mat farColor;
cvtColor(far, farColor, CV_GRAY2BGR);
drawKeypoints(farColor, farPoints, farColor, Scalar(255, 0, 0), DrawMatchesFlags::DRAW_OVER_OUTIMG);
imshow("farColor", farColor);
imwrite("farPoints.jpg", farColor);
vector<KeyPoint> nearPoints;
detector->detect(near, nearPoints);
Mat nearColor;
cvtColor(near, nearColor, CV_GRAY2BGR);
drawKeypoints(nearColor, nearPoints, nearColor, Scalar(0, 255, 0), DrawMatchesFlags::DRAW_OVER_OUTIMG);
imshow("nearColor", nearColor);
imwrite("nearPoints.jpg", nearColor);
waitKey();
return 0;
}
這個代碼是找到後續的特徵點的遠近圖像:
正如您所看到的,近距離圖像具有更多特徵,但看起來像是使用遠距離圖像檢測到相同的基本結構。所以,你應該能夠匹配這些。看看descriptor_extractor_matcher.cpp。這應該讓你開始。
希望有幫助!
在您的編輯中,您可以鏈接到OpenCV中提供的各種特徵檢測器測試。然後你要求一個特徵探測器。在OpenCV中 – Sam