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