简体   繁体   English

如何将模板与SURF的原始图像匹配?

[英]How can I match a template with the original image by SURF?

Recently, I have worked with robotics project; 最近,我从事机器人项目。 my robot can detect the object by its colour but I found that not good enough for different object. 我的机器人可以通过颜色来检测物体,但是我发现对于其他物体而言,它还不够好。 Therefore, I want the robot SURF the image on real time to find the target object that will be defined using its template. 因此,我希望机器人实时对图像进行搜索,以找到将使用其模板定义的目标对象。

Unfortunately, I don't know how to match the key points of the template with its image in the image. 不幸的是,我不知道如何将模板的关键点与其图像中的图像进行匹配。

There is a very good example to know how to use SURF in the sample directory in your OpenCV directory: OpenCV/samples/c/find_obj.cpp 在您的OpenCV目录的示例目录中,有一个很好的示例可以了解如何使用SURF:OpenCV / samples / c / find_obj.cpp

You need to use the SURF descriptors (see lines 245-255) 您需要使用SURF描述符(请参见第245-255行)

CvSeq *objectKeypoints = 0, *objectDescriptors = 0;
CvSURFParams params = cvSURFParams(500, 1);
cvExtractSURF(object, 0, &objectKeypoints, &objectDescriptors, storage, params);

You should read the descriptors with a CvSeqReader: 您应该使用CvSeqReader读取描述符:

CvSeqReader reader;
cvStartReadSeq(descriptors, &reader, 0);

Do the same thing with scene and use the two descriptors in NN search to find the match between them. 对场景做同样的事情,并在NN搜索中使用两个描述符来找到它们之间的匹配。 One again, the sample given by OpenCV should help you a lot :) 再一次,OpenCV提供的示例应该对您有很大帮助:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在从ORIGINAL-IMAGE中提取的SUB-IMAGE中执行模板匹配过程并在原始图像中显示结果 - How can I perform Template Matching process in SUB-IMAGE extracted from ORIGINAL-IMAGE and Display the results in Original Image 如何在模板中的类型之间转换回原始类型 - How can I convert between types in a template and back to the original type 如何在OpenCV中使用Surf算法在源图像中找到模板图像的确切角 - How to find the exact corners of template image inside a source image using surf algorithm in opencv 如何在不使用opencv的情况下以C ++原始图像形式降低亮度? - How can I decrease the brightness by coming to original form of image in C++ without using opencv? 使用SURF如何通过说这是匹配图像给出结果? - Using SURF how to give result by saying this is the matching image? 如何使用OpenCV计算图像中所有点的SURF点? - How to calculate SURF points for ALL the points in an image using OpenCV? 为什么C ++模板类型匹配与基类引用不匹配,如何使其与基类引用匹配? - why C++ template type matching does not match to base class refrence, how can I make it match to base class refrence? 如何让C ++更喜欢匹配父类重载而不是模板? - How can I make C++ prefer to match a parent class overload instead of a template? 在没有括号的宏中使用逗号:如何与模板混合和匹配? - Using commas inside a macro without parenthesis: How can I mix and match with a template? 将屏幕上的图像与模板图片匹配 - Match Image on Screen with Template Pictures
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM