博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenCV特征匹配相关结构(KeyPoint&DMatch类型简介)
阅读量:4158 次
发布时间:2019-05-26

本文共 1832 字,大约阅读时间需要 6 分钟。



本文转自:

1. 特征点类:

  1. [cpp]
    1. class KeyPoint  
    2. {            Point2f  pt;  //坐标  
    3.              float  size; //特征点邻域直径  
    4.              float  angle; //特征点的方向,值为[零,三百六十),负值表示不使用  
    5.              float  response;  
    6.              int  octave; //特征点所在的图像金字塔的组  
    7.              int  class_id; //用于聚类的id  
    8. }  
    class KeyPoint{            Point2f  pt;  //坐标             float  size; //特征点邻域直径             float  angle; //特征点的方向,值为[零,三百六十),负值表示不使用             float  response;             int  octave; //特征点所在的图像金字塔的组             int  class_id; //用于聚类的id}
    2.  存放匹配结果的结构:
  1. [cpp]
    1. struct DMatch  
    2. {         //三个构造函数  
    3.           DMatch():  
    4. queryIdx(-1),trainIdx(-1),imgIdx(-1),distance(std::numeric_limits<float>::max()) {}  
    5.           DMatch(int  _queryIdx, int  _trainIdx, float  _distance ) :  
    6. queryIdx( _queryIdx),trainIdx( _trainIdx), imgIdx(-1),distance( _distance) {}  
    7.           DMatch(int  _queryIdx, int  _trainIdx, int  _imgIdx, float  _distance ) :                   queryIdx(_queryIdx), trainIdx( _trainIdx), imgIdx( _imgIdx),distance( _distance) {}  
    8.           int queryIdx;  //此匹配对应的查询图像的特征描述子索引  
    9.           int trainIdx;   //此匹配对应的训练(模板)图像的特征描述子索引  
    10.           int imgIdx;    //训练图像的索引(若有多个)  
    11.           float distance;  //两个特征向量之间的欧氏距离,越小表明匹配度越高。  
    12.           bool operator < (const DMatch &m) const;  
    13. };  
    struct DMatch{         //三个构造函数          DMatch():queryIdx(-1),trainIdx(-1),imgIdx(-1),distance(std::numeric_limits
    ::max()) {} DMatch(int _queryIdx, int _trainIdx, float _distance ) :queryIdx( _queryIdx),trainIdx( _trainIdx), imgIdx(-1),distance( _distance) {} DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance ) : queryIdx(_queryIdx), trainIdx( _trainIdx), imgIdx( _imgIdx),distance( _distance) {} int queryIdx; //此匹配对应的查询图像的特征描述子索引 int trainIdx; //此匹配对应的训练(模板)图像的特征描述子索引 int imgIdx; //训练图像的索引(若有多个) float distance; //两个特征向量之间的欧氏距离,越小表明匹配度越高。 bool operator < (const DMatch &m) const;};
    3.  图片中特征点欧式距离的计算公式:
    0ρ = √( (x1-x2)2+(y1-y2)2 ) |x| = √( x2 + y2 )

转载地址:http://ztuxi.baihongyu.com/

你可能感兴趣的文章
前阿里手淘前端负责人@winter:前端人如何保持竞争力?
查看>>
【JavaScript 教程】面向对象编程——实例对象与 new 命令
查看>>
我在网易做了6年前端,想给求职者4条建议
查看>>
SQL1015N The database is in an inconsistent state. SQLSTATE=55025
查看>>
RQP-DEF-0177
查看>>
MySQL字段类型的选择与MySQL的查询效率
查看>>
Java的Properties配置文件用法【续】
查看>>
JAVA操作properties文件的代码实例
查看>>
java杂记
查看>>
RunTime.getRuntime().exec()
查看>>
Oracle 分组排序函数
查看>>
VMware Workstation 14中文破解版下载(附密钥)(笔记)
查看>>
日志框架学习
查看>>
日志框架学习2
查看>>
SVN-无法查看log,提示Want to go offline,时间显示1970问题,error主要是 url中 有一层的中文进行了2次encode
查看>>
NGINX
查看>>
Qt文件夹选择对话框
查看>>
DeepLearning tutorial(7)深度学习框架Keras的使用-进阶
查看>>
第三方SDK:JPush SDK Eclipse
查看>>
第三方开源库:imageLoader的使用
查看>>