【OpenCV】KeyPoint数据结构

KeyPoint数据结构

KeyPoint数据结构官方说明网站:(http://docs.opencv.org/3.3.0/d2/d29/classcv_1_1KeyPoint.html)

公有属性
  1. (float)angle:角度,表示关键点的方向,通过Lowe大神的论文可以知道,为了保证方向不变形,SIFT算法通过对关键点周围邻域进行梯度运算,求得该点方向。-1为初值。

  2. (int)class_id:当要对图片进行分类时,我们可以用class_id对每个特征点进行区分,未设定时为-1,需要靠自己设定

  3. (int)octave:代表是从金字塔哪一层提取的得到的数据。

  4. (Point2f)pt:关键点点的坐标

  5. (float)response:响应程度,代表该点强壮大小—response代表着该关键点how good,更确切的说,是该点角点的程度。

  6. (float)size:该点直径的大小

公有成员函数

三个构造函数

  1. KeyPoint () : 默认构造函数

  2. KeyPoint (Point2f _pt, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1)

    参数
        _pt	     : 关键点的x和y坐标
        _size	 : 关键点直径
        _angle	 : 关键点方向
        _response:关键点上的关键点检测器响应(即关键点的强度)
        _octave	 : 已检测到关键点的pyramid octave
        _class_id: 关键点ID
    
  3. KeyPoint (float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1)

    参数
        x	     : 关键点的x坐标
        y	     : 关键点的y坐标
        _size	 : 关键点直径
        _angle	 : 关键点方向
        _response:关键点上的关键点检测器响应(即关键点的强度)
        _octave	 : 已检测到关键点的pyramid octave
        _class_id: 关键点ID
    
  4. size_t hash () const

静态公有成员函数
  1. static void convert (const std::vector< KeyPoint > &keypoints, std::vector< Point2f > &points2f, const std::vector< int > &keypointIndexes=std::vector< int >())

    此方法将关键点的矢量转换为点矢量或反向,其中每个关键点被指定相同的大小和相同的方向。

    参数
    keypoints	    : 从任何特征检测算法(如SIFT / SURF / ORB)获得的关键点
    points2f	    : 每个关键点的(x,y)坐标数组
    keypointIndexes	: 要转换为点的关键点的索引数组。(像掩码一样只转换指定的关键点)
    
  2. static void convert (const std::vector< Point2f > &points2f, std::vector< KeyPoint > &keypoints, float size=1, float response=1, int octave=0, int class_id=-1)

    这是一个重载的成员函数,为方便起见而提供。它与上述函数的不同之处仅在于它接受的参数。

    参数
    points2f  : 每个关键点的(x,y)坐标数组
    keypoints : 从任何特征检测算法(如SIFT / SURF / ORB)获得的关键点
    size	  : 关键点直径
    response  : 关键点上的关键点检测器响应(即关键点的强度)
    octave	  : 已检测到关键点的pyramid octave
    class_id  : 关键点 id
    
  3. static float overlap (const KeyPoint &kp1, const KeyPoint &kp2)

    此方法计算关键点对的重叠。重叠是关键点区域交叉区域与关键点区域联合区域之间的比率(将关键点区域视为圆圈)。如果它们不重叠,我们就会得到零。如果它们在相同大小的相同位置重合,我们得到1。

    参数
        kp1	: First keypoint
        kp2	: Second keypoint
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值