stitching detail输出的dot图含义

如果利用opencv里面提供的stitching detail的话。

输入参数:

stitching_detail --save_graph a.dot 1.png 2.png

其中a.dot 文件中的内容如下:

graph matches_graph{

"1.png" -- "2.png"[label="Nm=26, Ni=19, C=1.20253"];

}

// 什么是 dot:    https://zh.wikipedia.org/wiki/DOT语言

//如何配置 stitching detail 在这个作者的随笔里面有提到。可以自行查看

那么这这个 输出的结果什么意思呢? 在stackoverflow 上面有这样一个提问:

http://stackoverflow.com/questions/26364594/image-stitching-details-with-opencv

以下原文带翻译。

Image Stitching details with OpenCV

opencv图像拼接细节

I am trying to get deep into stitching. I am using cv::detail.

我在尝试更加深入的理解stitching。我在使用cv::detail

I am trying to follow this example:

https://github.com/Itseez/opencv/blob/master/samples/cpp/stitching_detailed.cpp

我运行了以下例子

I roughly understand the stitching pipeline.

我基本上理解了拼接管道

there is a function matchesGraphAsString() which return a graph. I am wondering how does it even compute this graph. Further, what is the dfination of confidence interval in this case.

这里面有一个matchesGraphAsString() 函数可以返回一张图片。我想知道它是如何得到这个图的。更进一步的,如何定义图片之间的置信度。

The output is in DOT format and a sample graph looks like

这个图大概长成这样。

graph matches_graph{"15.jpg" -- "13.jpg"[label="Nm=75, Ni=50, C=1.63934"];"15.jpg" -- "12.jpg"[label="Nm=47, Ni=28, C=1.26697"];"15.jpg" -- "14.jpg"[label="Nm=149, Ni=117, C=2.22011"];"11.jpg" -- "13.jpg"[label="Nm=71, Ni=52, C=1.77474"];"11.jpg" -- "9.jpg"[label="Nm=46, Ni=37, C=1.69725"];"11.jpg" -- "10.jpg"[label="Nm=87, Ni=73, C=2.14076"];"9.jpg" -- "8.jpg"[label="Nm=122, Ni=99, C=2.21973"];}

What does label, Nm, and Ni mean here? The official document seems to be lacking these details.

这里面的Nm和Ni 都是什么意思?官方的文档看起来缺少细节。

This is a very interesting question indeed. As @hatboyzero pointed out, the meaning of the variables is reasonably straightforward:

这是一个非常有趣的问题。就像hatboyzero指出的,这些变量的含义都有直接的出处。

  • Nm is the number of matches (in the overlapping region, so obvious outliers have been removed already).
  • Ni is the number of inliers after finding a homography with Ransac.
  • C is the confidence that the two images are a match.

其中Nm是匹配的数量,(在重叠区域,明显的外围已经被移除);Ni是内围数量在一个满足ransac单应矩阵。C两幅图是一个匹配时的置信度。

Background to matching

匹配背景

Building a panorama is done by finding interest points in all images and computing descriptors for them. These descriptors, like SIFT, SURF and ORB, were developed so that the same parts of an image could be detected. They are just a medium-dimensional vector (64 or 128 dimensions are typical). By computing the L2 or some other distance between two descriptors, matches can be found. How many matches in a pair of images are found is described by the term Nm.

建造一个全景图是可以被完成的通过找到兴趣点在所有的图片里面并且计算述子为他们。这些述子包括sift,surf 和orb,都是为了探测一幅图片中的相同部分而被研发的。他们是一个中等维度的向量(以64维或者128维最为典型)。通过计算两个数字之间的L2【我猜是范数?】或者其他距离,匹配是可以被找到的。在一对图片中找到的匹配的多少将被描述为Nm。【trem术语】

Notice that so far, the matching has only been done through appearance of image regions around interest points. Very typically, many of these matches are plain wrong. This can be because the descriptor looks the same (think: repetitive object like window sills on a multi-window building, or leaves on a tree) or because the descriptor is just a bit too uninformative.【uninformative 无信息的】

注意到到目前为止,这个匹配仅仅被从这个图片区域中的显现出来的兴趣点所描述。通常的,这些匹配都是错误的。这是因为这些述子看起来很相像(想想:重复的物体比如多个窗户上的窗帘,或者树上的叶子)或者因为这些述子都不能很好的提供信息。

The common solution is to add geometric constraints: The image pair was taken from the same position with the same camera, therefore points that are close in one image must be close in the other image, too. More specifically, all the points must have undergone the same transformation. In the panorama case where the camera was rotated around the nodal point of the camera-lens system this transformation must have been a 2D homography.【geometric 几何的,specifically具体的nodal节点】

这个普遍的解决方案是增加一个几何约束:这个图片对来自相同相机的相同位置,因此这些点在一副图片中收敛在另一幅图片中也收敛。更具体的是,所有的这些点都要经历相同的变换。在全景情况下相机会围绕相机镜头系统的节点旋转,这个变换一定是一个2d的单应矩阵。

Ransac is the gold standard algorithm to find the best transformation and all the matches that are consistent with this tranformation. The number of these consistent matches is called Ni. Ransac works by randomly selecting in this case 4 matches (see paper sect 3.1) and fitting a homography to these four matches. Then, count how many matches from all possible matches would agree with this homography. Repeat 500 times (see paper) and at the end take the model that had the most inliers. Then re-compute the model with all inliers. The name of the algorithm comes from RANdom SAmple Consensus: RanSaC.

Ransac是一个黄金标准算法用来找到最好的转换并且所有的匹配在转换中都是一致的。这些一致的匹配被称作是Ni。Ransac的工作原理是随机选取4对Ni(见论文3.1章节)为这四对匹配适配一个单应矩阵。然后从所有可能的匹配中到到符合这个单应矩阵的匹配并进行计数。重复500次(见论文)并且最后采取这个拥有最多内围的模型。然后用所有的内围再次计算这个模型。这个算法的名字来源于随机 取样 一致:也即RANSAC。(RANdom SAmple Consensus)

Confidence-Term

术语——置信度

The question for me was, about this mysterious confidence. I quickly found where it was calculated.

这个问题对我来讲是这个神奇的置信度。我很快的找到了他是怎么计算得来的:

From stitching/sources/matches.cpp:

来自这个地方

// These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching// using Invariant Features"

matches_info.confidence = matches_info.num_inliers / (8 + 0.3 * matches_info.matches.size());

// Set zero confidence to remove matches between too close images, as they don‘t provide// additional information anyway. The threshold was set experimentally.

matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence;

coeffs(非零系数,多项式系数)

这些系数来自M.Brown和D.Lowe 的自动全景图拼接使用不变特征

匹配信息的置信度 = 匹配信息的内围数/(8+0.3*匹配信息的匹配的大小);

为两个不匹配的图像设置置信度为0来移除匹配,既然他们不提供额外的信息,这个阈值通过经验设定。

匹配信息的置信度 = 匹配信息的置信度>3.?0.:匹配信息的置信度;

The mentioned paper has in section 3.2 ("Probabilistic Model for Image Match Verification") some more details to what this means.

提到的文章在3.2 部分(对于图片匹配认证的可能模型)更多的细节。

Reading this section a few things stood out.

有些事儿不得不说:

  1. There are a lot of variables (mostly probabilities) in their model. These values are defined in the paper without any justification. Below is the key sentence:

Though in practice we have chosen values for p0, p1, p(m = 0), p(m = 1) and pmin, they could in principle be learnt from the data.

So, this is just a theoretical exercise as the the parameters have been plucked out of thin air. Notice the could in principle be learnt.

在这个模型中有很多变量(大都是概率论的东西),这些值在论文中被定义没有任何认证。下面是关键的句子:

通过实验我们选择p0,p1,p(m =0),p(m=1) 和pmin,他们可能从数据的角度上符合一定的规则。

2.

The paper has in equation 13 the confidence calculation. If read correctly, it means that matches_info.confidence indicates a proper match between two images iff its value is above 1.

这篇文章在它的第十三个引用中有置信度的计算。如果理解没有错误的话,它的意思是匹配信息的置信度表明如果两幅图片存在合适的匹配的话 这个数值将会大于1.

3.

I don‘t see any justification in the removal of a match (setting confidence to 0) when the confidence is above 3. It just means that there are very little outliers. I think the programmers thought that a high number of matches that turn out to be outlier means that the images overlap a great deal, but this isn‘t provided by algorithms behind this. (Simply, the matchings are based on appearance of features.)

我没有看到有任何正当理由来移除一个匹配当它的置信度大于3的时候。它仅仅意味着两幅图片有极少的外点。我认为程序员认为很多数量的外围【这里应该是inliers吧 我猜。】的匹配意味着图片有很多重叠,但是并没有提供算法。(很简单,匹配基于已经出现的特征。)

时间: 2024-08-03 17:03:23

stitching detail输出的dot图含义的相关文章

方便+好用的dot图

https://pypi.python.org/pypi/graphviz(python对DOT图的相关库) http://zh.wikipedia.org/wiki/DOT%E8%AF%AD%E8%A8%80 http://zh.wikipedia.org/zh-cn/Graphviz dot就是通过编写脚本实现绘制流程图等的功能,个人觉得很强大,它不仅方便,而且通过脚本的控制,可以绘制出很漂亮的图像, 如不同形状,不同颜色的数据图形,以及他们之间边上的的条件,颜色等等 just mark一下

c语言:输出一个菱形图

输出一个菱形图. 解:程序: #include<stdio.h> int main() { int i, j; char diamond[][5] = { {' ',' ','*'},{' ','*',' ','*'},{'*',' ',' ',' ','*'},{ ' ','*',' ','*' },{ ' ',' ','*' } }; //diamond 菱形,钻石,金刚石 for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) {

***ps -ef |grep 输出的具体含义是什么?

Q: 比如:[[email protected] ~]# ps -ef | grep ApacheJetspeedroot 18887 18828 0 08:09 pts/0 00:00:00 grep ApacheJetspeed这个进程到底是运行还是没运行? 列表中哪个是18887和18828哪个是PID,0是什么意思,哪个能详细解释一下各输出项的具体含义. A: ps:将某个进程显示出来-A 显示所有程序. -e 此参数的效果和指定"A"参数相同.-f 显示UID,PPIP,C与

股票实时行情图接口

股票数据的获取目前有如下两种方法可以获取: 1. http/javascript接口取数据 2. web-service接口 3.引用Flash 1.http/javascript接口取数据 1.1Sina股票数据接口 以大秦铁路(股票代码:601006)为例,如果要获取它的最新行情,只需访问新浪的股票数据接口: http://hq.sinajs.cn/list=sh601006 这个url会返回一串文本,例如: var hq_str_sh601006="大秦铁路, 27.55, 27.25,

Snort日志输出插件详解

Snort是一款老牌的开源入侵检测工具,本文主要讨论他作为日志分析时的各种插件的应用.Snort的日志一般位于:/var/log/snort/目录下.可以通过修改配置文件来设置Snort的报警形式.基于文本的格式.Libpcap格式和数据库是Snort最重要的三种报警形式.本文主要对每种报警形式及其配置进行介绍. 1工作模式及输出插件 Snort拥有3种工作模式,分别为嗅探器模式.分组日志模式与网络入侵检测模式. (1)嗅探器模式 Snort使用Libpcap包捕获库,即TCPDUMP使用的库.

几个日志输出的解释

我们通过源代码,找到下面一段,该段实现了上述日志的输出. if ((my_now – rli->mts_last_online_stat)>= mts_online_stat_period) { sql_print_information("Multi-threadedslave statistics%s: " "seconds elapsed = %lu; " "events assigned = %llu; " "wor

指针什么时候加*什么时候不需用加,分别代表什么含义

指针的二值 关于指针,我们有很多困惑,尤其是在使用时什么时候加*,什么时候不加*,都分别代表什么意思,在老师指导下,自己做了一些总计如下: 按照我个人的理解指针的二值分别就是指指针存储的值和指针指向的值,我们都知道,我们经常说的指针实际上是指指针变量,那么变量就有存储的指,只不过指针比较特殊,是用来存储地址的变量,这就是指针二值之一,既然指针变量存储了变量的地址,那么就可以通过存储的地址值就可以找到指向的值.是不是还是很凌乱不知所云,ok,那就让我们看看测试代码,*是用来声明指针的那么当声明了一

nagios监控+pnp4出图

Nagios监控系统 By:大官人 一.nagios简介 Nagios是一个监视系统运行状态和网络信息的监视系统.Nagios能监视所指定的本地或远程主机以及服务,同时提供异常通知功能等.Nagios可运行在Linux/Unix平台之上,同时提供一个可选的基于浏览器的WEB界面以方便系统管理人员查看网络状态,各种系统问题,以及日志等等. 二.nagios功能特点 1.监控网络服务(SMTP.POP3.HTTP.NNTP.PING等): 2.监控主机资源(处理器负荷.磁盘利用率等): 3.简单地插

list反向输出 反向迭代器

反向迭代器(rbegin,rend) c.rbegin() 返回一个逆序迭代器,它指向容器c的最后一个元素 c.rend() 返回一个逆序迭代器,它指向容器c的第一个元素前面的位置 每一个容器里面都有Iterator(迭代器),可以从容器的begin位置到end位置,通过++来遍历.同样也有个反向迭代器reverse_iterator,从rbegin(=end-1)到rend(=begin-1)反向遍历,仍然通过++.可见能反向迭代的容器,应该是一个双向链表. 回想一下,所有容器都定义了 beg