如果利用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吧 我猜。】的匹配意味着图片有很多重叠,但是并没有提供算法。(很简单,匹配基于已经出现的特征。)

转载于:https://www.cnblogs.com/letben/p/5445944.html

stitching detail输出的dot图含义相关推荐

  1. python抠透明图_python利用蒙版抠图(使用PIL.Image和cv2)输出透明背景图

    因为最近在做深度学习抠图,正好要用到蒙版进行抠图,所以我将抠图代码进行了封装注释,可以直接使用.可能走了弯路,若有高见请一定提出! 主要代码 import cv2 from PIL import Im ...

  2. 英语词缀与英语派生词词典读书笔记,并总结输出思维导图

    大部分构词法知识在词根章节已说到,这里以词缀相关知识点作为重点讲述: 本文摘抄总结于 "英语词缀与英语派生词词典 - 李武平" 往期文章: 英语词根与说文解字词典读书笔记,并总结输 ...

  3. c语言:输出一个菱形图

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

  4. matlab中-psi_matlab输出论文仿真图

    一般来说学校对于学术论文的图像都有一定的要求,比如线性.字体大小等,本文将讲解怎么出高清的图和绘制符合要求的图. 1.输出高清图 x = 1:10;y = rand(1,length(x));figu ...

  5. 5-VOSviewer项目密度图含义解析

    1-Vosviewer图谱相关指标详细解释VOSviewer关键词时间图(叠加可视化)详细解释 2-VOSviewer图谱相关指标- Occurrencs与Total link Strength详细解 ...

  6. ae导出gif插件_GifGun v1.7.5 一键快速让AE导出输出GIF动态图脚本

    [脚本要求] 文件大小:93.60 MB 脚本语言:英文 脚本版本:v1.7.5 脚本兼容:支持 AE CC 2019,CC 2018,CC 2017,CC 2015,CC 2014,CC Win/M ...

  7. ae导出gif插件_AE脚本-一键快速输出GIF动图格式插件脚本 GifGun 1.7.15 Win/Mac 支持AE 2020...

     [脚本简介] 还记得以前AE能直接输出GIF动画格式,但软件更新到 AE CS5 后就取消了直接输出GIF的功能,其实很多时候还是会用到输出GIF格式的这个格式.GifGun 脚本可以一键输出G ...

  8. ae导出gif插件_AE脚本:快速输出GIF动图格式插件脚本 Aescaripts GifGun 1.7 Win/Mac

    [脚本简介] 还记得以前AE能直接输出GIF动画格式,但软件更新到 AE CS5 后就取消了直接输出GIF的功能, 其实很多时候还是会用到输出GIF格式的这个格式, GifGun 脚本可以一键输出GI ...

  9. AE插件GifGun一键创建输出gif动图

    GifGun是一款运行在AE软件中的一键创建输出gif动图脚本插件.GifGun插件最新版支持AE CC 2018,添加实验渲染,可以得到最好的三维质量渲染结果,更新用户界面,错误修复和代码更新,批渲 ...

最新文章

  1. 【持续更新】C++中string类使用总结
  2. 检索com类工厂 80070005_Hands-On Design Patterns With C++(十二)友元工厂
  3. 成功解决r2_score函数输出值始终为0的情况
  4. 洛谷 P3378 【模板】堆
  5. 使用SAT跟踪监控从浏览器打开的SAP应用的性能和调用栈
  6. jquery 选择器之children与find
  7. 新一代视频编解码标准正式公布!
  8. Xcode7 低版本iOS系统上下有黑边的问题
  9. 基于ARM-contexA9-Linux驱动开发:如何获取板子上独有的ID号
  10. 怎样正确的使用Cookie的Path详细解析
  11. Java 实现 植物大战僵尸 小游戏【附源码】
  12. 系统分析师论文评分标准
  13. python----XML
  14. 日语格助词全部学习笔记
  15. 三个小故事让你一次记住双拼输入法口诀
  16. 关于共享单车乱摆放问题的调研报告
  17. SQL语句里将字符串转换数字类型
  18. 带你领略3D转换的魅力~
  19. 艾伟也谈项目管理,关于项目管理的一点体会
  20. 极简式TAVR左心室导丝起搏步骤和注意事项

热门文章

  1. 实验室蒋田仔研究员:脑网络组图谱近10年研究详解【附PPT】
  2. DARPA 2020财年研发预算 人工智能应用研究投资急剧增长
  3. 为什么我能从普通程序员干到大厂总监?
  4. 从小护士到微软中国总经理,逆风飞扬的“打工皇后”吴士宏的传奇人生
  5. 漫画:为什么程序员喜欢使用 0 ≤ i 10 左闭右开形式写 for 循环?
  6. 互联网生态建设落地五大挑战——保险科技生态建设...
  7. WebShell代码分析溯源(第1题)
  8. 用 Heapster 监控集群 - 每天5分钟玩转 Docker 容器技术(176)
  9. JavaScript碎片
  10. jquery 读秒,倒数计时方案