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.
有些事儿不得不说:
- 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吧 我猜。】的匹配意味着图片有很多重叠,但是并没有提供算法。(很简单,匹配基于已经出现的特征。)
stitching detail输出的dot图含义的更多相关文章
- Linux—ps -ef 命令输出信息的具体含义(显示所有正在运行的命令程序)
linux 中使用 ps -ef 输出参数的具体含义 功能:显示所有正在运行的命令程序 UID: 说明该程序被谁拥有PID:就是指该程序的 IDPPID: 就是指该程序父级程序的 IDC: 指的是 C ...
- 绘制dot 图
常用参数 格式:dot -T<type> -o<outfile> <infile.dot> 输入文件是<infile.dot>,生成的格式由<ty ...
- java把指定文字输出为图片流,支持文字换行
public class IamgeUtils { private static final int WIDTH = 350; private static final int HEIGHT = 10 ...
- ***ps -ef |grep 输出的具体含义是什么?
Q: 比如:[root@localhost ~]# ps -ef | grep ApacheJetspeedroot 18887 18828 0 08:09 pts/0 00:00:00 grep A ...
- tensroflow中如何计算特征图的输出及padding大小
根据tensorflow中的conv2d函数,我们先定义几个基本符号 1.输入矩阵 W×W,这里只考虑输入宽高相等的情况,如果不相等,推导方法一样,不多解释. 2.filter矩阵 F×F,卷积核 3 ...
- Stitching模块中leaveBiggestComponent初步研究
在Stitching模块中以及原始论文<Automatic Panoramic Image Stitching using Invariant Features>3.2中,都有" ...
- 图像拼接(image stitching)
# OpenCV中stitching的使用 OpenCV提供了高级别的函数封装在Stitcher类中,使用很方便,不用考虑太多的细节. 低级别函数封装在detail命名空间中,展示了OpenCV算法实 ...
- rpmgraph - 显示 RPM 软件包依赖关系图
SYNOPSIS rpmgraph PACKAGE_FILE ... DESCRIPTION rpmgraph 使用 PACKAGE_FILE 参数来产生一个软件包依赖关系图.每个 PACKAGE_F ...
- 小白如何学习PyTorch】25 Keras的API详解(下)缓存激活,内存输出,并发解决
[新闻]:机器学习炼丹术的粉丝的人工智能交流群已经建立,目前有目标检测.医学图像.时间序列等多个目标为技术学习的分群和水群唠嗑答疑解惑的总群,欢迎大家加炼丹兄为好友,加入炼丹协会.微信:cyx6450 ...
随机推荐
- JMX学习笔记(三)-MXBean
在MBean中有只要遵循以下两个规则,我们就可以在jconsole中动态的改变MBean中的属性值 1. JMX中要定义接口必须以xxxMBean的规范定义 2. 得有类实现xxxMBean接口 例如 ...
- 使用 Apache MINA2 实现 Web 系统的消息中间件
本文将介绍如何使用 Apache MINA2(以下简称 MINA2)解决复杂 Web 系统内各子系统之间同步消息中间件的问题.MINA2 为开发高性能和高可用性的网络应用程序提供了非常便利的框架.从本 ...
- HDU 4825-Xor Sum(trie)
题意: 给你一组数,开始询问给一个数 求组中与该数异或值最大的数. 分析:根据异或的特点 要想得到的异或值最大 尽可能的让两个数的每位都相反 先把给定的一组数建树,数的最后一位对应的节点保存这个数的 ...
- codeforces 672C - Recycling Bottles 贪心水题
感觉很简单,就是讨论一下 #include <stdio.h> #include <string.h> #include <algorithm> #include ...
- UVA 11183 Teen Girl Squad 最小树形图
最小树形图模板题 #include <iostream> #include <algorithm> #include <cstdio> #include <c ...
- Flash 导出图片和声音
命令文件 PolarBear_jsfl.zip Flash Professional 编辑器命令,用来导出 flash 库中的图片和声音 使用步骤: 1. 首先下载 PolarBear_jsfl.zi ...
- JS实现复制到剪贴板
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- tomcat登陆WEB显示无权限问题&& tomcat无限循环启动问题
tomcat登陆WEB显示无权限问题 The user specified as a definer (”@’%') does not exist 原因分析 因为创建视图使用的是xff@%用户(目前已 ...
- python 定制类
看到类似__slots__这种形如__xxx__的变量或者函数名就要注意,这些在Python中是有特殊用途的. __slots__我们已经知道怎么用了,__len__()方法我们也知道是为了能让cla ...
- hdoj 2084 数塔
数塔 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissi ...