Image retargeting is the task of adjusting the aspect ratio of images to suit different display devices or presentation environments. However, existing retargeting methods often struggle to balance the preservation of key semantics and image quality, resulting in either deformation or loss of important objects, or the introduction of local artifacts such as discontinuous pixels and inconsistent regenerated content. To address these issues, we propose a content-aware retargeting method called PruneRepaint. It incorporates semantic importance for each pixel to guide the identification of regions that need to be pruned or preserved in order to maintain key semantics. Additionally, we introduce an adaptive repainting module that selects image regions for repainting based on the distribution of pruned pixels and the proportion between foreground size and target aspect ratio, thus achieving local smoothness after pruning. By focusing on the content and structure of the foreground, our PruneRepaint approach adaptively avoids key content loss and deformation, while effectively mitigating artifacts with local repainting. We conduct experiments on the public RetargetMe benchmark and demonstrate through objective experimental results and subjective user studies that our method outperforms previous approaches in terms of preserving semantics and aesthetics, as well as better generalization across diverse aspect ratios. Codes will be available at https://github.com/fhshen2022/PruneRepaint.
翻译:图像重定向旨在调整图像的宽高比以适应不同显示设备或呈现环境的需求。然而,现有重定向方法往往难以在保持关键语义与图像质量之间取得平衡,导致图像出现形变或重要物体丢失,亦或引入局部伪影,如像素不连续与再生内容不一致等问题。为解决这些挑战,本文提出一种名为PruneRepaint的内容感知重定向方法。该方法通过引入像素级语义重要性来指导识别需要剪裁或保留的区域,从而维护关键语义。此外,我们设计了一种自适应重绘模块,该模块基于剪裁像素的分布以及前景尺寸与目标宽高比之间的比例关系,选择图像区域进行重绘,以此实现剪裁后的局部平滑过渡。通过聚焦于前景的内容与结构,我们的PruneRepaint方法能够自适应地避免关键内容丢失与形变,同时借助局部重绘有效抑制伪影。我们在公开基准数据集RetargetMe上进行了实验,并通过客观实验结果与主观用户研究表明,本方法在语义保持度、美学质量以及跨不同宽高比的泛化能力方面均优于现有方法。代码将在https://github.com/fhshen2022/PruneRepaint公开。