Print

发布时间: 2019-03-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.180359
2019 | Volume 24 | Number 3




    图像处理和编码    




  <<上一篇 




  下一篇>> 





基于网格形变的立体图像内容重组
expand article info 柴雄力, 邵枫, 姜求平, 蒋刚毅
宁波大学信息科学与工程学院, 宁波 315211

摘要

目的 近年来,随着数字摄影技术的飞速发展,图像增强技术越来越受到重视。图像构图作为图像增强中影响美学的重要因素,一直都是研究的热点。为此,从立体图像布局调整出发,提出一种基于Delaunay网格形变的立体图像内容重组方法。方法 首先将待重组的一对立体图像记为源图像,将用于重组规则确定的一幅图像记为参考图像;然后对源图像需要调整的目标、特征线和其他区域进行取点操作,建立Delaunay网格。将源图像的左图与参考图像进行模板匹配操作,得到源图像与参考图像在结构布局上的对应关系;最后利用网格形变的特性,移动和缩放目标对象,并对立体图像的深度进行自适应调整。结果 针对目标对象的移动、缩放和特征线调整几方面进行优化。当只涉及目标对象的移动或特征线调整时,立体图像视差保持不变;当目标对象缩放时,立体图像中目标对象的视差按照缩放比例变化而背景视差保持不变。实验结果表明,重组后的立体图像构图与参考图像一致且深度能自适应调整。与最新方法比较,本文方法在目标对象分割精度和图像语义保持方面具有优势。结论 根据网格形变相关理论,构建图像质量、布局匹配和视差适应3种能量项,实现了立体图像的内容重组。与现有需要提取和粘贴目标对象的重组方法不同,本文方法对目标对象的分割精度要求不高,不需要图像修复和混合技术,重组后的立体图像没有伪影和语义错误出现。用户可以通过参考图像来引导立体图像的布局调整,达到期望的图像增强效果。

关键词

立体图像编辑; 立体图像布局; Delaunay网格形变; 深度自适应; 优化

Stereoscopic image recomposition based on mesh deformation
expand article info Chai Xiongli, Shao Feng, Jiang Qiuping, Jiang Gangyi
Faculty of Information Science and Engineering, Ningbo University, Ningbo 315211, China
Supported by: National Natural Science Foundation of China (61622109)

Abstract

Objective Image enhancement techniques have received increasing attention along with the rapid development of digital photography in recent years. Image enhancement aims to improve the visual quality of an image through tone mapping, denoising, and recomposition. In image aesthetic assessment, the main factors that influence aesthetics, namely, object relationships and geometric structure, are considered in recomposition. As a research hotspot, image recomposition utilizes photographic composition rules, such as the rule of thirds, visual balance, diagonal dominance, and object size, to capture aesthetically pleasing content. Nonphotographic experts can also acquire photographic images that conform to image aesthetics using image recomposition technology. Stereoscopic technologies have undergone a tremendous boom in recent years. Various stereoscopic services and applications are currently available which present great demands for the availability of 3D contents. A growing demand for stereoscopic image layout adjustment has been observed due to the separation of stereoscopic content production and display. However, the content modification of 3D images is difficult compared with the conventional 2D image modification. The former requires additional care due to the additional depth dimension. The misalignment between left and right images may result in uncomfortable 3D viewing and cause eye strain and headache. In consideration of the above factors, starting from stereoscopic image layout adjustment, this study proposes a stereoscopic image recomposition method based on Delaunay mesh deformation and depth adaptation. Method A pair of stereoscopic images to be recomposed is first recorded as source images, including left and right images, and a binary image used for rule determination is recorded as a reference image. Alpha matting is used to obtain a precise region with opacity value for each object in the left image and calculate the significance of stereoscopic images. We then detect feature points from the left image and use the Delaunay triangulation algorithm to generate meshes as follows. We employ an edge detection operator, such as Canny operator, and utilize a corner detection algorithm, such as Harris corner detection, to extract feature points in a target object. Hough transform is used to detect feature lines and select points in the left image to evenly sample feature points in the feature lines. Here, the location of the target object and the feature line are classified into three categories:intersect, above separate, and below separate. When intersecting with the feature line, the target object moves along with the feature line, and the rest of the situation can be considered separately. The left image boundary is evenly discretized to use all the points there as part of the feature points and sample the remaining area to gain feature points. The Delaunay triangulation mesh can be automatically generated based on the feature points. After the left image meshes are established, the meshes in the right image are mapped by disparity from the left image meshes, and the reference image meshes are also built similar to the operation of the left image. A template-matching operation is performed on the contents of the left and reference images to obtain the corresponding relationship between the source and reference images in the layout. In the optimization process, we construct energy terms from three aspects, namely, image quality, layout adjustment, and depth adaptation. Finally, the target object is moved and scaled based on the characteristics of mesh deformation, and the depth of the stereoscopic image is adaptively adjusted. The disparity change ratio of the target object is consistent with the size scaling. Result This study conducts an experimental design from two aspects of single object and multiple objects, which prove that the proposed method is applicable to all objects. When the movement of the target object or the adjustment of the feature line is involved, the disparity of the stereoscopic image is maintained. When the target object is scaled, the disparity of the target object in the stereoscopic image varies according to the scaling ratio, while the background disparity remains unchanged. Experimental results show that the stereoscopic image after recomposition is consistent with the layout of the reference image for the target object movement, scaling, and feature line adjustment and that the depth can be adjusted adaptively. The coefficients of different energy terms are also adjusted to prove that the new framework proposed in this study can achieve satisfactory stereoscopic content recomposition. Compared with the latest method, the optimization method used in this study has advantages in the segmentation accuracy of the target object and the preservation of image semantics. Conclusion In this study, image quality, layout matching, and disparity adaptive energy terms are constructed based on the theory of mesh deformation, and content recomposition of the stereoscopic image is achieved according to energy term optimization. Unlike the existing recomposition method that needs to extract and paste the target object, the proposed method does not require high accuracy in the segmentation of the target object. Image-inpainting and -blending techniques are not needed. The stereoscopic image after recomposition has no artifacts and semantic errors. The user can guide the layout adjustment of the stereoscopic image by using the reference image to achieve the image enhancement desired by the user. In the future, mesh deformation and cropping technologies can be combined to enhance the efficiency and flexibility of stereoscopic image recomposition.

Key words

stereoscopic image editing; stereoscopic image layout; Delaunay mesh deformation; depth adaptation; optimization

0 引言

随着立体图像显示技术的发展,立体图像内容的制作越来越受到关注。受拍摄技术和环境的影响,有时拍摄的图像并不令人满意,需要对拍摄内容进行修改。影响图像美感的因素有色彩、光线、线条和构图等,其中最重要的是构图[1],而图像内容重组就是通过改变图像构图来增强图像美感[2]。平面图像的构图规则主要包括三分法、视觉平衡、主题区域保留和目标对象的大小变化。相较于平面图像,立体图像左右的上下错位会导致观看时不舒适,目标对象大小与深度的不匹配会使感知目标对象发生形变,因此对立体图像内容重组时需同时考虑深度调整和构图调整。

在平面图像重组技术方面,Bhattacharya等人[3]提出了一种基于美学的图像增强方法,根据三分法和视觉平衡,使用裁剪(cropping)技术改变图像主体目标的大小和位置,从而获得更具视觉美感的图像。Liu等人[4]提出将三分法、对角线、视觉平衡和区域大小作为图像美学的评价分数,并以此为标准对图像进行裁剪,得到了符合美学的图像。Wang等人[5]提出了一种基于构图规则的图像美学优化方法,通过调整图像主体的位置、大小和背景区域划分对图像进行美化。Liang等人[6]提出一种基于人机交互的裁剪系统。此外基于学习方法的图像重组技术也不断被提出[7-9]。但是通过裁剪进行图像重组,不可避免地会导致内容丢失。基于目标进行提取和粘贴(pasting)也是图像重组的常用方法,即从输入图像中分割出一个或多个目标对象,然后根据布局需要粘贴到相应位置。但是,单纯的目标提取和粘贴可能无法保持分割目标对象与背景之间的语义连通性。为此,Zhang等人[10]提出基于目标对象相关性感知的图像重组方法,通过对图像语义进行相关性分析,增强了提取与粘贴后目标对象与背景语义的关联性。Chang等人[11]提出一种基于布局参考图像重组的方法,利用图匹配得到源图像与参考图像的布局关联信息,然后提取目标对象并粘贴到所需位置。Li等人[12]利用缝雕刻(seam carving)技术对图像不同区域增减像素,以此实现图像内容重组。图像形变(warping)同样是一种常用的图像重组技术。Wong等人[13]提出将目标对象与背景分离,在背景完成形变调整后再粘贴目标对象,实现较好的重组效果。Chang等人[14]提出基于布局参考的图像重组方法,利用图像的形变将目标对象移动到布局点位置。上述基于形变的图像重组方法在需要进行大跨度位置调整时,会出现较严重的背景失真情况。Jin等人[15]提出基于裁剪与形变的图像重组方法,结合裁剪快速和形变语义失真小的优点,得到较好的图像重组效果。

相比平面图像重组技术,立体图像的重组技术相对较少。Niu等人[16]提出利用美学规则裁剪和缩放立体图像,以此实现立体图像重组。但是,当目标对象分散且背景有重要信息时,裁剪会使重组后的图像失去部分重要信息。Tong等人[17]提出通过人机交互将平面图像粘贴到立体图像。1)通过人为操作设定平面图像的视差;2)使用泊松混合使平面视差与背景立体图像视差一致;3)通过形变的方式将平面图像粘贴到立体图像的合适位置,并利用泊松混合的方式对粘贴图像的边界进行混合处理。这种立体图像重组技术对视差的控制要求较高,若粘贴的图像视差不能与立体图像的视差在同一深度范围,立体感知就会出现错误。Luo等人[18]提出基于无缝克隆(cloning)的立体图像重组技术。1)将待克隆的立体图像与背景图像进行视差迭代,使两者的视差一致;2)利用网格形变使待克隆图像的大小符合相应的视差范围;3)利用泊松混合将待克隆图像与作背景的立体图像结合在一起,消除两者边界颜色差异。Islam等人[19]提出基于目标提取和粘贴的立体图像重组技术。1)将图像分为目标层和背景层;2)根据美学规则对目标层和背景层分别调整,再组合到一起得到重组后的立体图像。由于提取目标层后在背景层会出现空洞,因此该方法的效果依赖于修复技术。同时该方法对目标层的提取要求严格,如果提取效果不佳,在图像重组时目标对象和背景的过渡会被明显观察到。文献[16]会出现信息丢失较多的情况。文献[19]为了保护目标对象选择提取目标对象,最终效果受目标提取的准确性和背景修复技术的影响。相比平面图像重组常用的基于网格形变驱动的图像重组技术,立体图像相关研究比较少。Islam等人[20]提出了基于形变的立体图像重组技术,但在目标对象的保持、缩放、特征线位置调整和视差适应等方面的研究不够深入。

为此,本文从图像布局调整和视差自适应的角度,提出一种基于网格形变的立体图像重组框架,主要创新包括:1)基于网格形变理论,构建了一种以图像质量、布局和视差自适应3种能量项为核心的立体图像重组框架;2)考虑多种重组因素,从目标对象、特征线和视差3个方面进行优化;3)用户可以指定参考图像的布局来引导立体图像的重组。

1 预处理

在进行图像重组操作时,需要输入一对立体图像和一幅二值图像分别作为源图像和参考图像(如图 1所示)。由于需要确定源图像目标对象的重组规则,因此要对其进行模板匹配操作。首先对源图像左图的目标对象、特征线、图像四周边界和空余区域进行采样,提取顶点并生成Delaunay网格,这些顶点位于源图像左图目标对象的边界与内部、特征线、四周边界和其余空余区域位置。然后根据视差图生成源图像右图的网格。利用模板匹配算法,将源图像左图目标对象掩膜与参考图像进行模板匹配,确定源图像目标对象需要移动的距离和缩放比例。

图 1 本文立体图像重组框架
Fig. 1 The proposed stereoscopic image recomposition framework

$ \mathit{\boldsymbol{V}} = \{ {\mathit{\boldsymbol{V}}_k}\} $表示Delaunay网格所有顶点集合,$ {\mathit{\boldsymbol{V}}_k} = \{ \mathit{\boldsymbol{v}}_k^1, \mathit{\boldsymbol{v}}_k^2, \mathit{\boldsymbol{v}}_k^3\} $表示第$ k$个Delaunay网格的顶点集合,$ \mathit{\boldsymbol{v}}_k^j = (x_k^j, y_k^j)$表示第$ k$个Delaunay网格第$ j$个顶点,$(x_k^j, y_k^j) $表示对应的横坐标与纵坐标。

1.1 目标对象提取和显著图计算

对图像进行内容重组,关键是确定重组目标对象,本文利用已标记区域的三分图(trimap),通过基于采样的图像目标对象提取算法[21],得到源图像目标对象的掩膜。由于本文方法是基于网格形变来完成目标对象调整,因此对目标提取的精度要求不高。当提取的目标对象在边界处出现错误时,可利用膨胀操作使掩膜覆盖目标对象。在网格形变的优化操作中,对显著目标对象分配较高的形状保持能量是常用方法。由于本文针对立体图像进行重组,因此显著计算使用立体图像显著计算方法[22],通过对图像的线条信息、深度信息、立体感知信息和左右图一致性信息进行融合,得到立体显著图。

1.2 Delaunay网格建立

建立Delaunay网格的关键在于网格顶点的确定。本文将顶点分为4部分:1)目标对象边界与内部顶点;2)图像特征线顶点;3)图像四周顶点;4)其余位置顶点。在提取目标对象后,考虑到掩膜覆盖的目标对象可能是多个对象,使用$ K$-means聚类得到单个目标对象的掩膜,然后使用Canny算子得到单目标对象的边界,用等间隔采样的方式实现目标对象边界顶点的提取。对于目标对象内部,使用更能体现目标对象内部线条结构的Harris角点作为顶点。完成目标对象的顶点选取后,如果背景中有明显的水平或垂直分隔线,则需要使用直线检测算法[23]提取图像中的特征线。图 2表示目标对象与特征线的相对位置关系。对于图 2 (b)(c),存在特征线与目标对象分离的情况,则特征线与目标对象的优化操作可以分开考虑,但对于图 2 (a),存在特征线与目标对象相交的情况,则特征线与目标对象的优化操作必须以同一位置变化关系进行调整。

图 2 目标对象与特征线的关系
Fig. 2 The relationship between target object and segmentation line ((a) intersect; (b) below separate; (c) above separate)

图像四周的顶点采用等间隔采样得到,目的是保持图像分辨率,剩余区域用等间隔采样得到顶点并生成Delaunay网格。利用已知左图像的顶点和左视差图,通过计算确定右图像顶点的对应位置,建立右图像的网格

$ x_{{\rm{r}},k}^j = x_{{\rm{l}},k}^j + d_k^j $ (1)

式中,$x_{{\rm{l}}, k}^j $$ x_{{\rm{r}}, k}^j$分别表示左右图像第$ k$个Delaunay网格的第$ j$个顶点的横坐标位置,$ d_k^j$表示第$k$个Delaunay网格的第$j$个顶点的视差值。考虑到网格顶点可能溢出或未能覆盖右图边界,本文将边界处的$ x_{{\rm{r}}, k}^j$拉伸至图像边界处。

1.3 模板匹配和布局规则确定

本文方法允许用户利用参考图像的布局来引导源图像的重组。将源图像左图掩膜用$K$-means聚类得到单个目标对象掩膜,用标签记为1, 2, …, $M$。同时对参考图像进行$K$-means聚类得到单个目标对象的二值图。将源图像左图掩膜和参考图像二值图用Delaunay网格进行覆盖,为重心和面积计算提供量化依据。将源图像与参考图像的目标对象表示为$ [{\mathit{\boldsymbol{O}}_1}, {\mathit{\boldsymbol{O}}_2}, \cdots , {\mathit{\boldsymbol{O}}_M}]$$[{\mathit{\boldsymbol{P}}_\mathit{\boldsymbol{1}}}, {\mathit{\boldsymbol{P}}_2}, \cdots , {\mathit{\boldsymbol{P}}_M}] $,用$ \left\{ {\mathit{\boldsymbol{V}}, \mathit{\boldsymbol{E}}} \right\}$表示目标对象的属性,$\mathit{\boldsymbol{V}} $表示目标对象覆盖网格的顶点集合,$\mathit{\boldsymbol{E}} $表示目标对象覆盖网格的边界集合。模板匹配关系如图 3所示。

图 3 源图像左图与参考图像模板匹配关系
Fig. 3 Matching relationship between left image and reference image

目标对象的位移可以定义为

$ \left\{ \begin{array}{l} {\delta _x}\left( m \right) = \frac{{\sum\limits_{{\mathit{\boldsymbol{V}}_{{\rm{R}},i}} \in {\mathit{\boldsymbol{P}}_m}} {\sum\limits_{j = 1}^3 {x_{{\rm{R}},i}^j} } }}{{N\left( {{\mathit{\boldsymbol{P}}_m}} \right)}} - \frac{{\sum\limits_{{\mathit{\boldsymbol{V}}_{{\rm{S}},i}} \in {\mathit{\boldsymbol{O}}_m}} {\sum\limits_{j = 1}^3 {x_{{\rm{S}},i}^j} } }}{{N\left( {{\mathit{\boldsymbol{O}}_m}} \right)}}\\ {\delta _y}\left( m \right) = \frac{{\sum\limits_{{\mathit{\boldsymbol{V}}_{{\rm{R}},i}} \in {\mathit{\boldsymbol{P}}_m}} {\sum\limits_{j = 1}^3 {y_{{\rm{R}},i}^j} } }}{{N\left( {{\mathit{\boldsymbol{P}}_m}} \right)}} - \frac{{\sum\limits_{{\mathit{\boldsymbol{V}}_{{\rm{S}},i}} \in {\mathit{\boldsymbol{O}}_m}} {\sum\limits_{j = 1}^3 {y_{{\rm{S}},i}^j} } }}{{N\left( {{\mathit{\boldsymbol{O}}_m}} \right)}} \end{array} \right. $ (2)

式中,$ {\mathit{\boldsymbol{P}}_m}$$ {\mathit{\boldsymbol{O}}_m}$分别表示参考图像和源图像第$m$个目标对象,$ {\mathit{\boldsymbol{V}}_{{\rm{R}}, i}}$$ {\mathit{\boldsymbol{V}}_{{\rm{S}}, i}}$分别表示参考图像和源图像的第$i$个Delaunay网格顶点集合,$ x_{{\rm{R}}, i}^j$$ y_{{\rm{R}}, i}^j$表示第$i$个Delaunay网格的第$j$个顶点在参考图像的横坐标与纵坐标,$ x_{{\rm{S}}, i}^j$$ y_{{\rm{S}}, i}^j$表示第$i$个Delaunay网格的第$j$个顶点在源图像的横坐标与纵坐标,$N$($ {\mathit{\boldsymbol{P}}_m}$)和$N$($ {\mathit{\boldsymbol{O}}_m}$)分别表示参考图像和源图像所覆盖网格的顶点总数,${\delta _x}(m) $${\delta _y}(m) $分别表示源图像的目标对象需要移动的横向距离与纵向距离。

根据三角形面积计算公式,计算源图像目标对象和参考图像目标对象的面积,并以面积的比值作为源图像目标对象的缩放比例

$ \left\{ \begin{array}{l} {A_{\rm{R}}}\left( m \right) = \sum\limits_{{\mathit{\boldsymbol{V}}_{{\rm{R}},i}} \in {\mathit{\boldsymbol{P}}_m}} {\frac{1}{2}\left| {\begin{array}{*{20}{c}} 1&{x_{{\rm{R}},i}^1}&{y_{{\rm{R}},i}^1}\\ 1&{x_{{\rm{R}},i}^2}&{y_{{\rm{R}},i}^2}\\ 1&{x_{{\rm{R}},i}^3}&{y_{{\rm{R}},i}^3} \end{array}} \right|} \\ {A_{\rm{S}}}\left( m \right) = \sum\limits_{{\mathit{\boldsymbol{V}}_{{\rm{S}},i}} \in {\mathit{\boldsymbol{O}}_m}} {\frac{1}{2}\left| {\begin{array}{*{20}{c}} 1&{x_{{\rm{S}},i}^1}&{y_{{\rm{S}},i}^1}\\ 1&{x_{{\rm{S}},i}^2}&{y_{{\rm{S}},i}^2}\\ 1&{x_{{\rm{S}},i}^3}&{y_{{\rm{S}},i}^3} \end{array}} \right|} \\ \rho \left( m \right) = \frac{{{A_{\rm{R}}}\left( m \right)}}{{{A_{\rm{S}}}\left( m \right)}} \end{array} \right. $ (3)

式中,$ {A_{\rm{R}}}$表示参考图像的目标对象面积,$ {A_{\rm{S}}}$表示源图像的目标对象面积,$ρ$表示源图像的缩放倍数。

2 网格能量项的优化与约束

在完成网格建立和布局规则确立后,使用网格形变能实现立体图像的内容重组。本文主要构建3种能量项:1)构建图像质量能量项,通过将形变尽可能分散到非显著区域,保护显著区域,提升立体图像重组效果;2)构建布局匹配能量项,调整目标对象的位置与大小;3)构建视差适应能量项,保证重组后立体图像目标对象视差的自适应和非目标对象视差的保持。

2.1 图像质量能量项

由于网格在优化过程中出现形变是不可避免的,因此如何控制网格形变的趋势至关重要。一般而言,如果优化前的网格与优化后的网格是相似的,那么网格内的内容形变最小。因此希望建立一种形变失真能量项,使所有网格在优化后与原始网格是相似的。参考文献[24],该问题可以转化为将网格变化控制为相似性变换。给定源图像Delaunay网格顶点集合$\mathit{\boldsymbol{V}} $,其优化后为$ {\mathit{\boldsymbol{\tilde V}}}$,则可以定义形变失真能量为

$ \varepsilon \left( k \right) = \min \sum\limits_{j = 1}^3 {{{\left\| {f\left( {\mathit{\boldsymbol{v}}_k^j} \right) - \mathit{\boldsymbol{\tilde v}}_k^j} \right\|}^2}} $ (4)

式中,$f$表示第$k$个Delaunay网格的相似性变换,$ \mathit{\boldsymbol{v}}_k^j$表示第$k$个Delaunay网格的第$j$个顶点,$ \mathit{\boldsymbol{\tilde v}}_k^j$表示优化后第$k$个Delaunay网格的第$j$个顶点,$\varepsilon \left( k \right) $表示顶点理想变换后的位置与实际优化后的位置的误差值,$f$($ \mathit{\boldsymbol{v}}_k^j$)的整体定义为

$ f\left( {\mathit{\boldsymbol{v}}_k^j} \right) = \left[ {\begin{array}{*{20}{c}} {{a_k}}&{ - {b_k}}\\ {{b_k}}&{{a_k}} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {x_k^j}\\ {y_k^j} \end{array}} \right] + \left[ {\begin{array}{*{20}{c}} {{t_{x,k}}}\\ {{t_{y,k}}} \end{array}} \right],\mathit{\boldsymbol{v}}_k^j = \left[ {\begin{array}{*{20}{c}} {x_k^j}\\ {y_k^j} \end{array}} \right] $ (5)

式中,$a_{k}$$b_{k}$表示第$k$个Delaunay网格在相似性变换中旋转角度和缩放因子相结合的参数,$t_{x, k}$$t_{y, k}$表示第$k$个Delaunay网格在相似性变换中的平移矢量参数。

将式(5)代入式(4),同一个Delaunay网格的3个顶点满足同一相似性变换,则可写成矩阵形式

$ \begin{array}{*{20}{c}} {{\mathit{\boldsymbol{G}}_k} = \left[ {\begin{array}{*{20}{c}} {x_k^1}&{ - y_k^1}&1&0\\ {y_k^1}&{x_k^1}&0&1\\ {x_k^2}&{ - y_k^2}&1&0\\ {y_k^2}&{x_k^2}&0&1\\ {x_k^3}&{ - y_k^3}&1&0\\ {y_k^3}&{x_k^3}&0&1 \end{array}} \right],{\mathit{\boldsymbol{P}}_k} = \left[ \begin{array}{l} {a_k}\\ {b_k}\\ {t_{x,k}}\\ {t_{y,k}} \end{array} \right],{\mathit{\boldsymbol{c}}_k} = \left[ \begin{array}{l} \tilde x_k^1\\ \tilde y_k^1\\ \tilde x_k^2\\ \tilde y_k^2\\ \tilde x_k^3\\ \tilde y_k^3 \end{array} \right]}\\ {\varepsilon = \min \sum\limits_{{\mathit{\boldsymbol{V}}_k} \in \mathit{\boldsymbol{V}}} {{{\left\| {{\mathit{\boldsymbol{G}}_k}{\mathit{\boldsymbol{P}}_k} - {\mathit{\boldsymbol{c}}_k}} \right\|}^2}} } \end{array} $ (6)

式中,${\mathit{\boldsymbol{G}}_k} $是原始Delaunay网格顶点和平移矢量参数系数的矩阵表示,${\mathit{\boldsymbol{P}}_k} $表示第$k$个Delaunay网格顶点集合对应的相似性变换参数,${\mathit{\boldsymbol{c}}_k}$是优化后的Delaunay网格顶点,$ {\mathit{\boldsymbol{V}}_k}$表示第$k$个Delaunay网格顶点集合,$ \mathit{\boldsymbol{V}}$表示所有Delaunay网格顶点集合。根据最小二乘问题的理论最优解,式(6)中的${\mathit{\boldsymbol{P}}_k} $可以表示为

$ {\mathit{\boldsymbol{P}}_k} = {\left( {\mathit{\boldsymbol{G}}_k^{\rm{T}}{\mathit{\boldsymbol{G}}_k}} \right)^{ - 1}}\mathit{\boldsymbol{G}}_k^{\rm{T}}{\mathit{\boldsymbol{c}}_k} $ (7)

将式(7)代入式(6),得

$ \varepsilon = \min \sum\limits_{{\mathit{\boldsymbol{V}}_k} \in \mathit{\boldsymbol{V}}} {{{\left\| {\left[ {{\mathit{\boldsymbol{G}}_k}{{\left( {\mathit{\boldsymbol{G}}_k^{\rm{T}}{\mathit{\boldsymbol{G}}_k}} \right)}^{ - 1}}\mathit{\boldsymbol{G}}_k^{\rm{T}} - \mathit{\boldsymbol{I}}} \right]{\mathit{\boldsymbol{c}}_k}} \right\|}^2}} $ (8)

式中,$\mathit{\boldsymbol{I}} $表示单位矩阵。式(8)可以用最小二乘优化的方式求解。考虑到平滑过渡的需要,目标对象边界顶点构成的Delaunay网格以同一相似性变换参数进行优化。

构造整体形变失真能量项为

$ \begin{array}{*{20}{c}} {{E_{{\rm{SD}}}} = \min \sum\limits_{{\mathit{\boldsymbol{V}}_k} \in \mathit{\boldsymbol{V}}} {I{M_{\rm{A}}}\left( {{\mathit{\boldsymbol{V}}_k}} \right)} \cdot }\\ {{{\left\| {\left[ {{\mathit{\boldsymbol{G}}_k}{{\left( {\mathit{\boldsymbol{G}}_k^{\rm{T}}{\mathit{\boldsymbol{G}}_k}} \right)}^{ - 1}}\mathit{\boldsymbol{G}}_k^{\rm{T}} - \mathit{\boldsymbol{I}}} \right]{\mathit{\boldsymbol{c}}_k}} \right\|}^2}} \end{array} $ (9)

式中,$I{M_{\rm{A}}}({\mathit{\boldsymbol{V}}_k}) $表示第$k$个Delaunay网格的平均显著性值,计算为

$ \begin{array}{*{20}{c}} {\mathit{\boldsymbol{D}}_k^j = \left( {1 - \alpha _1^j} \right)\mathit{\boldsymbol{v}}_k^1 + \alpha _1^j\left( {1 - \alpha _2^j} \right)\mathit{\boldsymbol{v}}_k^2 + \alpha _1^j\alpha _2^j\mathit{\boldsymbol{v}}_k^3}\\ {\alpha _1^j \in \left[ {0,1} \right],\alpha _2^j \in \left[ {0,1} \right]} \end{array} $ (10)

$ I{M_{\rm{A}}}\left( {{\mathit{\boldsymbol{V}}_k}} \right) = \frac{{\sum\limits_{j = 1}^{N\left( {{\mathit{\boldsymbol{D}}_k}} \right)} {I{M_{\rm{P}}}\left( {\mathit{\boldsymbol{D}}_k^j} \right)} }}{{N\left( {{\mathit{\boldsymbol{D}}_k}} \right)}} $ (11)

式中,$\alpha _1^j $$\alpha _2^j $是[0, 1]内任意一个值,本文$\alpha _1^j $$\alpha _2^j $各取20等分。$\mathit{\boldsymbol{D}}_k^j$表示第$k$个Delaunay网格内部的第$j$个点,通过式(10)可以求出第$k$个Delaunay网格内部所有的点集${\mathit{\boldsymbol{D}}_k} $$I{M_{\rm{P}}}(\mathit{\boldsymbol{D}}_k^j) $表示网格内$\mathit{\boldsymbol{D}}_k^j$点的显著性值,$ N\left( {{\mathit{\boldsymbol{D}}_k}} \right)$表示第$k$个Delaunay网格内部点的数量,通过求平均值的方式可以得到对应Delaunay网格的平均显著性值。

在进行网格优化的过程中,另一个重要的问题是避免网格在优化后出现折叠。如果网格的线方向在优化前后的角度变化尽可能小,那么网格的折叠就可以得到抑制。参考文献[25],设${\mathit{\boldsymbol{e}}_{i, j}} = {\mathit{\boldsymbol{v}}_i} - {\mathit{\boldsymbol{v}}_j}, {\mathit{\boldsymbol{\tilde e}}_{i, j}} = {\mathit{\boldsymbol{\tilde v}}_i} - {\mathit{\boldsymbol{\tilde v}}_j} $,使用下列能量来近似相关角度变化

$ \Delta \left( {{\mathit{\boldsymbol{e}}_{i,j}}} \right) = \min {\left\| {\mathit{\boldsymbol{r}} \cdot {\mathit{\boldsymbol{e}}_{i,j}} - {{\mathit{\boldsymbol{\tilde e}}}_{i,j}}} \right\|^2} $ (12)

式中,$ \mathit{\boldsymbol{r}}$表示网格边的线性变换因子,${\mathit{\boldsymbol{e}}_{i, j}}$表示源图像网格向量,$ {\mathit{\boldsymbol{\tilde e}}_{i, j}}$表示优化后网格向量,$ \Delta $(${\mathit{\boldsymbol{e}}_{i, j}}$)表示理想线性变换与实际优化后的误差值。类似于式(8)的推导,可得

$ \Delta = \sum\limits_{{\mathit{\boldsymbol{e}}_{i,j}} \in {\mathit{\boldsymbol{L}}_{\rm{n}}}} {\min {{\left\| {\left[ {{\mathit{\boldsymbol{e}}_{i,j}}{{\left( {\mathit{\boldsymbol{e}}_{i,j}^{\rm{T}}{\mathit{\boldsymbol{e}}_{i,j}}} \right)}^{ - 1}}\mathit{\boldsymbol{e}}_{i,j}^{\rm{T}} - \mathit{\boldsymbol{I}}} \right]{{\mathit{\boldsymbol{\tilde e}}}_{i,j}}} \right\|}^2}} $ (13)

式中,$ {\mathit{\boldsymbol{L}}_{\rm{n}}}$表示非目标对象所有网格线的集合。

构造整体线角度变化能量项为

$ \begin{array}{*{20}{c}} {{E_{{\rm{AT}}}} = \min \sum\limits_{{\mathit{\boldsymbol{e}}_{i,j}} \in {\mathit{\boldsymbol{L}}_{\rm{n}}}} {I{M_{\rm{A}}}\left( {{\mathit{\boldsymbol{e}}_{i,j}}} \right)} \cdot }\\ {{{\left\| {\left[ {{\mathit{\boldsymbol{e}}_{i,j}}{{\left( {\mathit{\boldsymbol{e}}_{i,j}^{\rm{T}}{\mathit{\boldsymbol{e}}_{i,j}}} \right)}^{ - 1}}\mathit{\boldsymbol{e}}_{i,j}^{\rm{T}} - \mathit{\boldsymbol{I}}} \right]{{\mathit{\boldsymbol{\tilde e}}}_{i,j}}} \right\|}^2}} \end{array} $ (14)

式中,$I{M_{\rm{A}}}$(${\mathit{\boldsymbol{e}}_{i, j}}$)表示${\mathit{\boldsymbol{e}}_{i, j}}$组成网格的平均显著值。考虑到线角度变化能量与目标对象缩放能量可能产生的冲突,这里的线角度变化能量只用于除目标对象以外的网格线。

2.2 布局匹配能量项

根据确立的布局规则,有时需要对目标对象进行缩放以增强图像显示效果。对目标对象进行缩放的本质是对目标对象覆盖的网格进行相似变换。构造目标对象缩放能量项如下

$ {E_{{\rm{SO}}}} = \min \sum\limits_{{\mathit{\boldsymbol{e}}_{i,j}} \in {\mathit{\boldsymbol{L}}_{\rm{o}}}} {{{\left\| {\sqrt \rho {\mathit{\boldsymbol{e}}_{i,j}} - {{\mathit{\boldsymbol{\tilde e}}}_{i,j}}} \right\|}^2}} $ (15)

式中,由于只考虑目标对象的缩放,$ {\mathit{\boldsymbol{L}}_{\rm{o}}}$表示目标对象的网格线集合,$ρ$表示布局规则确定的缩放比例。

图像重组的一个重要目的是移动图像中目标对象的位置,实现目标对象位置的改变。根据本文的框架结构,这个问题可以简化为网格坐标位置的移动。这里给出目标对象的位置调整能量项,其余网格坐标会通过图像质量优化能量项自适应调整

$ \begin{array}{*{20}{c}} {{E_{{\rm{AO}}}} = \min \left\{ {{{\left| {\sum\limits_{{\mathit{\boldsymbol{V}}_i} \in {\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }} _{\rm{o}}}} {\sum\limits_{j = 1}^3 {\frac{{\tilde x_i^j - x_i^j}}{{N\left( {{\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }} _{\rm{o}}}} \right)}} - {\delta _x}} } } \right|}^2} + } \right.}\\ {\left. {{{\left| {\sum\limits_{{V_i} \in {\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }} _{\rm{o}}}} {\sum\limits_{j = 1}^3 {\frac{{\tilde y_i^j - y_i^j}}{{N\left( {{\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }} _{\rm{o}}}} \right)}} - {\delta _y}} } } \right|}^2}} \right\}} \end{array} $ (16)

式中,${\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }}_{\rm{o}}}$表示目标对象的网格顶点集合,$N$(${\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }}_{\rm{o}}}$)表示目标对象网格顶点总数,$δ_{x}$$δ_{y}$表示由式(2)计算得出的该目标对象的水平位移和垂直位移。

2.3 视差适应能量项

相比平面图像,立体图像的深度线索是区别平面图像的重要特征。基于文献[26],当目标对象的大小发生改变时,其深度也需要改变,具体到图像平面就是视差必须改变。图 4 (a)表示目标对象能正常感知的情况;图 4 (b)表示在目标对象缩小但视差保持不变的情况下,感知到目标对象形变变窄;图 4 (c)表示在目标对象放大但视差保持不变的情况下,感知到目标对象形变变宽;图 4 (d)表示在目标对象缩小且视差对应缩小的情况下,目标对象能正常感知;图 4 (e)表示在目标对象放大且视差对应增大的情况下,目标对象能正常感知。参考文献[19],将目标对象的缩放比例等同于视差缩放比例

图 4 视差与感知目标对象形变的关系
Fig. 4 Relationship between disparity and the deformation of perceived target objects((a)original; (b)compression; (c)stretching; (d)zoom out; (e)zoom in)

$ \rho \cdot d_i^j = \tilde x_{{\rm{r}},i}^j - \tilde x_{{\rm{l}},i}^j $ (17)

在观看源图像时,其深度感知在某一范围内。出于保护非目标对象深度感知范围的目的,对非目标对象进行视差保持。视差一致性的能量项可以构建为

$ \begin{array}{*{20}{c}} {{E_{{\rm{DS}}}} = \min \left\{ {\sum\limits_{{\mathit{\boldsymbol{V}}_i} \in {\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }} _{\rm{n}}}} {\sum\limits_{j = 1}^3 {\left[ {{{\left( {d_i^j - \left( {\tilde x_{{\rm{r}},i}^j - \tilde x_{{\rm{l}},i}^j} \right)} \right)}^2} + } \right.} } } \right.}\\ {\left. {{{\left( {\tilde y_{{\rm{r}},i}^j - \tilde y_{{\rm{l}},i}^j} \right)}^2}} \right] + \sum\limits_{{\mathit{\boldsymbol{V}}_i} \in {\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }} _{\rm{o}}}} {\sum\limits_{j = 1}^3 {\left[ {{{\left( {\rho \cdot d_i^j - \left( {\tilde x_{{\rm{r}},i}^j - \tilde x_{{\rm{l}},i}^j} \right)} \right)}^2} + } \right.} } }\\ {\left. {\left. {{{\left( {\tilde y_{{\rm{r}},i}^j - \tilde y_{{\rm{l}},i}^j} \right)}^2}} \right]} \right\}} \end{array} $ (18)

式中,${\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }}_{\rm{n}}}$${\mathit{\boldsymbol{ \boldsymbol{\varUpsilon} }}_{\rm{o}}}$分别表示非目标对象与目标对象的网格顶点集合,$ x_{{\rm{l}}, i}^j, x_{{\rm{r}}, i}^j, y_{{\rm{l}}, i}^j, y_{{\rm{r}}, i}^j$分别表示第$i$个Delaunay网格的第$j$个顶点在左右图的横坐标与纵坐标位置。

2.4 特征线与边界约束

本文在对源图像进行预处理的过程中提取了特征线并等间隔采样得到特征点,保持特征线的形状对图像的质量保持具有重要意义。具体到约束条件,就是使采样特征点的位置(纵坐标)以相同距离进行移动

$ \bigcup\limits_{\mathit{\boldsymbol{v}}_i^j \in {\mathit{\boldsymbol{ \boldsymbol{\varGamma} }}_{{\rm{le}}}}} {\tilde y_i^j} = y_i^j + \zeta $ (19)

式中,${\mathit{\boldsymbol{ \boldsymbol{\varGamma} }}_{{\rm{le}}}} $表示特征线采样得到的特征点的集合,$ζ$表示特征线整体向上或向下的移动距离。对于图 2(a)所示的特征线与目标对象相交的情况,特征线的移动距离与目标对象在纵坐标方向的移动要保持一致,即$ζ=δ_{y}$

在图像优化过程中,图像边界点的位置变动会对图像的尺寸和整体显示形状产生影响。本文主要研究图像内容的重组,不希望图像的尺寸和整体显示形状发生变化,因此需要对图像进行边界保持约束,其约束条件表示为

$ \bigcup\limits_{\mathit{\boldsymbol{v}}_i^j \in {\mathit{\boldsymbol{ \boldsymbol{\varGamma} }}_{{\rm{by}}}}} {\tilde x_i^j} = x_i^j,\tilde y_i^j = y_i^j $ (20)

式中,${\mathit{\boldsymbol{ \boldsymbol{\varGamma} }}_{{\rm{by}}}} $表示图像边界特征点的集合。横向边界只需横坐标约束,纵向边界只需纵坐标约束,4个边界顶点需要横坐标和纵坐标约束。

2.5 整体能量项优化

根据建立的能量项,将网格形变转变为通过最小二乘优化求解最佳坐标点的问题,总能量项表示为

$ \begin{array}{*{20}{c}} {{E_{{\rm{total}}}} = {w_{{\rm{SD}}}}\left( {E_{{\rm{SD}}}^{\rm{l}} + E_{{\rm{SD}}}^{\rm{r}}} \right) + {w_{{\rm{AT}}}}\left( {E_{{\rm{AT}}}^{\rm{l}} + E_{{\rm{AT}}}^{\rm{r}}} \right) + }\\ {{w_{{\rm{SO}}}}\left( {E_{{\rm{SO}}}^{\rm{l}} + E_{{\rm{SO}}}^{\rm{r}}} \right) + {w_{{\rm{AO}}}}{E_{{\rm{AO}}}} + {w_{{\rm{DS}}}}{E_{{\rm{DS}}}}} \end{array} $ (21)

式中,$ {E_{{\rm{total}}}}$表示待优化的总能量项,$w$表示各类能量项的加权系数,$E$的上标$ {\rm l}$${\rm r} $分别对应于源图像左右图的能量项。式(19)和式(20)是优化过程中的约束条件,如果特征线不存在,则约束条件式(19)可以舍去。

3 实验结果

为了测试重组的效果,本文使用南京大学立体数据库[27]进行实验,从特征线调整、目标对象位置移动、多目标对象缩放、目标对象位置同时移动与缩放和多目标对象同时缩小与放大5个方面进行对比实验分析,同时分析能量项的不同参数设置对图像重组的影响。

3.1 重组结果分析

本文方法的重组实验结果如图 5,每列为不同场景的图片,第1列是特征线与目标对象相交的情况,在纵坐标方向移动目标对象的同时特征线需要一同跟随移动。由于只涉及目标对象的移动,因此从视差图中可以看到目标对象优化前后视差保持不变,非目标对象的视差也得到了保持。图 5第2列也是特征线与目标对象相交的情况,但是由于目标对象只需要横向移动,因此特征线只要保持即可,不需要位置的调整。同样,由于目标对象没有进行缩放,所以目标对象与非目标对象区域的视差都得到了保持。图 5第3列没有明显的特征线,因此不考虑特征线因素。这里主要测试多目标对象一同缩放的效果。从视差图可以看出,2个目标对象缩小的同时目标对象视差也随之缩小,非目标对象视差依旧保持。图 5第4列的参考图像与目标对象形状不同,主要是为了说明参考图像的形状不需要与目标对象形状相似(图 5中其余的参考图像与目标对象形状相似主要是为了便于观察重组的效果)。该列是特征线与目标对象分离的情况,所以目标对象的调整相对自由。此处改变了目标对象的位置并放大了目标对象,从视差图中可以看出,目标对象的视差变大而非目标对象视差依旧保持。在图 5第5列中,对多目标对象同时进行缩小与放大操作,优化后蓝色的车变小而红色的车变大,同时目标对象视差也发生改变,非目标对象视差依旧保持。总体而言,图 5的视差自适应与理论相符,重组后的图像布局与质量令人满意。

图 5 立体图像重组结果
Fig. 5 Recomposition results of stereoscopic images ((a) original red-cyan anaglyph; (b) proposed red-cyan anaglyph; (c) reference images; (d) original disparity; (e) proposed disparity)

3.2 不同参数对重组结果的影响

分析不同能量项对最终结果的影响能够检验能量项在实际优化中是否起到正确的作用。图像质量能量项的作用已经在文献[25]中验证,本文主要验证提出的布局匹配能量项和视差适应能量项。图 6显示了在式(21)不同参数设置情况下得到的优化结果。图 6 (a)(b)分别是源图像的左图和参考图像。图 6 (c)的参数设置如表 1中的方案1,主要分析参数设置对目标对象放大的影响。随着$ {w_{{\rm{SO}}}}$的增大,$ {E_{{\rm{SO}}}}$$ {E_{{\rm{total}}}}$所占的能量比重越来越大,目标对象大小越来越接近布局要求的目标对象大小,但目标对象位置由于没有优化所以不能很好定量。图 6 (d)的参数设置如表 1中的方案2,主要分析参数设置对目标对象位置调整的影响。随着$ {w_{{\rm{AO}}}}$的增大,$ {E_{{\rm{AO}}}}$$ {E_{{\rm{total}}}}$所占的能量比重越来越大,目标对象位置越来越接近布局要求的目标对象位置,但目标对象大小由于没有优化所以也无法定量。图 6 (e)的参数设置如表 1中的方案3,对目标对象的大小与位置同时进行优化,实现了类似于图 6 (b)布局的图像重组。图 6 (h)的参数设置如表 1中的方案4,主要分析参数设置对立体图像一致性操作的影响。随着$ {w_{{\rm{DS}}}}$的增大,$ {E_{{\rm{DS}}}}$$ {E_{{\rm{total}}}}$所占的能量比重越来越大,从图 6 (g)(i)的视差变化可以看出,左右图的一致性越来越强,即垂直视差偏移减小,目标对象视差能够自适应调整,背景视差保持不变。注意,由于不同立体图像的尺寸和目标对象大小都不同,所生成的网格数也会不同,固定参数会导致不同能量占总能量的比重在不同立体图像中有所不同。为体现实验结果的通用性,本文根据不同参数对实验效果的影响,将参数设置为:$ {w_{{\rm{SD}}}}$=10, $ {w_{{\rm{AT}}}}$=20, $ {w_{{\rm{DS}}}}$=20, $ {w_{{\rm{SO}}}}$=40,$ {w_{{\rm{AO}}}}$=200。

图 6 不同参数对重组结果的影响
Fig. 6 The influence of different parameters on recomposition results ((a) original image; (b) reference image; (c) scheme-1; (d) scheme-2; (e) scheme-3; (f) original red-cyan anaglyph; (g) original disparity; (h) scheme-4; (i) corresponding disparity)

表 1 不同方案的参数设置
Table 1 Parameter settings for different schemes

下载CSV
方案 描述
1 $ {w_{{\rm{SD}}}}$=10, ${w_{{\rm{AT}}}} $=20, $ {w_{{\rm{DS}}}}$=20, $ {w_{{\rm{AO}}}}$=0, $ {w_{{\rm{SO}}}}$=30、40、50
2 $ {w_{{\rm{SD}}}}$=10, ${w_{{\rm{AT}}}} $=20, $ {w_{{\rm{DS}}}}$=20, $ {w_{{\rm{SO}}}}$=0, $ {w_{{\rm{AO}}}}$=100、200、300
3 $ {w_{{\rm{SD}}}}$=10, ${w_{{\rm{AT}}}} $=20, $ {w_{{\rm{DS}}}}$=20, $ {w_{{\rm{SO}}}}$=40, $ {w_{{\rm{AO}}}}$=200
4 $ {w_{{\rm{SD}}}}$=10, ${w_{{\rm{AT}}}} $=20, $ {w_{{\rm{SO}}}}$=40, $ {w_{{\rm{AO}}}}$=200, $ {w_{{\rm{DS}}}}$=10、20、30

3.3 与现有方法进行比较

文献[19]提出的ASDA方法与本文方法都是面向立体图像的重组与视差自适应,因此本文与其进行对比实验。在图 7 (b)中,第1列车轮左边出现模糊,第2列球与特征线相交处的直线扭曲丢失,第3列羊腿边出现伪影,第4列鸟嘴处出现伪影,第5列小孩裤子的阴影丢失。这些图像语义与源图像不一致是因为ASDA方法需要提取目标对象,对背景空洞进行修补会有模糊与伪影出现。而且将提取的目标对象与优化后的背景进行粘贴也会有语义错误出现。此外,该方法对于目标对象分割的精度要求很高,否则重组效果会受较大影响。相比之下,图 7 (c)的本文方法在复原ASDA方法重组效果的情况下没有语义错误的情况出现。而且本文方法的分割精度要求相对较低,只要求掩膜覆盖目标对象即可,不需要掩膜边界线条与目标对象边界完全重合。总的来说,相比ASDA方法,本文方法在语义的保持和目标对象提取方面具有优势。

图 7 本文方法与文献[19]方法对比
Fig. 7 Comparison of the proposed and reference [19] method ((a) original images; (b) ASDA; (c) proposed method)

文献[20]提出的ASWARP方法与本文方法都是应用网格形变进行立体图像重组,因此本文与其进行比较。在图 8 (b)中,ASWARP方法的第1、2行的鹰在位置调整后翅膀有形变且无法对鹰进行缩放,视差也不能自适应调整。第3、4行的骑手位置受特征线调整的影响。相比之下,本文方法的第1、2行的鹰在位置调整后翅膀没有明显形变且实现了对鹰的缩放,视差能自适应调整。第3、4行的骑手位置不受特征线调整的影响,说明本文方法能单独对特征线进行调整。总的来说,相比ASWARP方法,本文方法能实现对象的缩放、视差的自适应和特征线的调整。

图 8 本文方法与文献[20]方法对比
Fig. 8 Comparison of the proposed and reference [20] method ((a) original images; (b) ASWARP; (c) proposed method)

3.4 局限性

本文方法的局限性在于灵活性。由于重组主要通过网格形变实现,因此在灵活性方面受到图像内容的限制。在图 9 (c)第1行图像中,本文方法在放大目标对象时会出现柱子的扭曲。这主要是由于目标对象与柱子过于接近,目标对象的放大会影响到柱子的形状。在图 9 (c)第2行图像中,本文方法无法改变人物与特征线的相交关系,而这些问题在图 9(b)中不存在。因为ASDA方法是目标对象与非目标对象分开优化,然后再粘贴到一起,其灵活度比本文方法高,因此在图 9的场景中具有更好的表现。

图 9 本文方法的局限性分析
Fig. 9 Limitation analysis of the proposed method ((a) original images; (b) ASDA; (c) proposed method)

3.5 算法复杂度分析

不考虑目标对象提取与显著图计算所需的时间,处理分辨率为450 × 487像素的立体图像,本文方法在Intel i3-2130 CPU,3.40 GHz和4 GB内存的条件下所需时间为59.4 s。考虑到ASDA方法在空洞修补时所需时间为2~4 min,本文方法所需的时间处于可接受范围。

4 结论

本文从网格形变角度提出了一种立体图像重组方法,利用参考图像进行模板匹配,使优化后的立体图像布局类似于参考图像。在视差方面,将目标对象的视差与缩放比例相联系,而非目标对象则视差保持,以此实现目标对象感知形状的保护和非目标对象深度感知范围的保持。结果表明,本文方法在重组后的语义保持方面具有一定优势,能够依据参考图像实现立体图像的重组。在接下来的工作中,考虑将裁剪方法与本文网格形变方法结合起来进行立体图像重组,进一步提升重组的灵活度。

参考文献

  • [1] Yao L, Suryanarayan P, Qiao M, et al. OSCAR:On-site composition and aesthetics feedback through exemplars for photographers[J]. International Journal of Computer Vision, 2012, 96(3): 353–383. [DOI:10.1007/s11263-011-0478-3]
  • [2] Islam M B, Wong L K, Wong C O. A survey of aesthetics-driven image recomposition[J]. Multimedia Tools and Applications, 2017, 76(7): 9517–9542. [DOI:10.1007/s11042-016-3561-5]
  • [3] Bhattacharya S, Sukthankar R, Shah M. A framework for photo-quality assessment and enhancement based on visual aesthetics[C]//Proceedings of the 18th ACM International Conference on Multimedia. Firenze, Italy: ACM, 2010: 271-280.[DOI:10.1145/1873951.1873990]
  • [4] Liu L G, Chen R J, Wolf L, et al. Optimizing photo composition[J]. Computer Graphics Forum, 2010, 29(2): 469–478. [DOI:10.1111/j.1467-8659.2009.01616.x]
  • [5] Wang W N, Liu J C, Xu X M, et al. Aesthetic enhancement of images based on photography composition guidelines[J]. Journal of South China University of Technology:Natural Science Edition, 2015, 43(5): 51–58. [王伟凝, 刘剑聪, 徐向民, 等. 基于构图规则的图像美学优化[J]. 华南理工大学学报:自然科学版, 2015, 43(5): 51–58. ] [DOI:10.3969/j.issn.1000-565X.2015.05.009]
  • [6] Liang Y, Wang X T, Zhang S H, et al. PhotoRecomposer:interactive photo recomposition by cropping[J]. IEEE Transactions on Visualization and Computer Graphics, 2017, 24(10): 2728–2742. [DOI:10.1109/TVCG.2017.2764895]
  • [7] Bhattacharya S, Sukthankar R, Shah M. A holistic approach to aesthetic enhancement of photographs[J]. ACM Transactions on Multimedia Computing, Communications, and Applications, 2011, 7: #21. [DOI:10.1145/2037676.2037678]
  • [8] Park J, Lee J Y, Tai Y W, et al. Modeling photo composition and its application to photo re-arrangement[C]//Proceedings of the 19th IEEE International Conference on Image Processing. Orlando, FL, USA: IEEE, 2012: 2741-2744.[DOI:10.1109/ICIP.2012.6467466]
  • [9] Guo G J, Wang H Z, Shen C H, et al. Automatic image cropping for visual aesthetic enhancement using deep neural networks and cascaded regression[J]. IEEE Transactions on Multimedia, 2018, 20(8): 2073–2085. [DOI:10.1109/TMM.2018.2794262]
  • [10] Zhang F L, Wang M, Hu S M. Aesthetic image enhancement by dependence-aware object recomposition[J]. IEEE Transactions on Multimedia, 2013, 15(7): 1480–1490. [DOI:10.1109/TMM.2013.2268051]
  • [11] Chang H T, Wang Y C F, Chen M S. Transfer in photography composition[C]//Proceedings of the 22nd ACM International Conference on Multimedia. Orlando, Florida, USA: ACM, 2014: 957-960.[DOI:10.1145/2647868.2654976]
  • [12] Li K, Yan B, Li J, et al. Seam carving based aesthetics enhancement for photos[J]. Signal Processing:Image Communication, 2015, 39: 509–516. [DOI:10.1016/j.image.2015.07.005]
  • [13] Wong L K, Low K L. Enhancing visual dominance by semantics-preserving image recomposition[C]//Proceedings of the 20th ACM International Conference on Multimedia. Nara, Japan: ACM, 2012: 845-848.[DOI:10.1145/2393347.2396327]
  • [14] Chang H T, Pan P C, Wang Y C F, et al. R2P: Recomposition and retargeting of photographic images[C]//Proceedings of the 23rd ACM International Conference on Multimedia. Brisbane, Australia: ACM, 2015: 927-930.[DOI:10.1145/2733373.2806366]
  • [15] Jin Y, Wu Q B, Liu L G. Aesthetic photo composition by optimal crop-and-warp[J]. Computers & Graphics, 2012, 36(8): 955–965. [DOI:10.1016/j.cag.2012.07.007]
  • [16] Niu Y Z, Liu F, Feng W C, et al. Aesthetics-based stereoscopic photo cropping for heterogeneous displays[J]. IEEE Transactions on Multimedia, 2012, 14(3): 783–796. [DOI:10.1109/TMM.2012.2186122]
  • [17] Tong R F, Zhang Y, Cheng K L. StereoPasting:interactive composition in stereoscopic images[J]. IEEE Transactions on Visualization and Computer Graphics, 2013, 19(8): 1375–1385. [DOI:10.1109/TVCG.2012.319]
  • [18] Luo S J, Shen I C, Chen B Y, et al. Perspective-aware warping for seamless stereoscopic image cloning[J]. ACM Transactions on Graphics, 2012, 31(6): #182. [DOI:10.1145/2366145.2366201]
  • [19] Islam M B, Wong L K, Low K L, et al. Aesthetics-driven stereoscopic 3-D image recomposition with depth adaptation[J]. IEEE Transactions on Multimedia, 2018, 20(11): 2964–2979. [DOI:10.1109/TMM.2018.2820324]
  • [20] Islam M B, Wong L K, Wong C O, et al. Stereoscopic image warping for enhancing composition aesthetics[C]//Proceedings of the 3rd IAPR Asian Conference on Pattern Recognition. Kuala Lumpur, Malaysia: IEEE, 2015: 645-649.[DOI:10.1109/ACPR.2015.7486582]
  • [21] Gastal E S L, Oliveira M M. Shared sampling for real-time alpha matting[J]. Computer Graphics Forum, 2010, 29(2): 575–584. [DOI:10.1111/j.1467-8659.2009.01627.x]
  • [22] Wang W G, Shen J B, Yu Y Z, et al. Stereoscopic thumbnail creation via efficient stereo saliency detection[J]. IEEE Transactions on Visualization and Computer Graphics, 2017, 23(8): 2014–2027. [DOI:10.1109/TVCG.2016.260059]
  • [23] Fernandes L A F, Oliveira M M. Real-time line detection through an improved Hough transform voting scheme[J]. Pattern Recognition, 2008, 41(1): 299–314. [DOI:10.1016/j.patcog.2007.04.003]
  • [24] Zhang G X, Cheng M M, Hu S M, et al. A shape-preserving approach to image resizing[J]. Computer Graphics Forum, 2010, 28(7): 1897–1906. [DOI:10.1111/j.1467-8659.2009.01568.x]
  • [25] Chang C H, Liang C K, Chuang Y Y. Content-aware display adaptation and interactive editing for stereoscopic images[J]. IEEE Transactions on Multimedia, 2011, 13(4): 589–601. [DOI:10.1109/TMM.2011.2116775]
  • [26] Niu Y Z, Feng W C, Liu F. Enabling warping on stereoscopic images[J]. ACM Transactions on Graphics, 2012, 31(6): #183. [DOI:10.1145/2366145.2366202]
  • [27] Ju R, Liu Y, Ren T W, et al. Depth-aware salient object detection using anisotropic center-surround difference[J]. Signal Processing:Image Communication, 2015, 38: 115–126. [DOI:10.1016/j.image.2015.07.002]