作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2026, Vol. 52 ›› Issue (10): 177-187. doi: 10.19678/j.issn.1000-3428.0252645

• 计算机视觉与图形图像处理 • 上一篇    

基于可变形草图引导的图像修复方法

杨红菊, 刘娜, 李尧, 曹付元   

  1. 山西大学计算机与信息技术学院, 山西 太原 030006
  • 收稿日期:2025-06-19 修回日期:2025-08-29 发布日期:2025-10-16
  • 作者简介:杨红菊(CCF专业会员),女,副教授、博士,主研方向为计算机视觉,E-mail:yhju@sxu.edu.cn;刘娜,硕士;李尧,讲师、博士;曹付元,教授、博士。
  • 基金资助:
    国家自然科学基金重点项目(U24A20323);国家自然科学基金(62376145);山西省教育厅省筹回国留学科研项目(2022-008);山西省科技厅基础研究计划(202303021211024)。

Deformable Sketch-Guided Image Inpainting Method

YANG Hongju, LIU Na, LI Yao, CAO Fuyuan   

  1. School of Computer and Information Technology, Shanxi University, Taiyuan 030006, Shanxi, China
  • Received:2025-06-19 Revised:2025-08-29 Published:2025-10-16

摘要: 草图引导的图像修复技术在照片修复、创意编辑等领域具有重要的应用价值,但面临用户草图数据稀缺与几何偏差导致的修复失真双重挑战。现有方法依赖边缘检测生成伪草图,但忽略用户手绘偏差(如手抖、笔触断裂),导致在复杂场景下结构错位与细节模糊。针对上述挑战,提出一种联合可变形草图生成网络(DSN)与双阶段引导修复的创新框架。首先构建可变形草图生成网络,通过建模典型手绘偏差,生成具有真实几何变形特征的大规模草图-图像配对数据集,有效缓解数据稀缺问题;其次设计两阶段修复框架,第一阶段针对用户输入草图进行几何失准校正与结构断裂修复,实现草图优化,第二阶段将优化后的草图信息有效融入修复网络,实现全局结构约束与局部纹理生成的协同优化。在基准数据集上的实验验证了该方法的有效性,实验结果表明,在CelebA-HQ数据集上,该方法的峰值信噪比(PSNR)为25.78 dB,结构相似性(SSIM)为0.852,该方法有效解决了用户草图数据稀缺与几何偏差问题,显著提升了草图引导图像修复在结构准确性和感知质量方面的性能。

关键词: 可变形草图生成网络, 双阶段协同优化, 图像修复, 对抗生成网络, 草图-图像对生成

Abstract: Sketch-guided image inpainting has significant application value in photo restoration and creative editing. However, it faces the dual challenges of scarce user sketch data and restoration distortions caused by geometric deviations. Existing methods rely on edge detection to generate pseudo-sketches while neglecting user-drawn deviations (e.g., hand tremors and stroke breaks), leading to structural misalignment and detail blurring in complex scenes. To address these challenges, this study proposes an innovative framework that combines a Deformable Sketch generation Network (DSN) with dual-stage-guided inpainting. First, a DSN is constructed to model typical hand-drawn deviations, generating a large-scale sketch-image paired dataset with realistic geometric deformation features and effectively alleviating data scarcity. Second, a two-stage inpainting framework is designed: the first stage corrects geometric misalignment and repairs structural breaks in input sketches to optimize the sketches, whereas the second stage effectively integrates the optimized sketch information into the inpainting network to achieve collaborative optimization of global structural constraints and local texture generation. Experiments on benchmark datasets validate the effectiveness of the method, achieving a Peak Signal-to-Noise Ratio (PSNR) of 25.78 dB and Structural Similarity Index Metric (SSIM) of 0.852 on the CelebA-HQ dataset. The results demonstrate that this method effectively addresses the challenges of scarce user sketch data and geometric deviations while significantly improving the structural accuracy and perceptual quality of sketch-guided image inpainting.

Key words: Deformable Sketch generation Network (DSN), dual-stage collaborative optimization, image inpainting, Generative Adversarial Network (GAN), sketch-image paired synthesis

中图分类号: