相关疑难解决方法(0)

OpenCV - 使用SURF描述符和BruteForceMatcher进行对象匹配

我有一个关于与OpenCV匹配的对象的问题.我正在使用opencv 2.3中实现的SURF算法来首先检测每个图像上的特征,然后提取这些特征的描述符.使用Brute Force Matcher进行匹配的问题,我不知道如何判断两个图像是否匹配,就像我使用两个不同的图像一样,两个图像中的描述符之间存在线条!

我的代码的这些输出,无论是两个图像 - 我与它们进行比较 - 都相似或不同,结果图像表明两个图像是匹配的.

问题是:我如何区分这两个图像?

真实匹配:

http://store1.up-00.com/Jun11/hxM00286.jpg

假匹配!! :

http://store1.up-00.com/Jun11/D5H00286.jpg

我的代码:

Mat image1, outImg1, image2, outImg2;

// vector of keypoints
vector<KeyPoint> keypoints1, keypoints2;

// Read input images
image1 = imread("C://Google-Logo.jpg",0);
image2 = imread("C://Alex_Eng.jpg",0);

SurfFeatureDetector surf(2500);
surf.detect(image1, keypoints1);
surf.detect(image2, keypoints2);
drawKeypoints(image1, keypoints1, outImg1, Scalar(255,255,255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
drawKeypoints(image2, keypoints2, outImg2, Scalar(255,255,255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

namedWindow("SURF detector img1");
imshow("SURF detector img1", outImg1);

namedWindow("SURF detector img2");
imshow("SURF detector img2", outImg2);

SurfDescriptorExtractor surfDesc;
Mat descriptors1, descriptors2;
surfDesc.compute(image1, keypoints1, descriptors1);
surfDesc.compute(image2, keypoints2, descriptors2);

BruteForceMatcher<L2<float>> matcher;
vector<DMatch> …
Run Code Online (Sandbox Code Playgroud)

c++ opencv object-detection computer-vision surf

19
推荐指数
2
解决办法
4万
查看次数

如何使用OpenCV中的SIFT提取的功能获取目标对象周围的矩形

我在OpenCV中进行物体检测项目,包括将模板图像中的对象与参考图像进行匹配.使用SIFT算法,功能得到精确检测和匹配,但我想在匹配的功能周围使用直肠我的算法使用KD-Tree est ean First技术来获得匹配

opencv object-detection sift

9
推荐指数
2
解决办法
4523
查看次数

标签 统计

object-detection ×2

opencv ×2

c++ ×1

computer-vision ×1

sift ×1

surf ×1