|
发布时间: 2019-05-16 |
图像处理和编码 |
|
|
收稿日期: 2018-09-12; 修回日期: 2018-10-31
基金项目: 国家自然科学基金项目(61462065,61661036)
第一作者简介:
张桂梅, 1970年生, 女, 教授, 主要研究方向为计算机视觉、图像处理和模式识别。E-mail:guimei.zh@163.com;
李艳兵, 男, 南昌航空大学机械工程硕士研究生, 主要研究方向为计算机视觉、图像处理和模式识别。E-mail:472944577@qq.com.
中图法分类号: TP391.41
文献标识码: A
文章编号: 1006-8961(2019)05-0700-14
|
摘要
目的 TV(total variation)模型在图像修复时易导致图像中具有弱导数性质的纹理和边缘细节等信息变得模糊,为了克服该缺陷,分数阶微分被引入到TV模型中,但传统的分数阶TV模型对弱边缘和弱纹理等细节信息的保持仍不够理想,并且没有充分利用图像已知区域的先验信息,修复精度仍有待提高。方法 针对该问题,提出结合纹理结构信息和分数阶TV模型的图像修复算法。改进的模型在分数阶TV模型求解时,在梯度计算过程中增加了一个极小值,克服了正则项和数据项在零点处的不可微,从而增加了模型的稳定性。再则改进的模型根据图像已知区域的先验信息确定待修复区域的纹理方向,从而更好地保持了图像中的纹理细节和弱边缘信息。结果 将本文算法与3种修复效果较好的算法进行对比,采用客观评价指标:均方差(MSE)、峰值信噪比(PSNR)和差值图像进行评价,实验结果表明本文算法在不同的纹理图像修复中均取得较好的效果,如对标准图像库中的Barbara和Lena图像以及岩石图像进行修复后,与原始TV模型相比,它们的峰值信噪比分别提高5.94%、8.07%和3.85%,灰度均方差分别降低48.66%、65.89%和35%;与分数阶TV模型相比,它们的峰值信噪比分别提高4.17%、8.59%和1.81%,灰度均方差分别降低37.90%、68.00%和18.68%。结论 提出的模型相对于原始的TV模型和分数阶TV模型,均能有效地提高图像修复的精度,适合于包含较多弱纹理和弱边缘信息的图像修复,该模型是TV模型的重要延伸和推广。
关键词
图像修复; 分数阶微分; 弱纹理; TV模型; 边缘细节
Abstract
Objective As a fundamental issue in the field of image processing, image inpainting has been widely studied in the past two decades. The goal of image inpainting is to reconstruct the original high-quality image from its corrupted observation. Notably, prior knowledge of images is important in image inpainting. Thus, designing an effective regularization to represent image priors is a critical task for image inpainting. The TV(total variation) model usually exploits local structures and high effectiveness to preserve image edges; thus, it has been found to be widely used in image inpainting. However, the regular term of the TV model is a first-order differential, which usually loses image details and tends to suffer from over-smooth effects owing to the piecewise constant assumption. Fortunately, fractional differential is capable of enhancing low-and intermediate-frequency signals and amplifying high-frequency signals moderately; thus, it is introduced into the TV model. However, the existing fractional TV model is limited with regard to its preservation of the information of images with texture and edge details. Furthermore, it does not fully use prior information such as known edges and textures. Method To address these problems, we propose a new fractional-order TV model that introduces texture structure information into a fractional TV model for image inpainting. A minimum value is used in the TV model to calculate the image gradient when solving the fractional model. Thus, the improved model is robust because it overcomes the problem of the model being non-differentiable at zero point. In this way, the weak texture information is effectively preserved. The improved model determines the texture direction of the region to be restored on the basis of the priors of the known region of the image and fully uses the texture information of the image to improve the accuracy of image inpainting. Result The Barbara and Lena images are selected as test images. The Barbara image presents a large weak texture area. By contrast, the Lena image includes few texture regions and a highly smooth area. Therefore, these two images are used for the experiment. To improve efficiency, we intercept the texture part of the original image and conduct many experiments by using differently sized templates and different orders of fractional differential. Then, the optimal parameters for different images, such as template size and order, can be obtained. The optimal parameters for the Barbara and Lena images are as follows. For the Barbara image, the optimal order is 0.1, and the optimal template size is 3×3 pixels; for the Lena image, the optimal order is 0.9, and the optimal template size is 5×5 pixels. The algorithm is compared with three algorithms with better restoration effects. Mean square error (MSE) and peak signal-to-noise ratio (PSNR) are introduced to evaluate the performance of the different methods. Experimental results indicate that the proposed algorithm achieves improved inpainting result. Unlike that in the TV model, the PSNR values after the restoration of the Barbara, Lena, and Rock images in the proposed method increase by 5.94%, 8.07%, and 3.85%, respectively; and the MSE values decrease by 48.66%, 65.89%, and 35%, respectively. Relative to the fractional TV model, the proposed method achieves PSNR values for the Barbara image, Lena image, and Rock image that increase by 4.17%, 8.59%, and 1.81%, respectively; its MSE values decrease by 37.90%, 68.00%, and 18.68%, respectively. Conclusion The relationship between inpainting effect, template order, and template size is are demonstrated in experiments, thereby providing the basis for selecting optimal parameters. Although the optimal parameters of different types of images are different, the optimal inpainting order is generally between 0 and 1 because the smooth part of the image corresponds to the low-frequency part of the signal. The texture details of the image correspond to the intermediate-frequency part of the signal. Meanwhile, the TV algorithm is not ideal for the weak texture region. To enhance the gradient information of the region, we must improve the low-and intermediate-frequency parts. Therefore, choosing the order between 0 and 1 is recommended. Furthermore, although the optimal order varies with the type of the image, a weak texture region usually results in a small order. Theoretical analysis and experimental results show that the proposed model can effectively improve the accuracy of image restoration relative to the original TV model and fractional order TV model. The proposed model is suitable for inpainting images with weak texture and edge information. This model is an important extension of the TV model.
Key words
image inpainting; fractional differential; weak texture; TV model; edge detail
0 引言
图像修复是图像处理的一个基本问题,针对图像中遗失或破损的区域,利用周围已知的信息,按照一定的规则来填补,使修复后的图像接近或达到原图的视觉效果。修复技术在文物复原和文物保护方面有着重要和广泛的应用。如从旧字画中移除划痕、复原破损文物等。图像修复的研究方法根据修复的侧重点可以分为3类:基于扩散的修复方法、基于纹理的修复方法和基于稀疏表示的修复方法。基于扩散的修复方法常用于较小区域的修复,如基于偏微分方程的BSCB[1](由Bertalmio、Sapiro与Casel Ballester提出)修复模型,该修复模型的基本思想是以单个像素为基本单位沿着等照度线按照由外向内的顺序依次进行迭代式修复,修复过程是通过求解一个三阶偏微分方程实现的,同时加入各向异性扩散方程,避免了等照度线的相交,使边缘平滑。基于纹理的修复方法常用于较大区域的修复,Criminisi等人[2]提出了基于优先度顺序样本填充的修复算法,其核心思想是根据等照度线驱动采样过程,通过搜索最佳相似匹配块进行纹理复制,此方法通过平衡优先权函数中置信项和数据项来同时处理图像中的结构信息和纹理信息。但是该算法容易产生误差累积,同时对非线性结构的信息扩散和深度信息的处理不够理想,且图像中如果没有足够合理的采样块,修复结果通常不佳。基于稀疏表示的修复方法,Zhang[3]采用解线性规划问题来处理图像修复,分析了稀疏分解在修复方面的一些应用,并给出了详细的理论依据。但是在稀疏表示的字典构造、稀疏表示特性约束与其他统计特性约束的结合等方面还存在较多问题,如容易生成伪影等问题。
分数阶在最近几年引起了广泛的关注,越来越多的学者将分数阶应用于图像处理中。常见应用有图像去噪、图像增强、图像配准、图像边缘检测以及图像修复。如文献[4]将分数阶引入到图像去噪中,在保持图像的弱边缘和纹理细节方面有较好的效果。文献[5]将分数阶应用于图像增强中,从而使图像边缘更加突出、纹理更加清晰且图像平滑区域信息得到较好保留。文献[6]将分数阶应用于图像配准中,由于分数阶微分比整数阶微分具有更好的细节描述能力,该方法能够有效地提高图像配准的精度,能用于包含较多弱纹理和弱边缘信息的医学图像配准。文献[7]将分数阶引入到图像的边缘检测中,将G-L分数阶梯度代替Canny中传统的梯度算子,不但可以增强图像的细节信息,而且可以增强灰度均匀和弱纹理区域的梯度信息,从而提高了边缘检测的精度和稳定性。文献[8]将分数阶引入图像修复中,提出了分数阶与TV模型相结合的方法,该方法对图像细节信息的修复具有较好的效果。
TV模型由于能去除图像中的噪声,近年来学者们将TV模型应用到图像修复中。如Chan等人[9]提出了将TV模型应用到图像修复中,该方法是基于偏微分方程的图像修复算法,但是其收敛速度较慢,且容易产生过度平滑。针对基于偏微分方程修复算法运行速度较慢的问题,Telea[10]提出了一种新的基于水平集的快速图像修复方法,该算法解决了修复算法运行速度较慢的问题,但是基于水平集的方法易造成区域模糊并且对边缘信息保持不佳。针对该问题,李开宇等人[11]提出一种改进方案,在权函数的设计中,引入连续强度来保持边缘信息,并利用等照度线的方向计算出两个像素点的位置关系。当修复单个点时,引入置信因子来加权插值点。该算法在保证运行效率的同时提高了修复精度,但是该方法并没有解决纹理过度平滑问题。文献[8]提出了分数阶与TV模型相结合的修复方法,相对原始的TV模型有了较大提升,能够非线性地保留图像平滑区域的纹理信息,有效地解决纹理过度平滑问题,对图像细节信息具有较好的修复效果。但是该方法对具有弱导数性质的纹理细节等信息的保持仍不够理想,并且在模型最小化过程中导致了计算上的困难,其主要原因是正则项和数据项在零点处不可微。
针对上述问题,本文在文献[8]的基础上提出了一种结合纹理信息与分数阶TV模型的图像修复方法。由于文献[8]对具有弱导数性质的纹理细节等信息的保持仍然不够理想,并且没有充分利用已知区域的纹理先验信息,从而导致修复精度不够理想,本文在求解TV模型时,在梯度计算过程中增加了一个极小值,克服了正则项和数据项在零点处不可微的问题,增加模型的稳定性,从而可以有效地保持纹理区域的弱导数特性;此外在修复过程中充分利用已知区域的纹理先验信息,根据先验信息确定待修复区域的纹理方向,从而更好地保持图像中的纹理细节和弱边缘信息。
1 相关理论
1.1 分数阶微分
目前,分数阶微分主要有3种定义,分别为Grünwald-Letnikov(G-L)、Riemann-Liouville(R-L)和Caputo[12],其中G-L定义从整数阶微分的差分定义出发推导,而R-L和Caputo定义则根据整数阶积分的柯西公式计算推导。Caputo定义适用于分数阶微分方程初边值问题的分析,适用于工程等领域;其中G-L和R-L在数值运算时可以转化为卷积积分形式,因此适用于信号处理等领域,在计算中,G-L定义比R-L定义更准确,因此本文选取G-L定义的分数阶微积分。
G-L是比较经典的分数阶定义,它的实质是由整数阶推导出来的,根据整数阶微分的定义,在区间
$ {f^\prime }(t) = \mathop {\lim }\limits_{h \to 0} \frac{{f(t + h) - f(h)}}{h} $ | (1) |
式中,
$ \begin{array}{*{20}{l}} {{f^{\prime \prime }}(t) = \mathop {\lim }\limits_{h \to 0} \frac{{{f^\prime }(t + h) - {f^\prime }(h)}}{h} = }\\ {\mathop {\lim }\limits_{h \to 0} \frac{{f(t + 2h) - 2f(t + h) + f(h)}}{{{h^2}}}} \end{array} $ | (2) |
以此类推,可将整数阶阶次从一阶推到
$ {f^n}(t) = \mathop {\lim }\limits_{h \to 0} \frac{1}{{{h^n}}}\sum\limits_{m = 0}^n {{{( - 1)}^m}} \left( {\begin{array}{*{20}{l}} n\\ m \end{array}} \right)f(t - mh) $ | (3) |
将整数阶
$ \begin{array}{l} {}_a^G{\rm{D}}_t^\alpha f(t) = \mathop {\lim }\limits_{h \to 0} \frac{1}{{{h^\alpha }}}\sum\limits_{m = 0}^{\left[ {\frac{{t - a}}{h}} \right]} {{{( - 1)}^m}} \times \\ \frac{{\mathit{\Gamma} (\alpha + 1)}}{{m!\mathit{\Gamma} (\alpha - m + 1)}}f(t - mh) \end{array} $ | (4) |
式中,
$ \mathit{\Gamma }(n) = \int_0^\infty {{{\rm{e}}^{ - t}}} {t^{n - 1}}{\rm{d}}t = (n - 1)! $ | (5) |
对于图像的中低频区域[13],当阶次选择在0~1之间时,用分数微分算子处理后得到的值大于整数阶(包括1阶和2阶)微分算子的值。然而在图像高频区域中,分数阶微分算子提升幅度小于1阶和2阶微分算子,阶次越小,提升的幅度越小。因此,可以得出如下结论:分数阶微分具有“弱导数”的性质,它不仅能增强信号的高频部分,而且能非线性地保留中低频。在数字图像中,图像的纹理细节和弱边缘对应的是中低频信息,图像的噪声对应着高频信息。用整数阶微分处理图像,其弱边缘和纹理信息将较大地衰减,噪声信号将被较大地增强。但是,分数阶微分可以用来克服这一缺陷,噪声信号不会被极大地增强,而弱边缘以及纹理信息同时会被非线性地保留。
1.2 TV模型修复
图像修复方法一般都是由已知区域的边缘区域
$ {J_\lambda }(\mathit{\boldsymbol{u}}) = \int\limits_{\mathit{\boldsymbol{E}} \cup \mathit{\boldsymbol{D}}} {\left| {\nabla \mathit{\boldsymbol{u}}} \right|{\rm{d}}x{\rm{d}}y} + \frac{\lambda }{2}\int_\mathit{\boldsymbol{E}} {{{\left| {\mathit{\boldsymbol{u}} - {\mathit{\boldsymbol{u}}^0}} \right|}^2}} {\rm{d}}x{\rm{d}}y $ | (6) |
式中,第1项为正则项,它的作用是在
由式(6)可知,能量泛函的梯度下降方程为
$ -\operatorname{div}\left(\frac{\nabla \boldsymbol{u}}{|\nabla \boldsymbol{u}|}\right)+\lambda_{e}\left(\boldsymbol{u}-\boldsymbol{u}^{0}\right)=0 $ | (7) |
式中,
由于图像是离散的,图像中点的邻域如图 1所示。其中
因此,将式(6)离散化为
$ \sum\limits_{\begin{array}{*{20}{c}} {X \in \boldsymbol{B}}\\ {x \in \boldsymbol{B'}} \end{array}} {\frac{1}{{\left| {\nabla {\boldsymbol{u}_x}} \right|}}} \left( {{\boldsymbol{u}_o} - {\boldsymbol{u}_X}} \right) + {\lambda _e}(O)\left( {{\boldsymbol{u}_O} - \boldsymbol{u}_O^0} \right) = 0 $ | (8) |
式中,
化简得到最终的表达式为
$ {\mathit{\boldsymbol{u}}_O} = \frac{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{{{\mathit{\boldsymbol{u}}_X}}}{{\sqrt {\left| {\nabla {\mathit{\boldsymbol{u}}_x}} \right|} }} + {\lambda _e}(O)\mathit{\boldsymbol{u}}_O^0} }}{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{1}{{\sqrt {\left| {\nabla {\mathit{\boldsymbol{u}}_x}} \right|} }} + {\lambda _e}(O)} }} $ | (9) |
对上式进行迭代,直到获得满意的修复效果。
2 基于G-L分数阶微分的TV修复模型
2.1 分数阶TV模型
分数阶微分的TV模型为如下形式[8]
$ {J_\lambda }(\mathit{\boldsymbol{u}}) = \int\limits_{\mathit{\boldsymbol{E}} \cup \mathit{\boldsymbol{D}}} {\left| {{\nabla ^\alpha }\mathit{\boldsymbol{u}}} \right|{\rm{d}}x{\rm{d}}y} + \frac{\lambda }{2}\int_\mathit{\boldsymbol{E}} {{{\left| {\mathit{\boldsymbol{u}} - {\mathit{\boldsymbol{u}}^0}} \right|}^2}} {\rm{d}}x{\rm{d}}y $ | (10) |
式中,
$ -\operatorname{div}\left(\frac{\nabla^{\alpha} \boldsymbol{u}}{\left|\nabla^{\alpha} \boldsymbol{u}\right|}\right)+\lambda_{e}\left(\boldsymbol{u}-\boldsymbol{u}^{0}\right)=0 $ | (11) |
同式(7),化简得到最终的表达式为
$ {\mathit{\boldsymbol{u}}_O} = \frac{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{{{\mathit{\boldsymbol{u}}_X}}}{{\sqrt {\left| {{\nabla ^\alpha }{\mathit{\boldsymbol{u}}_x}} \right|} }} + {\lambda _e}(O)\mathit{\boldsymbol{u}}_O^0} }}{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{1}{{\sqrt {\left| {{\nabla ^a}{\mathit{\boldsymbol{u}}_x}} \right|} }} + {\lambda _e}(O)} }} $ | (12) |
2.2 改进的分数阶TV模型
基于TV模型的图像修复会导致纹理过度平滑,文献[8]将G-L分数阶微分引入TV修复模型中,该方法较好地解决了过度平滑的问题。但是该方法对具有弱导数性质的纹理细节等信息的保持仍不够理想,并且在模型最小化过程中导致了计算困难,其主要原因是正则项和数据项在零点处不可微。针对该问题,本文在模型的求解过程中,引入一个极小值,即在式(11)的正则项的分母中增加一个极小值
$ -\operatorname{div}\left(\frac{\nabla^{\alpha} \boldsymbol{u}}{\left|\nabla^{\alpha} \boldsymbol{u}\right|+p}\right)+\lambda_{e}\left(\boldsymbol{u}-\boldsymbol{u}^{0}\right)=0 $ | (13) |
同式(7),进行化简得到如下表达式
$ {\mathit{\boldsymbol{u}}_O} = \frac{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{{{\mathit{\boldsymbol{u}}_X}}}{{\sqrt {\left| {{\nabla ^\alpha }{\mathit{\boldsymbol{u}}_x}} \right| + {p^2}} }} + {\lambda _e}(O)\mathit{\boldsymbol{u}}_O^0} }}{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{1}{{\sqrt {\left| {{\nabla ^a}{\mathit{\boldsymbol{u}}_x}} \right| + {p^2}} }} + {\lambda _e}(O)} }} $ | (14) |
式中,参数
2.3 局部纹理方向的确定
文献[8]在修复过程中没有充分利用已知区域的纹理先验信息,本文根据图像已知区域的先验来确定待修复区域的纹理方向,从而在图像修复过程中更好地保持了图像中的纹理细节和弱边缘信息。
待修复区域内部可以通过待修复区域的外围区域信息来获取尽可能近似的局部纹理方向。
$ \mathit{\boldsymbol{V}} = \left\{ {\begin{array}{*{20}{l}} {\left( {{i_1} + k,{j_1} + h} \right),\left( {{i_2} + k,{j_2} + h} \right) \in \mathit{\boldsymbol{S}}}\\ {(k,h) \in [ - 1,1] \times [ - 1,1]} \end{array}} \right\} $ | (15) |
若平均差
$ M_{\text{mad}}=\frac{1}{|\boldsymbol{V}|}\left\{\sum\limits_{(k, h) \in \boldsymbol{V}}\left|I\left(i_{1}+k, j_{1}+h\right)-I\left(i_{2}+k, j_{2}+h\right)\right|\right\} $ |
小于给定的阈值,则把
$ \mathit{\boldsymbol{\rho }} = \mathop {\arg \min }\limits_{\left( {{c_x},{c_y}} \right) \in \mathit{\boldsymbol{C}}} \frac{1}{{|\mathit{\boldsymbol{R}}|}}\sum\limits_{(u,v) \in \mathit{\boldsymbol{R}},\left( {{u^\prime },{v^\prime }} \right) \in \mathit{\boldsymbol{S}}} {\left| {I(u,v) - I\left( {{u^\prime },{v^\prime }} \right)} \right|} $ | (16) |
则将
1) 若关于方向
2) 若
2.4 实验参数的设置
本文实验中有3个参数
下面分析分数阶微分阶次
$ \begin{array}{*{20}{c}} {{D^\alpha }f(x)\mathop \Leftrightarrow \limits^{{\rm{FT}}} {{(DF)}^\alpha }(u) = {{(vu)}^\alpha }F(u) = {\hat h ^\alpha }(u)F(u)}\\ {{{\hat h}^\alpha }(u) = {{\hat b}^\alpha }(u){{\rm{e}}^{v{\theta ^\alpha }(u)}}} \end{array} $ | (17) |
式中,
从图 2可以看出,频率在0~1之间时,阶次越小的分数阶微分算子对幅值提升越快。当频率大于1时,阶次较小的分数阶微分算子对幅值提升变得缓慢,随着阶次变大,对中低频部分的幅值上升比较快。当阶次小于1时,可作为中低频增强释放和高频压缩的滤波器。而当阶次大于1时,可看做一个高通滤波器。在图像处理中,图像低频部分对应着图像的纹理信息以及图像的弱边缘,图像的轮廓和噪声对应着高频部分。
总之, 根据不同目标选取不同的阶次。分数阶微分的阶次越大,中频和高频的信号越能够被有效地增强。而在图像修复中,中低频对应图像破损或缺失的平滑部分,高频则对应着图像的边界部分。本文目标是解决边界没有得到充分扩散以及过度平滑的修复问题,因此需要保留边缘信息及纹理信息。从幅频特性曲线可以看出,当阶次在0~1之间时,信号可以得到有效增强,故本文的阶次建议取值0~1之间,经过后期的实验也证明了这一点。
2.5 算法步骤
1) 根据
2) 根据
$ \mathit{\boldsymbol{\rho }} = \mathop {\arg \min }\limits_{\left( {{c_x},{c_y}} \right) \in \mathit{\boldsymbol{C}}} \frac{1}{{|\mathit{\boldsymbol{R}}|}}\sum\limits_{\begin{array}{*{20}{c}} {(u,v) \in \mathit{\boldsymbol{R}}}\\ {\left( {{u^\prime },{v^\prime }} \right) \in \mathit{\boldsymbol{S}}} \end{array}} {\left| {I(u,v) - I\left( {{u^\prime },{v^\prime }} \right)} \right|} $ |
确定图像的纹理方向;
3) 为了增加模型的稳定性,根据式(7),在能量泛函的梯度下降方程引入极小值
$ - {\mathop{\rm div}\nolimits} \left( {\frac{{{\nabla ^\alpha }\mathit{\boldsymbol{u}}}}{{\sqrt {{{\left| {{\nabla ^\alpha }\mathit{\boldsymbol{u}}} \right|}^2} + {p^2}} }}} \right) $ |
4) 根据式(13)最终化简得到
$ {\mathit{\boldsymbol{u}}_O} = \frac{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{{{\mathit{\boldsymbol{u}}_X}}}{{\sqrt {\left| {{\nabla ^\alpha }{\mathit{\boldsymbol{u}}_x}} \right| + {p^2}} }} + {\lambda _e}(O)\mathit{\boldsymbol{u}}_O^0} }}{{\sum\limits_{\begin{array}{*{20}{c}} {X \in \mathit{\boldsymbol{B}}}\\ {x \in \mathit{\boldsymbol{B'}}} \end{array}} {\frac{1}{{\sqrt {\left| {{\nabla ^a}{\mathit{\boldsymbol{u}}_x}} \right| + {p^2}} }} + {\lambda _e}(O)} }} $ |
5) 根据经验取
3 实验结果与分析
实验所使用的计算机环境为:Intel Core i3-2130 CPU,3.40 GHz,内存4 GB,操作系统为64位Windows 7.0,程序使用R2014a版MATLAB实现。为验证本文算法对具有弱纹理、弱边缘特征的图像具有更好的修复性能,实验图像选择标准库中不同程度纹理信息的Barbara和Lena图像(如图 3所示)。为了提高效率,在原图像上的纹理部分截取部分(如图 3中的红色方框所示,截取后的图像如图 4 (a)和4 (d)所示),待修复图像为在截取的图像上进行人为破坏,如图 4 (b)和4 (e)所示。另外为了显示本文算法更具说服力,本文再选取具有代表性实验图像中的岩石图像(如图 3(c)所示)。为了提高效率,在原图像上的纹理部分截取一小部分(如图 3(c)中的红色方框所示,截取后的图像如图 4 (g)所示),待修复图像为在截取的图像上进行水印破坏,如图 4 (h)所示。本文从不同参数(阶次及模板大小)以及修复性能验证两个方面进行实验,并对实验结果进行分析和讨论。
为了证明本文方法的有效性,从定性和定量两个方面来评价修复效果。定性的评价即视觉效果,比较修复后的图像和原始图像的差异,通过二者差值图像黑色区域所占大小来评价,定量评价则通过修复后图像和原始图像的灰度均方误差MSE和峰值信噪比PSNR来评价。
灰度均方误差定义为
$ f_{\text{MSE}}=\frac{1}{m \times n} \sum\limits_{i, j}\left(I_{1}(i, j)-I(i, j)\right)^{2} $ | (18) |
峰值信噪比定义为
$ {f_{{\rm{PSWR}}}} = 10\lg \frac{{\mathop {\max }\limits_{1 \le i \le n,1 \le n} {{\left| {{I_1}(i,j)} \right|}^2}}}{{\frac{1}{{m \times n}}\sum\limits_{i = 1}^m {\sum\limits_{j = 1}^n {{{\left[ {{I_1}(i,j) - I(i,j)} \right]}^2}} } }} $ | (19) |
式中,
3.1 模板大小和分数阶阶次对修复效果的影响实验
本实验选用图 4(a)所示的Barbara作为参考图像进行实验,为了证明本文方法的有效性,对Barbara图像进行不同模板和不同阶次的取值,图 5是本文算法取不同阶次和3个不同模板宽度
表 1
灰度均方差(MSE)比较(Barbara图像)
Table 1
Gray-scale mean square error comparison (Barbara image)
k值 | 阶次 | |||||||||
α=0.1 | α=0.3 | α=0.5 | α=0.7 | α=0.9 | α=1.1 | α=1.3 | α=1.5 | α=1.7 | α=1.9 | |
1 | 0.445 2 | 0.446 0 | 0.446 2 | 0.445 8 | 0.447 2 | 0.447 4 | 0.447 8 | 0.447 4 | 0.447 0 | 0.448 5 |
2 | 0.445 4 | 0.445 8 | 0.446 2 | 0.446 4 | 0.447 2 | 0.447 4 | 0.447 6 | 0.447 4 | 0.448 3 | 0.449 1 |
3 | 0.445 4 | 0.445 8 | 0.446 0 | 0.446 6 | 0.447 2 | 0.447 4 | 0.447 6 | 0.447 6 | 0.448 9 | 0.449 1 |
注:加粗字体表示最优结果。 |
表 2
峰值信噪比(PSNR)比较(Barbara图像)
Table 2
Peak signal to noise ratio comparison (Barbara image)
/dB | ||||||||||
k值 | 阶次 | |||||||||
α=0.1 | α=0.3 | α=0.5 | α=0.7 | α=0.9 | α=1.1 | α=1.3 | α=1.5 | α=1.7 | α=1.9 | |
1 | 51.645 | 51.637 | 51.635 | 51.639 | 51.626 | 51.624 | 51.620 | 51.624 | 51.628 | 51.614 |
2 | 51.643 | 51.639 | 51.635 | 51.633 | 51.626 | 51.624 | 51.622 | 51.624 | 51.616 | 51.608 |
3 | 51.643 | 51.639 | 51.637 | 51.631 | 51.626 | 51.624 | 51.622 | 51.622 | 51.610 | 51.608 |
注:加粗字体表示最优结果。 |
表 1为不同模板和不同阶次之间MSE的实验结果,表 2为不同模板和不同阶次之间峰值信噪比的实验数据。从表中可以看出,MSE最小值不在阶次
本实验选用图 4(d)所示的Lena图像重复进行上述实验,实验结果如图 8、表 3和表 4所示。
表 3
灰度均方差(MSE)比较(Lena图像)
Table 3
Gray-scale mean square error comperison (Lena image)
k值 | 阶次 | |||||||||
α=0.1 | α=0.3 | α=0.5 | α=0.7 | α=0.9 | α=1.1 | α=1.3 | α=1.5 | α=1.7 | α=1.9 | |
1 | 0.044 5 | 0.044 5 | 0.044 1 | 0.042 0 | 0.037 2 | 0.037 2 | 0.038 8 | 0.039 0 | 0.037 6 | 0.037 8 |
2 | 0.044 5 | 0.044 5 | 0.043 9 | 0.040 4 | 0.036 7 | 0.037 2 | 0.037 4 | 0.037 4 | 0.036 9 | 0.037 6 |
3 | 0.044 5 | 0.044 5 | 0.043 7 | 0.040 2 | 0.036 9 | 0.036 9 | 0.037 2 | 0.036 9 | 0.036 9 | 0.037 6 |
注:加粗字体表示最优结果。 |
表 4
峰值信噪比(PSNR)比较(Lena图像)
Table 4
Peak signal to noise ratio comparison (Lena image)
/dB | ||||||||||
k值 | 阶次 | |||||||||
α=0.1 | α=0.3 | α=0.5 | α=0.7 | α=0.9 | α=1.1 | α=1.3 | α=1.5 | α=1.7 | α=1.9 | |
1 | 61.647 | 61.647 | 61.687 | 61.893 | 62.431 | 62.431 | 62.244 | 62.222 | 62.384 | 62.360 |
2 | 61.647 | 61.647 | 61.708 | 62.065 | 62.479 | 62.431 | 62.407 | 62.407 | 62.455 | 62.384 |
3 | 61.647 | 61.647 | 61.728 | 62.087 | 62.455 | 62.455 | 62.431 | 62.455 | 62.455 | 62.384 |
注:加粗字体表示最优结果。 |
表 3为不同模板和不同阶次之间均方差的实验数据,表 4为不同模板和不同阶次之间峰值信噪比的实验数据。从表中可以看出,MSE最小值不在阶次
经过多次实验,Lena图像的纹理方向为(-1, 1)时修复效果最好。为了得到最佳的阶次,根据灰度均方误差和峰值信噪比来分析参数
本文第3次实验选用图 4(g)所示的岩石图像重复上述实验,原理同上。经过多次实验表明:当
本文实验选取了不同程度的3种不同纹理图片,实验结果显示不同纹理最佳模板和阶次不一样。Barbara图像的纹理比较丰富,Lena图像的纹理较弱,岩石图像的纹理也比较丰富。
通过实验可知,Barbara图像在分数阶阶次
3.2 修复性能验证
为了验证本文算法修复性能,选取了3幅存在不同程度的弱边缘和弱纹理的图像进行实验。将本文算法分别与TV模型、文献[2]算法、文献[8]算法进行对比,并分别进行定性和定量分析。
本次实验仍选用Barbara图像、Lena图像和岩石图像进行实验,如图 11、图 12和图 13所示。由上节实验可知,对于Barbara图像,模板大小为3×3,阶次为0.1时,修复效果最佳;对于Lena图像,模板大小为5×5,阶次为0.9时,修复效果最佳;对于岩石图像,模板大小为3×3,阶次为0.1时,修复效果最佳,本节实验即采用该参数值。图 4(a)-(c)、图 4(d)-(f)以及图 4(g)-(i)分别是参考图像、待修复图像以及掩码图像,图 11(a)-(d)分别是用TV模型、文献[2]算法、文献[8]算法和本文算法的修复结果图像以及差值图像。通过比较可以发现,本文算法的差值图像白色区域最少,这表明本文算法相比其他算法具有更好的修复效果。为了方便观察,TV算法、文献[2]算法、文献[8]算法和本文算法下修复前和修复后的MSE值和PSNR值如表 5和表 6所示。
表 5
灰度均方差(MSE)比较
Table 5
Gray-scale mean square error comparison
表 6
峰值信噪比(PSNR)比较
Table 6
Peak signal to noise ratio comparison
从表 5和表 6中可以看出,本文算法对3幅破损图像均能得到较好的修复效果。原有的TV模型在图像修复时会导致纹理过度平滑,文献[8]算法加入了分数阶可以很好地保持图像的纹理信息,但并没有充分利用纹理的边缘信息。本文在求解梯度时引入极小化参数来增加模型的稳定性,并且根据已知修复区域的先验来确定纹理的修复方向,可以充分利用纹理的边缘信息。实验结果表明,本文修复效果比其他比较方法更好。此外本文选择的Barbara图像和岩石图像纹理明显比Lena图像的纹理要丰富,但是从实验结果可以看出,对于Lena图像修复的效果比Barbara和岩石修复的效果要好得多。故可以得出如下结论:对于纹理越丰富的弱图像,本文修复效果越佳;对于弱纹理的图像,本文修复效果更佳。
4 结论
将G-L分数阶微分引入到TV模型中,一方面在TV模型求解梯度时引入极小化参数,解决了正则项和数据项在零点处不可微的问题,增加了模型的稳定性,从而可以有效地保持纹理区域的弱导数特性;另一方面在修复过程中根据图像已知区域的先验来确定待修复区域的纹理方向,充分利用了图像中的纹理细节和弱边缘信息,从而提高了修复的精度。此外,通过实验给出了修复效果和阶次
但是不同图像修复的最佳阶次需要不断测试,因而是比较耗时和费力的。今后可以研究自适应G-L分数阶TV的图像修复算法。此外本文的分数微分掩模是2维的,要完成3维图像的修复, 还需将其扩展到3维空间。
参考文献
-
[1] Bertalmio M, Sapiro G, Caselles V, et al. Image inpainting[C]//Proceedings of the 27th Annual Conference on Computer Graphics and Interactive Techniques. New York, USA: ACM, 2000: 417-424.[DOI:10.1145/344779.344972]
-
[2] Criminisi A, Perez P, Toyama K. Object removal by exemplar-based inpainting[C]//Proceedings of 2003 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Madison, WI, USA: IEEE, 2003: 721-728.[DOI:10.1109/CVPR.2003.1211538]
-
[3] Zhang Y. When is missing data recoverable?[R]. Houston, TX: Rice University, 2006.
-
[4] Zhang G M, Sun X X, Liu J X. Fractional total variation denoising model based on adaptive projection algorithm[J]. Pattern Recognition and Artificial Intelligence, 2016, 29(11): 1009–1018. [张桂梅, 孙晓旭, 刘建新. 基于自适应投影算法的分数阶全变分去噪模型[J]. 模式识别与人工智能, 2016, 29(11): 1009–1018. ] [DOI:10.16451/j.cnki.issn1003-6059.201611006]
-
[5] Yang Z Z, Zhou J L, Yan X Y, et al. Image enhancement based on fractional differentials[J]. Journal of Computer-Aided Design & Computer Graphics, 2008, 20(3): 343–348. [杨柱中, 周激流, 晏祥玉, 等. 基于分数阶微分的图像增强[J]. 计算机辅助设计与图形学学报, 2008, 20(3): 343–348. ]
-
[6] Zhang G M, Sun X X, Liu J X, et al. Research on TV-L1 optical flow model for image registration based on fractional-order differentiation[J]. Acta Automatica Sinica, 2017, 43(12): 2213–2224. [张桂梅, 孙晓旭, 刘建新, 等. 基于分数阶微分的TV-L1光流模型的图像配准方法研究[J]. 自动化学报, 2017, 43(12): 2213–2224. ] [DOI:10.16383/j.aas.2017.c160367]
-
[7] Zhang G M, Sun X X, Chen B B, et al. Edge detection algorithm combining fractional order derivative and Canny operator[J]. Journal of Image and Graphics, 2016, 21(8): 1028–1038. [张桂梅, 孙晓旭, 陈彬彬, 等. 结合分数阶微分和Canny算子的边缘检测[J]. 中国图象图形学报, 2016, 21(8): 1028–1038. ] [DOI:10.11834/jig.20160807]
-
[8] Zhang Y, Pu Y F, Hu J R, et al. A class of fractional-order variational image inpainting models[J]. Applied Mathematics & Information Sciences, 2012, 6(2): 299–306.
-
[9] Chan T F, Shen J H. Mathematical models for local nontexture inpaintings[J]. SIAM Journal on Applied Mathematics, 2002, 62(3): 1019–1043. [DOI:10.1137/S0036139900368844]
-
[10] Telea A. An image inpainting technique based on the fast marching method[J]. Journal of Graphics Tools, 2004, 9(1): 23–34. [DOI:10.1080/10867651.2004.10487596]
-
[11] Li K Y, Sun Y G. Fast image inpainting algorithm introducing continuous strength and confidence factor[J]. Journal of Image and Graphics, 2012, 17(4): 465–470. [李开宇, 孙玉刚. 引入连续性强度和置信度因子的快速图像修复[J]. 中国图象图形学报, 2012, 17(4): 465–470. ] [DOI:10.11834/jig.20120403]
-
[12] Cafagna D. Fractional calculus:a mathematical tool from the past for present engineers[J]. IEEE Industrial Electronics Magazine, 2007, 1(2): 35–40. [DOI:10.1109/MIE.2007.901479]
-
[13] Zhu Y G, Zhang G M. Fractional total variation denoising algorithm based on an adaptive residual image[J]. Journal of Image and Graphics, 2017, 22(12): 1677–1689. [祝严刚, 张桂梅. 自适应残差图像的分数阶全变分去噪算法[J]. 中国图象图形学报, 2017, 22(12): 1677–1689. ] [DOI:10.11834/jig.170198]
-
[14] Shao X X, Guo S X, Wang L. Image mosaic algorithm based on extended phase correlation of edge[J]. Journal of Jilin University, 2010, 28(01).
-
[15] Zhang C Y, Zhao Y, Chen H X. Registration of depth and video data based on edge detection[J]. Journal of Jilin University(Information Science Edition), 2011, 58(3): 587–593. [DOI:10.1007/s10971-011-2431-x]