[英]How to get keyPoint ID
I'm doing a matching programm in opencv and C++ and I want to classifier my keyPoints-detected depending of the region of image they are. 我正在用opencv和C ++进行匹配的程序,我想根据它们所检测的图像区域对检测到的keyPoints进行分类。
ie: If I detect a keypoint in the top of the image I want to classifier this in region 1... An depending where I found the keypoints I want to classifier them. 即:如果我在图像的顶部检测到关键点,则要在区域1中对其进行分类。这取决于我在哪里找到要对它们进行分类的关键点。
Finally I'm going to do a new classifier vector like this: 最后,我将要做一个新的分类器矢量,如下所示:
vector classifier_vector;
向量classifier_vector;
and one of the two parameters that I need is the id of every detected points. 我需要的两个参数之一是每个检测到的点的ID。
Does someone know how I can to get the keypoints id? 有人知道我如何获得关键点ID吗?
I'm not sure about the next but I saw that the parameter I need to get is 我不确定下一个,但是我看到需要获取的参数是
int _class_id
int _class_id
Am I right? 我对吗?
Thanks everybody. 谢谢大家。 ;)
;)
OpenCV have a KeyPoint class which have the following parameters: OpenCV具有一个KeyPoint类,该类具有以下参数:
pt (x,y) -> the position of the KeyPoints, size - size of the keypoint, angle - orientation of the keypoint, response - strength of the keypoint, octave - number of octave layer the keypoint is detected, class_id - the number of object the keypoint belongs to. pt (x,y)->关键点的位置, 大小 -关键点的大小, 角度 -关键点的方向, 响应 -关键点的强度, 倍频程 -检测到关键点的八度音阶数, class_id-数量关键点所属的对象。
So basically what you need is the class_id . 所以基本上您需要的是class_id 。
keyPoint kpt;
kpt.class_id;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.