SemanticStitch: Enhancing Image Coherence through Foreground-Aware Seam Carving

Ji-Ping Jin, Chen-Bin Feng, Rui Fan, Chi-Man Vong · DOI

Introduction

Image stitching is a fundamental task in computer vision, yet it frequently suffers from visual artifacts when seams intersect prominent foreground objects. Traditional algorithms, such as Graph Cut or Dynamic Programming, typically optimize for pixel-level color or gradient consistency. However, these methods are content-agnostic; they do not distinguish between background textures and critical semantic entities like people or vehicles. Consequently, moving objects in overlapping regions are often "ghosted" or truncated, severely degrading the perceptual quality of the resulting panorama.

A traditional seam cutting through a foreground object, causing visual artifacts.

Methodology

To address these challenges, we introduce SemanticStitch, a deep learning framework designed to prioritize semantic integrity during the stitching process. The pipeline consists of three primary stages:

  1. Image Alignment: A ResNet50-based module predicts the homography required to warp input images into a shared coordinate system.
  2. Salient Object Detection: We utilize SelfReformer, a Transformer-based network, to generate high-fidelity semantic masks for foreground objects.
  3. Object-Aware Seam Identification: A U-Net architecture integrates the warped images and semantic masks to determine an optimal seam path that avoids bisecting foreground entities.

Composite Coverage Loss

The technical core of SemanticStitch is the Composite Coverage Loss. This novel objective function includes an area-based dynamic mask optimization, which identifies the image providing superior coverage of a specific object and constrains the seam to include that object in its entirety from a single source. Additionally, an exclusivity loss prevents secondary masks from introducing blur, while a smoothness loss ensures natural transitions across the seam.

SemanticStitch uses salient object detection to guide the seam around foreground objects, preserving their integrity.

Experimental Setup and Datasets

The model was trained on the UDIS-D dataset and evaluated using two specialized benchmarks:

  • DAVISProcessed10: 1,770 image pairs from the DAVIS dataset, curated to test dynamic object scenarios.
  • RealWorld400: A new dataset comprising 400 diverse real-world pairs with manually refined foreground labels, serving as a rigorous test for object-preserving stitching.

Results and Discussion

SemanticStitch demonstrates significant improvements over both traditional (e.g., Voronoi, Graph Cut) and state-of-the-art deep learning models (e.g., UDIS++). Quantitative evaluations using NIQE, BRISQUE, and PSQ metrics confirm superior spatial quality and perceptual coherence.

Furthermore, the framework is highly efficient. By incorporating FastViT-inspired components, SemanticStitch operates at 10.77 GFLOPs, a nearly eight-fold reduction in computational cost compared to UDIS++ (80.46 GFLOPs). This efficiency makes the model suitable for deployment on mobile and edge devices. User studies involving 50 participants further validate these findings, with SemanticStitch receiving the highest scores for overall visual quality and object integrity.

Conclusion and Future Work

While SemanticStitch effectively preserves foreground objects, minor segmentation artifacts or "halos" can occasionally appear at the mask boundaries. Future research will focus on refining boundary-aware blending mechanisms to further minimize these transitions. Nonetheless, by shifting the focus from low-level gradients to high-level semantics, SemanticStitch represents a major step forward in creating seamless, perceptually accurate image panoramas.

Summary updated

BibTeX
@article{jin2026semanticstitch,
  author = {Ji-Ping Jin and Chen-Bin Feng and Rui Fan and Chi-Man Vong},
  title = {{SemanticStitch: Enhancing Image Coherence through Foreground-Aware Seam Carving}},
  journal = {The Visual Computer},
  year = {2026},
  doi = {10.1007/s00371-025-04222-y},
}
Figure