keypoint && DMatch
下面单独介绍KEYPOINT 与DMatch的内在联系
std::vector<cv::Point2f> points1, points2;
for (std::vector<cv::DMatch>::const_iterator it= matches.begin();
it!= matches.end(); ++it) {
// Get the position of left keypoints
float x= keypoints1[it->queryIdx].pt.x;
8 float y= keypoints1[it->queryIdx].pt.y;
points1.push_back(cv::Point2f(x,y));
cv::circle(image1,cv::Point(x,y),,cv::Scalar(,,),);
// Get the position of right keypoints
x= keypoints2[it->trainIdx].pt.x;
13 y= keypoints2[it->trainIdx].pt.y;
cv::circle(image2,cv::Point(x,y),,cv::Scalar(,,),);
points2.push_back(cv::Point2f(x,y));
}
class KeyPoint
{
Point2f pt; //坐标 常用的就是这个了
float size; //特征点邻域直径
float angle; //特征点的方向,值为[零,三百六十),负值表示不使用
float response;
int octave; //特征点所在的图像金字塔的组
int class_id; //用于聚类的id
}
存放匹配结果的结构:
struct DMatch
{ //三个构造函数
DMatch():
queryIdx(-1),trainIdx(-1),imgIdx(-1),distance(std::numeric_limits<float>::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) {}
intqueryIdx; //此匹配对应的查询图像的特征描述子索引
inttrainIdx; //此匹配对应的训练(模板)图像的特征描述子索引
intimgIdx; //训练图像的索引(若有多个)
/*********************************
int queryIdx; // query descriptor index
int trainIdx; // train descriptor index
int imgIdx; // train image index***********************************/
float distance; //两个特征向量之间的欧氏距离,越小表明匹配度越高。
bool operator < (const DMatch &m) const;
};
- 3
图片中特征点欧式距离的计算公式:
0ρ = √( (x1-x2)2+(y1-y2)2 ) |x| = √( x2 + y2 )
keypoint && DMatch的更多相关文章
- OpenCV学习笔记:opencv_core模块
一,简介: opencv最基础的库.包含exception,point,rect,size,slice,vector,matrix,image等数据结构,和相应的操作函数,以及一些基础算法. 二,分析 ...
- opencv的DMatch
1.DMatch是描述图像匹配信息的类 /** @brief Class for matching keypoint descriptors query descriptor index, train ...
- [OpenCV]DMatch类和KeyPoints类:特征点匹配
DMatch struct CV_EXPORTS_W_SIMPLE DMatch { CV_WRAP DMatch() : queryIdx(-), trainIdx(-), imgIdx(-), d ...
- Opencv Surf算子中keyPoints,描述子Mat矩阵,配对向量DMatch里都包含了哪些好玩的东东?
Surf算法是一把牛刀,我们可以很轻易的从网上或各种Opencv教程里找到Surf的用例,把例程中的代码或贴或敲过来,满心期待的按下F5,当屏幕终于被满屏花花绿绿的小圆点或者N多道连接线条霸占时,内心 ...
- SIFT算法:KeyPoint找寻、定位与优化
SIFT算法:DoG尺度空间生产 SIFT算法:KeyPoint找寻.定位与优化 SIFT算法:确定特征点方向 SIFT算法:特征描述子 目录: 1.找寻 2.定位 3.优化 1 KeyPoint ...
- 论文阅读笔记五十一:CenterNet: Keypoint Triplets for Object Detection(CVPR2019)
论文链接:https://arxiv.org/abs/1904.08189 github:https://github.com/Duankaiwen/CenterNet 摘要 目标检测中,基于关键点的 ...
- opencv中keypoint数据结构分析
分析opencv中keypoint数据结构的相关信息,找到opencv的document(http://docs.opencv.org/java/org/opencv/features2d/KeyPo ...
- 为一个vector<cv::KeyPoint*> 类型的变量做初始化
vector<cv::KeyPoint*> keypoints; int N; keypoints = vector<cv::KeyPoint*>(N, static_cast ...
- A Convolution Tree with Deconvolution Branches: Exploiting Geometric Relationships for Single Shot Keypoint Detection
作者:嫩芽33出处:http://www.cnblogs.com/nenya33/p/6817781.html 版权:本文版权归作者和博客园共有 转载:欢迎转载,但未经作者同意,必须保留此段声明:必须 ...
随机推荐
- Codeforces Round #396 (Div. 2) C
Mahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz ...
- 解决 openSUSE 中 Sublime Text 3 的中文显示和输入问题
测试环境 系统版本:openSUSE Leap 42.2 桌面环境:KDE Plasma 5输入法:fcitx-rime (中州韵) 见周围用 Windows 和 macOS 的小伙伴几乎都在用简单强 ...
- chrome浏览器历史版本
持续更新中······ google-chrome 浏览器 win64位 版本号 大小 官网更新日期 66.0.3359.181 48.58 MB 2018年5月16日 65.0.3325.181 4 ...
- vue echarts 大小自适应
窗口大小时候 ,echarts图自适应 在创建图表的方法中直接,用resize方法 let myChart=this.$refs.myChart; let mainChart = echarts.in ...
- python 多继承(新式类) 三
深入super 一下内容引用自:http://www.cnblogs.com/lovemo1314/archive/2011/05/03/2035005.html,写的挺好的. 代码段3 class ...
- 牛客网Java刷题知识点之线程的几种可用状态(新建、可运行、运行、阻塞、死亡)
不多说,直接上干货! https://www.nowcoder.com/ta/review-java/review?query=&asc=true&order=&page=13 ...
- 在Asp.net MVC4 中使用SimpleMembershipProvider
一.创建MVC4项目 运行Visual Studio Express 2012 for Web,新建ASP.NET MVC4 Web 应用程序,命名为“Demo”,选择空模版.这样就创建了一个干净的M ...
- CSS3在hover下的几种效果
CSS3在hover下的几种效果代码分享,CSS3在鼠标经过时的几种效果集锦 效果一:360°旋转 修改rotate(旋转度数) * { transition:All 0.4s ease-in-out ...
- Todolist总结
一.组件类里面的函数尽可能写成箭头函数的形式,方便绑定this 上面的箭头函数是好的,写面的不好,他需要在用的时候绑定this,或者在constructor绑定,如下: 如上用的时候绑定this是不好 ...
- Sass基本特性
Sass扩展/继承@extend 代码的继承,声明方式:.class;调用方式:@extend 如: .btn { border: 1px solid #ccc; padding: 6px 10px; ...