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 版权:本文版权归作者和博客园共有 转载:欢迎转载,但未经作者同意,必须保留此段声明:必须 ...
随机推荐
- 旧版本linaro-ubuntu更改软件源
最近打算研究下arm版本的linaro ubuntu桌面系统,但是在安装软件时速度实在太慢,便想修改一下软件源. 无奈查看系统版本时,显示的是linaro 11.12,但却不知和ubuntu有和关系, ...
- 修复在unix系统里的文件打开不能显示正常的颜色问题
在mac上面看到mysql的配置文件的颜色永远是白色,为了让配置文件的颜色更加分明些,这个时候只需进入到home目录下新建一个.vimrc文件, vim .vimrc set nu syntax o ...
- LINQ to Entities不支持Convert.ToDateTime方法解決一例
錯誤提示: LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' met ...
- 一张图告诉你,只会NodeJS还远远不够!
NodeJS看似小巧简单,却威力无边,一张图,秒懂!!! 可能很多人还不会安装,但至少已经会了javascript,或者至少会了jquery,那么js还可以干更多的事情!js还可以干更多的事情!js还 ...
- uvm_reg_field——寄存器模型(二)
uvm_reg_field是最基本寄存器单元. typedef class uvm_reg_cbs; //----------------------------------------------- ...
- MD5 介绍
MD5(单向散列算法)的全称是Message-Digest Algorithm 5(信息-摘要算法),经MD2.MD3和MD4发展而来.MD5算法的使用不需要支付任何版权费用. MD5功能: 输入任意 ...
- Java MVC 分页实例
共4个文件 requestLogList.jsp RequestInfoController.java RequestInfoBean.java RequestInfoService.java 1.r ...
- SQL,数据库连接
- 通过StringBuilder的reverse()实现倒序
import java.util.Scanner; public class ReverseString { public static void main(String[] args) { Scan ...
- nginx “403 Forbidden” 错误 解决方法
错误的原因是缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件 只需要配置时加一句 index index.h ...