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 版权:本文版权归作者和博客园共有 转载:欢迎转载,但未经作者同意,必须保留此段声明:必须 ...
随机推荐
- POJ-1258-Agri Ned
链接:https://vjudge.net/problem/POJ-1258#author=fuxianda 题意: 有n个农场,已知这n个农场都互相相通,有一定的距离,现在每个农场需要装光纤,问怎么 ...
- 【aspnetcore】在asp.net core中配置使用AutoMapper
网上使用AutoMapper的文章很多,就不多说了.这里主要记录一下怎么在项目中配置和使用. 首先是从NuGet获取AutoMapper. 在Startup.cs文件中注册AutoMapper服务 p ...
- c51中的bit,SBIT
在51单片机的0x20~0x2f,是bdata区既可以字节寻址又可以位寻址.用法: 1 先用bdata存储类型关键字 定义变量,注意其值就是地址 .unsigned char bdata MYBITS ...
- python_12(并发编程)
第1章 进程 1.1 队列Queue 1.2 Queue方法 1.2.1 q.get([block [,timeout]]) 1.2.2 q.get_nowait() 1.2.3 q.put(item ...
- MDX查询语句
另:15个经典的MDX查询语句 另:http://www.cnblogs.com/biwork/p/3437959.html 1.排名+排序+量值过滤: WITH member [Measures]. ...
- jq中的attr和prop属性
今天在做checkbox的全选等功能时刚开始用的是 $('input[type='checkbox']").attr("checked","true" ...
- Linux用户管理-用户账号管理
一.用户账号的增.删.改.查 1>添加用户------useradd 注:1.用户名不应是纯数字或者以数字开头 2.将登陆shell改为/sbin/nologin可禁止用户登录 格式:usera ...
- kafka java api生产者
import java.util.HashMap; import java.util.List;import java.util.Map;import java.util.Properties; im ...
- 简单的UDP程序
接受端: package com.dcz.udp; import java.io.IOException; import java.net.DatagramPacket; import java.ne ...
- 随机不重复的取数组元素,并赋值给div使用
function pos(){ var items = $('.starone'); items.each(function () { var rand = getRandom(); $(this). ...