Journal of Computer Applications ›› 2018, Vol. 38 ›› Issue (2): 533-538.DOI: 10.11772/j.issn.1001-9081.2017071898

Previous Articles     Next Articles

Image inpainting algorithm based on priori constraints and statistics

CAO Daming1, ZHAI Donghai1,2, MENG Hongyue1, LI Mengxue1, FENG Yan2   

  1. 1. School of Information Science and Technology, Southwest Jiaotong University, Chengdu Sichuan 610031, China;
    2. School of Engineering, Tibet University, Lhasa Tibet 850000, China
  • Received:2017-08-04 Revised:2017-09-21 Online:2018-02-10 Published:2018-02-10
  • Supported by:
    This work is partially supported by the National Natural Science Foundation of China (61461048, 61661047), the Young Teachers Innovative Support Program of Tibet (QCZ2016-02).

基于先验约束和统计的图像修复算法

曹大命1, 翟东海1,2, 孟红月1, 李梦雪1, 冯炎2   

  1. 1. 西南交通大学 信息科学与技术学院, 成都 610031;
    2. 西藏大学 工学院, 拉萨 850000
  • 通讯作者: 曹大命
  • 作者简介:曹大命(1990-),男,河北沧州人,硕士研究生,主要研究方向:数字图像处理;翟东海(1974-),男,山西芮城人,副教授,博士研究生,主要研究方向:数字图像处理、海量数据挖掘;孟红月(1993-),女,河南永城人,硕士研究生,主要研究方向:数字图像处理;李梦雪(1992-),女,重庆潼南人,硕士研究生,主要研究方向:数字图像处理;冯炎(1979-),男,山西吕梁人,副教授,硕士,主要研究方向:信号与信息处理、数字图像处理。
  • 基金资助:
    国家自然科学基金资助项目(61461048,61661047);西藏自治区高校青年教师创新支持计划项目(QCZ2016-02)。

Abstract: When inpainting the image of large damaged region with complex geometric structure and rich texture, the PatchMatch-based image inpainting algorithm has disadvantages like texture extension and some incorrect sample patches being selected as candidate patches. To solve these problems, a new image inpainting algorithm was proposed for improving accuracy and efficiency. In terms of exact matching of sample patches, an image was preprocessed to obtain priori information of the image, which was used to initialize the constraint of the offset map, while PathMatch algorithm used global random initialization. In the process of pixel patch matching, to improve the matching accuracy of the sample, mean method and angle method were introduced to compute the similarity of different categories of pixel patches. In terms of efficiency, according to the statistical characteristics of similar patches of an image, histogram statistical method was introduced to reduce the labels for inpainting. The proposed algorithm was verified by some instances. The simulation results show that compared with the original PatchMatch algorithm, the Peak Signal-to-Noise Ratio (PSNR) of the proposed algorithm was improved by 0.5dB to 1dB, and the running time was reduced by 5s to 10s, which indicates that the proposed algorithm can effectively improve the accuracy and efficiency of image inpainting.

Key words: image inpainting, statistical characteristic, constraint initialization, angle method, mean method

摘要: 利用基于块匹配(PatchMatch)图像修复算法对破损区域较大且周围既含有几何结构信息又含有丰富纹理信息的图片进行修复时,容易出现纹理延伸现象以及样本块误匹配问题。针对此类问题,在样本块的精确匹配和算法的时效性两个方面进行改进,提出新的图像修复算法。在样本块精确匹配方面,改进算法对图像进行预处理以获得图像的先验信息,并利用先验信息约束算法偏移映射图的初始化,从而转变PatchMatch算法中对图像偏移映射图的全局随机初始化为在先验信息指导下的约束初始化;在像素块匹配过程中,利用均值法和夹角法来判断不同类别像素块的相似度,从而提高样本块的匹配精度。在算法的时效性方面,根据图像相似块的统计性特性,引入直方图统计的方法来减少最终用于修复的样本标签,提高改进算法的时效性。最后,将改进算法用于实例验证,相比原算法,改进算法的运行时间减少了5~10 s,峰值信噪比(PSNR)提高了0.5~1 dB。实例验证结果表明改进算法不但可以有效地提高图像修复的精度,而且提高了图像修复的效率。

关键词: 图像修复, 统计特性, 约束初始化, 夹角法, 均值法

CLC Number: