Abstract
Image stitching algorithms often struggle with geometric distortion, warping prominent objects like buildings to achieve pixel-perfect alignment. This paper introduces OBJ-GSP, a novel stitching method that leverages the Segment Anything Model (SAM) to identify whole objects and uses triangular meshes to preserve their structural integrity during the warp. The authors also introduce StitchBench, the most comprehensive image stitching benchmark to date.
Introduction
Image stitching combines multiple overlapping photos into a single panorama. While modern grid-based methods (like APAP or GSP) are excellent at aligning overlapping pixels, they often do so at the cost of the image's natural geometry—resulting in unnaturally stretched, bent, or distorted buildings and objects.
Recent attempts to fix this distortion have relied on extracting and preserving straight lines (e.g., GES-GSP). However, line-based methods fail if a scene lacks clear straight lines, contains curved structures, or has too many noisy, chaotic lines that mislead the algorithm. Furthermore, stitching low-altitude drone imagery is notoriously difficult because the camera moves significantly and the depth variance between tall roofs and the ground violates standard stitching assumptions. This paper addresses the need for a stitching method that understands and preserves the overall shape of objects, rather than just isolated lines or pixels.
Methodology
The authors build upon traditional grid-based image stitching, which typically minimizes an energy function balancing pixel alignment, local similarity, and global similarity. The novel contribution is the addition of an Object-level shape preservation term.
The pipeline consists of four main stages:
- Semantic Segmentation: Instead of traditional edge detectors, the authors use foundation models like SAM (Segment Anything Model) to extract the cohesive contours of objects in the scene.
- Triangular Meshing: For each segmented object, the algorithm finds the object's center and connects it to sampling points along the semantic boundary, creating a simplified triangular mesh.
- Shape-Preserving Warp: During the stitching optimization, the algorithm forces these specific object triangles to undergo similarity transformations (which preserve shape and proportions) rather than arbitrary projective transformations.
- Aerial Orthorectification: For low-altitude drone shots, the method uses segmentation to separate roofs from walls, masks out the walls, and orthographically projects the roofs to the ground plane before stitching.
StitchBench: A New Benchmark
To rigorously test their method, the authors compiled StitchBench, currently the largest and most diverse image stitching benchmark available.
- Existing Data: It unifies 122 image pairs from 12 previous state-of-the-art works (including AANAP, APAP, CAVE, DFW, DHW, GES-GSP, LPC, SEAGULL, REW, SVA, and SPHP).
- New Data: The authors added 18 newly collected hand-held camera pairs (where object structure preservation is critical) and 7 sets of low-altitude drone urban scenes.
Experimental Results
OBJ-GSP outperforms both traditional state-of-the-art methods (like GSP and GES-GSP) and recent deep-learning approaches (like UDIS++).
Quantitative Analysis
Compared to the previous best method (GES-GSP), OBJ-GSP achieved a mean improvement of 3.5% in Mean Distorted Residuals (MDR) (indicating less distortion) and 3.8% in the Naturalness Image Quality Evaluator (NIQE) (indicating sharper, better-aligned images with less ghosting).
Qualitative Analysis
Visual comparisons clearly show OBJ-GSP eliminating the "bending building" effect seen in APAP, SPHP, and GSP. The stitched panoramas look significantly more natural to the human eye while maintaining crisp alignment in overlapping regions.
Conclusion
Treating objects as cohesive semantic entities is far more robust than relying on individual line segments. It prevents the algorithm from being confused by heavily textured areas and allows it to preserve curved or complex structures. Large segmentation models like SAM can reliably extract object contours in almost any scenario, providing a highly robust prior for geometric transformations.
The primary limitation of OBJ-GSP is its reliance on the underlying segmentation model. Ablation studies showed that using smaller, lightweight SAM backbones resulted in minor distortions compared to the heavy ViT-H model. As SAM-type foundation models inevitably become faster and more accurate, the quality and speed of the OBJ-GSP image stitching pipeline will naturally improve.
Summary updated