opencv_关于特征点匹配的数据结构
来源:互联网 发布:海康威视管理端口设置 编辑:程序博客网 时间:2024/06/08 14:07
DMatch
struct CV_EXPORTS_W_SIMPLE DMatch{ CV_WRAP DMatch() : queryIdx(-1), trainIdx(-1), imgIdx(-1), distance(FLT_MAX) {}//1 CV_WRAP DMatch( int _queryIdx, int _trainIdx, float _distance ) : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(-1), distance(_distance) {}//2 CV_WRAP DMatch( int _queryIdx, int _trainIdx, int _imgIdx, float _distance ) : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(_imgIdx), distance(_distance) {}//3 CV_PROP_RW int queryIdx; // query descriptor index CV_PROP_RW int trainIdx; // train descriptor index CV_PROP_RW int imgIdx; // train image index CV_PROP_RW float distance; // less is better bool operator<( const DMatch &m ) const { return distance < m.distance; }};
1、2、3不用说,是三个构造函数。
接着,
int queryIdx –>是测试图像的特征点描述符(descriptor)的下标,同时也是描述符对应特征点(keypoint)的下标。
int trainIdx –> 是样本图像的特征点描述符的下标,同样也是相应的特征点的下标。
int imgIdx –>当样本是多张图像的话有用。
float distance –>代表这一对匹配的特征点描述符(本质是向量)的欧氏距离,数值越小也就说明两个特征点越相像。
最后,
也就是一个小于操作符的重载,用于比较和排序。 比较的是上述的distance,当然是越小越好。
KeyPoint
class CV_EXPORTS_W_SIMPLE KeyPoint{public: //! the default constructor CV_WRAP KeyPoint() : pt(0,0), size(0), angle(-1), response(0), octave(0), class_id(-1) {} //! the full constructor KeyPoint(Point2f _pt, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1) : pt(_pt), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {} //! another form of the full constructor CV_WRAP KeyPoint(float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1) : pt(x, y), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {} size_t hash() const; //! converts vector of keypoints to vector of points static void convert(const vector<KeyPoint>& keypoints, CV_OUT vector<Point2f>& points2f, const vector<int>& keypointIndexes=vector<int>()); //! converts vector of points to the vector of keypoints, where each keypoint is assigned the same size and the same orientation static void convert(const vector<Point2f>& points2f, CV_OUT vector<KeyPoint>& keypoints, float size=1, float response=1, int octave=0, int class_id=-1); //! computes overlap for pair of keypoints; //! overlap is a ratio between area of keypoint regions intersection and //! area of keypoint regions union (now keypoint region is circle) static float overlap(const KeyPoint& kp1, const KeyPoint& kp2); CV_PROP_RW Point2f pt; //!< coordinates of the keypoints CV_PROP_RW float size; //!< diameter of the meaningful keypoint neighborhood CV_PROP_RW float angle; //!< computed orientation of the keypoint (-1 if not applicable); //!< it's in [0,360) degrees and measured relative to //!< image coordinate system, ie in clockwise. CV_PROP_RW float response; //!< the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling CV_PROP_RW int octave; //!< octave (pyramid layer) from which the keypoint has been extracted CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to)};
0 0
- opencv_关于特征点匹配的数据结构
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_局部图像特征的提取与匹配_源代码
- OpenCV_描述和匹配兴趣点
- 2.3微秒的特征点匹配
- OpenCV-基于特征点的图像匹配
- 基于特征点匹配的车辆跟踪
- 基于opencv的特征点匹配法
- 提高特征点匹配的方法
- 特征点的提取与匹配
- OpenCV_基于HOG特征的行人检测
- OpenCV_基于HOG特征的行人检测
- OpenCV_基于HOG特征的行人检测
- codeforces 361 div2 E. Mike and Geometry Problem
- NB-IoT标准确定,物联网将腾飞
- C++中使用STL的hashmap
- opencv 截取轮廓中的图像——实现PS中的抠图功能 Opencv extract area circled by contour
- 表达式合法判断
- opencv_关于特征点匹配的数据结构
- C/C++中static关键字详解
- UVA673Parentheses Balance
- Java通过反射获取带参数构造方法并使用
- 一个PHP+Mysql手工注入例子
- Leetcode解题笔记(Linked List)
- mysql如何随机取数据
- jQuery 事件
- uva 10572 Black & White 插头dp