博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
opencv的KeyPoint
阅读量:3977 次
发布时间:2019-05-24

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

/*! The Keypoint Class The class instance stores a keypoint, i.e. a point feature found by one of many available keypoint detectors, such as Harris corner detector, cv::FAST, cv::StarDetector, cv::SURF, cv::SIFT, cv::LDetector etc. The keypoint is characterized by the 2D position, scale (proportional to the diameter of the neighborhood that needs to be taken into account), orientation and some other parameters. The keypoint neighborhood is then analyzed by another algorithm that builds a descriptor (usually represented as a feature vector). The keypoints representing the same object in different images can then be matched using cv::KDTree or another method.*//*  KeyPoint 类  KeyPoint类主要是存储图像中检测到的关键点(特征点),特征点主要是由特征检测器在图像中进行检测得到的,常见的  特征检测器有:Harris corner detector, cv::FAST, cv::StarDetector, cv::SURF, cv::SIFT, cv::LDetector等。  关键点主要是由二维特征,尺度(与需要考虑的邻域直径成正比),方向和一些其他的参数。关键点邻域是由生成  描述子(通常被表示成一个特征向量)的算法分析得到的。在不同图像中表示相同对象的关键点能通过cv::KDTree  或其他方法匹配到。*///下面是对CV_EXPORTS_W_SIMPLE的宏定义以及CV_EXPORTS的宏定义//实际上将CV_EXPORTS、CV_EXPORTS_W_SIMPLE定义为__declspec(dllexport)//在更新的编译器版本中,可以使用 __declspec(dllexport) 关键字从 DLL 导出数据、函数、类或类成员函数。//__declspec(dllexport) 会将导出指令添加到对象文件中,当试图导出 C++ 修饰函数名时,这种便利最明显。//若要导出类中的所有公共数据成员和成员函数,关键字必须出现在类名的左边。/*#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS#  define CV_EXPORTS __declspec(dllexport)#else#  define CV_EXPORTS#endif*///CV_EXPORTS_W_SIMPLE的宏定义/*#define CV_EXPORTS_W_SIMPLE CV_EXPORTS*/class CV_EXPORTS_W_SIMPLE KeyPoint{public:	//默认构造函数,CV_WRAP是特别的信息宏的标志,没别的意思    //! the default constructor    CV_WRAP KeyPoint() : pt(0,0), size(0), angle(-1), response(0), octave(0), class_id(-1) {}	//带参数的构造函数,关键点位置为Point2f类型    //! 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) {}	//带参数的构造函数,关键点位置为float型的x和y    //! 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;	//将关键点转换成point点    //! converts vector of keypoints to vector of points    static void convert(const vector
& keypoints, CV_OUT vector
& points2f, const vector
& keypointIndexes=vector
()); //将关键点转换成point点,且关键点的邻域直径和方向信息都统一成一样的 //! 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
& points2f, CV_OUT vector
& 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 特别的信息宏的标志 //pt是关键点的坐标 CV_PROP_RW Point2f pt; //!< coordinates of the keypoints //size是关键点的邻域直径 CV_PROP_RW float size; //!< diameter of the meaningful keypoint neighborhood //angle是关键点的方向,在[0,360]度之间,方向与图像坐标系有关,例如顺时针 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. //response是最强特征点被选择的响应,可用来进行更近一步的排序或子采样 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 //octave是关键点提取所在的金子塔层数 CV_PROP_RW int octave; //!< octave (pyramid layer) from which the keypoint has been extracted //class_id 若关键点被聚类的话,class_id是关键点所在聚类的id CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to)};

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

你可能感兴趣的文章
Android的传感器HAL层的书写---基…
查看>>
生成和使用动态链接库和静态链接库…
查看>>
linux工作队列(转)
查看>>
工作队列的初始化(INIT_WORK的参…
查看>>
sysfs&nbsp;and&nbsp;/proc/bus/usb/device
查看>>
linux工作队列(转)
查看>>
跟我一起写udev规则(译)
查看>>
sysfs&nbsp;and&nbsp;/proc/bus/usb/device
查看>>
跟我一起写udev规则(译)
查看>>
USB和sysfs文件系统
查看>>
USB和sysfs文件系统
查看>>
udev(八):实战:使用udevadm修…
查看>>
android开发环境搭建(for&nbsp;驱动开发…
查看>>
android开发环境搭建(for&nbsp;驱动开发…
查看>>
android驱动例子(LED灯控制)
查看>>
为Android内核添加新驱动,并添加…
查看>>
利用条件变量实现线程间同步
查看>>
利用条件变量实现线程间同步
查看>>
linux&nbsp;下&nbsp;C&nbsp;程序(进程)&nbsp;内存布局
查看>>
linux&nbsp;下&nbsp;C&nbsp;程序(进程)&nbsp;内存布局
查看>>