Question

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...

Was it helpful?

Solution

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.

OTHER TIPS

I have found some short description about the class_id of a keypoint.

OpenCV says that:

class_id is object ID, that can be used to cluster keypoints by an object they belong to.

Here is the link.

Hope this will be somehow helpful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top