基于样本块的Criminisi图像修复算法在搜索匹配块时,使用全局搜索并用均方误差(sumofsquareddifferences)来衡量样本块差异。该方法存在搜索范围过大,效率较低,仅考虑颜色的差异,容易导致修复结果边界错位等不足,本文提出了一种基于区域分割和均方误差改进的图像修复算法。为了提高样本块匹配速度,先采用区域分割法分割整个图像区域,使待修复样本块只在对应区域内搜索。在比较样本块差异时,本文算法对颜色差异、纹理差异、曲线特征差异进行了加权综合,从而保证了修复后图像在颜色和纹理上均与已知区域保持一致,解决了Criminisi算法效率低且容易出错等问题。实验结果表明本文算法修复结果在执行效率、视觉效果上要比Criminisi算法好。
Image inpainting is one of important and challenging research topics in computer graphics, video processing, and computer vision. It provides a strong tool for the reuse of captured images and photos. It also shows extensive applications in cultural heritage protection, special visual effects, image and video editing and virtual reality. The traditional Criminisi based patch image completion algorithms only consider the intensity difference when computing the difference within patches and search the most similar exemplar patches in the source region of image, the computation is too large. A new difference measure for completion is presented. This measure considers the intensity difference, texture difference and curve difference when computing the difference within patches. It successfully overcomes the drawbacks the general intensity difference method has, ensuring the content continuity within the textures and retaining perceptual coherence in synthesized texture and inpainted image. The experiment shows the result inpainted images using our algorithm are better than Criminisi algorithm, and the repair time also has a considerable decrease.