我是靠谱客的博主 危机服饰,这篇文章主要介绍【杂谈opencv】OpenCV中的KeyPoint与DMatch1-特征点KeyPoint2-存放匹配结果的结构DMatch,现在分享给大家,希望可以做个参考。

1-特征点KeyPoint

class KeyPoint
{
Point2f
pt;
//坐标
float
size; //特征点邻域直径
float
angle; //特征点的方向,值为[零,三百六十),负值表示不使用
float
response;
int
octave; //特征点所在的图像金字塔的组
int
class_id; //用于聚类的id
}; 


=====================分割线=======================


2-存放匹配结果的结构DMatch

/*Class for matching keypoint descriptors - 用于匹配关键点描述符的类
query descriptor index, train descriptor index, train image index, and distance between descriptors.
*/
class CV_EXPORTS_W_SIMPLE DMatch
{
public:
//三个构造函数
CV_WRAP DMatch();
CV_WRAP DMatch(int _queryIdx, int _trainIdx, float _distance);
CV_WRAP DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance);
CV_PROP_RW int queryIdx; // query descriptor index - 此匹配对应的查询图像的特征描述子索引
CV_PROP_RW int trainIdx; // train descriptor index - 此匹配对应的训练(模板)图像的特征描述子索引
CV_PROP_RW int imgIdx;
// train image index - 训练图像索引(若有多个)
//例如已知一幅图像的sift描述子,与其他十幅图像的描述子进行匹配,找最相似的图像,则imgIdx此时就有用了。
CV_PROP_RW float distance; // //两个特征向量之间的欧氏距离,越小表明匹配度越高。
//DMatch比较运算符重载,比较的是DMatch中的distance,小于为true,否则为false
// less is better
bool operator<(const DMatch &m) const;
};









最后

以上就是危机服饰最近收集整理的关于【杂谈opencv】OpenCV中的KeyPoint与DMatch1-特征点KeyPoint2-存放匹配结果的结构DMatch的全部内容,更多相关【杂谈opencv】OpenCV中内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(140)

评论列表共有 0 条评论

立即
投稿
返回
顶部