#include <stdio.h>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include <opencv2/calib3d/calib3d.hpp>
#include <iostream>
using namespace std;
using namespace cv;
static void help()
{
printf("\nThis program demonstrates using features2d detector, descriptor extractor and simple matcher\n"
"Using the SURF desriptor:\n"
"\n"
"Usage:\n matcher_simple <image1> <image2>\n");
}
int main(int argc, char** argv)
{
//if(argc != 3)
//{
// help();
// return -1;
//}
Mat img1 = imread("D:\\faceData\\stereopairs\\cones\\imL.jpg", CV_LOAD_IMAGE_GRAYSCALE);
Mat img2 = imread("D:\\faceData\\stereopairs\\cones\\imR.jpg", CV_LOAD_IMAGE_GRAYSCALE);
if(img1.empty() || img2.empty())
{
printf("Can't read one of the images\n");
return -1;
引入极线约束的surf特征匹配
最新推荐文章于 2026-06-07 15:54:28 发布
该程序演示了如何使用OpenCV的SURF特征检测器和描述符提取器进行图像匹配,并应用极线约束来提高匹配精度。通过检测和计算两幅图像的SURF特征,使用BFMatcher进行匹配,然后利用findFundamentalMat进行RANSAC处理,筛选出内点并绘制匹配结果。

1315

被折叠的 条评论
为什么被折叠?



