前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >图像拼接--Parallax-tolerant Image Stitching

图像拼接--Parallax-tolerant Image Stitching

作者头像
用户1148525
发布2019-05-27 17:09:08
1.3K0
发布2019-05-27 17:09:08
举报

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1436668

Parallax-tolerant Image Stitching

CVPR2014

图像拼接是一个被深入研究的课题。通常第一步是输入图像的对应。早期的方法是对两个输入图像估计一个 2D映射,通常是一个 homography, 然后用它来对齐图像。因为 homography 不能考虑 parallax,所以这些方法要求输入图像拍摄的角度是一样的或者场景大致应该是位于同一平面内的。否则就不在这个 homography 可以用于对齐这些输入图像,使用 homography 进行对齐的话会导致 artifacts 出现,如 ghosting 或 图像结构被破坏。 当然更高级的图像合成技术如 seam cut-

ting 和 blending 可以缓解 这些 artifacts,但是它们不能解决 significant misalignment

最近图像拼接方法使用 spatially-varying warping algorithms 来对齐输入图像。尽管 spatially-varying warping 比 homography 更好的解决 parallax,但是对于大的 parallax 它仍然不能很好的解决。如下图所示

本文提出了一个 parallax-tolerant 图像拼接方法。本文提出的方法基于以下观察:对于图像拼接来说,我们不需要对整个重叠区域进行完美的图像对齐。我们只需要进行局部区域的对齐, local stitching,对此我们提出了一个有效算法寻找 一个局部对齐 local alignment 用于局部最优拼接,我们的局部拼接 采用了一个 复合对齐模型:homography and content-preserving warping。 Homography 能够保持全局图像结构,但是不能解决 parallax,content-preserving warping 能更好的解决 parallax 但是不能保持全局图像结构。

3 Parallax-tolerant Image Stitching

本文采用一种常见的图像拼接流程。首先对齐输入图像,然后使用一个缝合线算法找到一条缝合线用于拼接图像,最后使用 multi-band blending 算法来得到最终的缝合结果。

我们注意到 我们不需要对整个重叠区域进行完美的对齐。实际上对于 具有 large parallax 的图像,很难将其完美对齐。我们的目标是局部区域的对齐和缝合。 我们采用一个随机算法来寻找一个好的对齐。具体来说:我们首先检测 SIFT特征点,然后对输入图像进行 特征点匹配。然后我们随机选择一个特征点,使用其邻域特征点进行一个对齐估计,然后我们评估基于该对齐的缝合质量,如果这个对齐可以产生一个好的缝合质量,那么这个对齐就是我们要找的,否则我们继续上述流程寻找好的

alignment。下面我们来谈论算法中的一些基本模块,然后给出算法的一个详细的描述。

3.1. Alignment Model Selection

第一个问题是使用什么对齐模型。存在两个常用的选项:全局 2D 映射 即通常的 homography; spatially-varying warping 例如 content-preserving warping。 大多数方法使用一个 全局的 2D 映射用于对齐图像。 一个全局 2D 映射有一个重要的优势即 对图像进行一个整体的变换,这样可以避免 some objectionable local distortions。例如 homography 可以保持直线性及 相似变换可以保持物体形状。 但是它们太过刚性以至于不能解决 parallax。 对于图像拼接,尽管我们说不需要对整个重叠区域进行精确对齐,但是希望可以对尽可能大的区域进行对齐。但是对于 large parallax 图像,一个 2D 映射 甚至一个 homography 只能对齐一个小的局部区域。相反 content-preserving warping 则更加的灵活,能更好的对齐图像,但是它会引入 objectionable local distortion。

我们的解决方法是 结合上面两个对齐模型 以便对齐较大的共同区域并引入较小的 distortion。给定一个种子特征点,我们的方法是 incrementally groups 其邻域特征点用于拟合 2D 映射(默认是一个 homography )。这里我们使用一个较宽松的阈值以便能够 group 到更多的特征点。 这个宽松的 homography 可以通过后面的 content-preserving warping 来补偿。

Loosing the fitness of the homography can be compensated by applying content-preserving warping later on

3.2. Alignment Quality Assessment

对于上述符合对齐方法的一个直接评估缝合质量的思路是 首先使用 homography 变换图像,应用 content-preserving warping ,然后我们和另一幅 reference image 比较,看看对齐的怎么样。但是这个思路不能很好的预测 在重叠区域 一个好的缝合线能否被找到。同样这个思路也没有考虑图像内容对图像拼接的影响。对于拼接,显著图像特征如边缘应该被很好的对齐,而图像区域如天空则不需要被精确对齐。最后这个思路是很慢的,因为需要多次进行 content-preserving warping。

我们解决上述问题思路如下:第一,我们基于图像 edges 检测对齐质量 而不是直接基于原始图像数据。第二,我们只评估 homography 多适合拼接。之所以采取这个简化是因为我们后面使用了 content-preserving warping,但是也引入了一个问题,我们需要 predict how well the alignment enables seamlessly stitching from only roughly aligned images。 We address this challenge by finding a plausible seam from the roughly aligned images and using the seam cost to score the alignment

我们首先对输入图像进行降采样,一方面是改善速度,另一方面是可以容忍小的 misalignment,接着使用 Canny算子提取 edge maps,然后我们计算 the warped edge map and the reference image’s edge map 的差异性得到 difference map Ed 。

A plausible seam should avoid passing pixels with large values in the difference map in order to obtain a seamless stitching

result。 一个可行的缝合线应该避免在 difference map 上穿过 large values 的地方。我们扩展了 graph-cut seam finding method 用于寻找一个可行的缝合线。

3.2.1 Homography Screening

一些 homographies 可以实现 无缝拼接,但是有一些 homographies 会严重地 distort the images,导致 visually unpleasant stitching results。我们挑出这些 homographies 然后剔除掉。

We measure the perspective distortion from applying a homography H to an image I by computing how H deviates from its best-fitting similarity transformation

3.3. Alignment Algorithm Summary

整个对齐算法流程如下:

1)对输入图像进行 SIFT 特征点检测并进行特征点配对,计数输入图像的 edge maps

2)随机的选择一个种子特征点,然后将离它最近的特征点一个一个的加入集合中,直到集合中特征点不能用一个 homography 拟合,在一定的预设值条件下。

Randomly select a seed feature point and group its spatially nearest neighbors one by one until the selected feature set cannot be fitted by a homography with a pre-defined threshold

3) Evaluate the alignment quality of the best-fitting homography from Step2 using the algorithm described in Section 3.2。 If the homography meets the pre-defined quality threshold, go to Step 4. Otherwise, if the average penalty value is low, go to Step 2; otherwise select the best homography estimated during the iteration process and go to Step 4

4)Employ the optimal homography to pre-align images and use content-preserving warping guided by the set of selected feature points to refine the alignment, as described in Section 3.3.1.

3.3.1 Content-preserving warping

While content-preserving warping alone cannot always be used to align images over their whole overlapping area, it is well suited for small local adjustment

4 Experiments

Our method adopts a common image stitching pipeline. Its major novelty is in its step to align images such that optimal stitching can be achieved. This step, including optimal local homography estimation and content-preserving warping, typically takes from 20 to 40 seconds on a desktop machine with Intel i7 CPU and 8 GB memory to align two images with width 1000 pixels. All the other steps are shared by off-the-shelf image stitching methods

速度是真的很慢啊

11

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年10月15日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档