#include <iostream>
#include <opencv2/opencv.hpp>
#include"opencv2/xfeatures2d.hpp"
using namespace cv;
using namespace std;
using namespace cv::xfeatures2d;
int main()
{
Mat a = imread("C:/Users/zhang/Desktop/77.png", IMREAD_GRAYSCALE); //读取灰度图像
Mat b = imread("C:/Users/zhang/Desktop/76.png", IMREAD_GRAYSCALE);
Ptr<SURF> surf;
surf = SURF::create(800);
BFMatcher matcher;
Mat c, d;
vector<KeyPoint>key1, key2;
vector<DMatch> matches;
surf->detectAndCompute(a, Mat(), key1, c);
surf->detectAndCompute(b, Mat(), key2, d);
matcher.match(c, d, matches); //匹配
sort(matches.begin(), matches.end()); //筛选匹配点
vector< DMatch > good_matches;<
平面识别对象
最新推荐文章于 2024-04-21 14:44:47 发布