opencv中类cv :: KeyPoint的类成员class_id的含义和用法是什么? [英] what is the meaning and use of class member class_id of class cv::KeyPoint in opencv?

查看:1478
本文介绍了opencv中类cv :: KeyPoint的类成员class_id的含义和用法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在OpenCV 2.4.3的参考手册中 KeyPoint :: class_id 被描述为可以用于由它们所属的对象聚集关键点的对象ID。 / p>

由于缺乏对关键点的充分了解,我无法理解 class_id 的用途。



我的另一个问题是,通过使用特征检测器,描述符和匹配器,我们可以检测训练图像中查询对象的匹配关键点。但是如何在训练图像中分割出查询对象。我们可以使用抓取或分水岭算法吗?如果是,怎么做?



回答任何一个问题都会有所帮助。



提前致谢...

解决方案

<$ c实际上,$ c> class_id 成员字段可用于存储您发现对每个关键点有用的任何信息。正如文档所述,您可以存储检测到的对象的ID。



例如,您有一个图像,从中提取关键点(例如,使用SURF) ),运行一些具有这些功能的对象检测器,结果是每个输入功能现在包含在 class_id 相应对象的id,如果它们附加到,则为-1没有对象。我实际上并不知道这个字段是否由某些OpenCV函数填充,或者仅供您使用。



关于第二个问题,匹配的功能可能不足以将对象分段,因为要素可以位于对象内部,因此您无法获得有关轮廓的任何信息。但是,如果您有关于该对象的更多信息,这是一个很好的起点。例如,如果您知道对象是平面(墙上的海报),则可以使用要素匹配来计算输入和训练图像之间的单应性。这会给你一个大纲。或者,例如,大量紧密匹配的特征可以指示对象的存在。从那里,您可以尝试其他颜色分割,边缘匹配等。


In reference manual of OpenCV 2.4.3 KeyPoint::class_id is described as "object id that can be used to clustered keypoints by an object they belong to".

Due to lack of my adequate knowledge about 'keypoint' I can't understand whats the purpose of class_id.

My another question is, by using feature detector, descriptor and matcher we can detect matching keypoints of a query object in a training image. But how can segment out the query object in the training image. Can we use grabcut or watershed algorithm? if yes, how?

Answer of either question will be helpful.

Thanks in advance...

解决方案

The class_id member field can be used, in practice, to store any information that you find useful for each keypoint. As the documentation says, you can store, for example, the id of a detected object.

For example, you have an image, extract keypoints from it (e.g. with SURF), run some object detector with these features, and the result is that each input feature contains now in class_id the id of the corresponding object, or -1 if they are attached to no object. I don't actually know if this field is filled by some OpenCV function or it is just for your use.

Regarding your second question, matching features may not be enough to segment out your object, because features can be located inside the object, so that you don't get any information about the outline. This is a good starting point, though, if you have more information about the object. For example, if you know that your object is planar (a poster on the wall), you can use the feature matches to compute a homography between the input and the training images. This would give you an outline. Or, for example, a large collection of close matched features may be an indication of the presence of an object. From that, you may try some other color segmentation, edge matching, etc.

这篇关于opencv中类cv :: KeyPoint的类成员class_id的含义和用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆