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 版权:本文版权归作者和博客园共有 转载:欢迎转载,但未经作者同意,必须保留此段声明:必须 ...
随机推荐
- java小游戏——猜数字
import java.util.ArrayList; import java.util.List; import java.util.Random; public class Num01 { sta ...
- Jasper_crosstab_measure_display a value of field in crosstab total row
1.create a measure <measure name="myField" class="java.lang.String"> <m ...
- Windows下打开某些软件时显示显卡驱动不是最新的问题
在Windows下打开某些对显卡要求比较高的软件时,会出现某些显卡驱动不是最新,要求更新到最新的提示,但是当你真的去更新显卡驱动的时候,却发现现在的显卡驱动已经是最新了,那么为什么还会有这样的提示呢, ...
- 自己项目中PHP常用工具类大全分享
<?php /** * 助手类 * @author www.shouce.ren * */ class Helper { /** * 判断当前服务器系统 * @return string */ ...
- curl请求模拟post发送json
示例:curl -X POST --header "Content-Type:application/json" --data '{"name":"s ...
- mybatis内置二级缓存。
一.查询缓存的使用,主要是为了提供查询访问速度.将用户对同一数据的重复查询过程简化, 不再每次均从数据库查询获取结果数据,从而提高访问速度. 二.内置二级缓存... 由于MyBatista从缓存中读取 ...
- Java运算符——通过示例学习Java编程(6)
作者:CHAITANYA SINGH 来源:https://www.koofun.com/pro/kfpostsdetail?kfpostsid=17 运算符是表示动作的字符,例如+是表示加法的算 ...
- 五、UML类图和六大原则-----《大话设计模式》
一.单一职责原则 就一个类而言,应该仅有一个引起它变化的原因. 如果一个类承担的职责过多,就等于把这些职责耦合在一起,一个职责的变化可能会削弱或者抑制这个类完成其他职责的能力.这种耦合 ...
- OC 思维导向图
iOS 扩展思维导向图,如下图所示:
- IOS实现弹出菜单效果MenuViewController(背景 景深 弹出菜单)
在写项目时,要实现一个从下移上来的一个弹出菜单,并且背景变深的这么一个效果,在此分享给大家. 主要说一下思路及一些核心代码贴出来,要想下载源码, 请到:http://download.csdn.net ...