Content-Preserving Image Stitching with Regular Boundary Constraints

Yun Zhang, Yu-Kun Lai, Fang-Lue ZhangarXiv 2018

Abstract

This paper proposes an approach to content-preserving stitching of images with regular boundary constraints, which aims to stitch multiple images to generate a panoramic image with regular boundary. Existing methods treat image stitching and rectangling as two separate steps, which may result in suboptimal results as the stitching process is not aware of the further warping needs for rectangling. We address these limitations by formulating image stitching with regular boundaries in a unified optimization. Starting from the initial stitching results produced by traditional warping-based optimization, we obtain the irregular boundary from the warped meshes by polygon Boolean operations which robustly handle arbitrary mesh compositions, and by analyzing the irregular boundary construct a piecewise rectangular boundary. Based on this, we further incorporate straight line preserving and regular boundary constraints into the image stitching framework, and conduct iterative optimization to obtain an optimal piecewise rectangular boundary, thus can make the panoramic boundary as close as possible to a rectangle, while reducing unwanted distortions. We further extend our method to panoramic videos and selfie photography, by integrating the temporal coherence and portrait preservation into the optimization. Experiments show that our method efficiently produces visually pleasing panoramas with regular boundaries and unnoticeable distortions.

Introduction

Traditional panorama stitching often results in irregular, "jagged" boundaries. To fit these images into standard rectangular displays, users typically resort to cropping, which loses content; inpainting, which can introduce artifacts; or rectangling, which warps the image. Current rectangling methods often treat stitching and warping as separate, sequential steps. This decoupling can lead to suboptimal results, such as geometric distortions or "holes" at the edges where the mesh fails to cover the boundary. This paper introduces a unified optimization framework that addresses these issues by performing stitching and boundary regularization simultaneously.

Unified Optimization Framework

The core of the proposed method is a unified energy function that balances feature alignment, local shape preservation, and boundary constraints.

Mesh Union and Boundary Construction

Unlike previous methods that use a single mesh, this approach treats each input image as an independent mesh. Using polygon Boolean operations, the system identifies the exact union of these meshes to determine the true irregular boundary. To minimize distortion, the authors introduce the concept of a piecewise rectangular boundary. Instead of forcing a jagged edge into a strict rectangle, the algorithm allows for small "steps" that maintain a regular appearance while significantly reducing the required warping.

The unified optimization process: (c) initial mesh union, (d) piecewise rectangular boundary construction with 'steps', (e) warped mesh, and (f) final regularized panorama.

Energy Minimization

The optimization minimizes a quadratic energy function comprising several terms:

  • Alignment & Similarity: Ensures features match across images and maintains the natural look of the scene.
  • Boundary Constraints: Iteratively pushes the mesh edges toward the target piecewise rectangular boundary.
  • Line Preservation: Specifically protects straight-line structures (e.g., architectural elements) from warping artifacts.

Results and Key Insights

The method efficiently produces visually pleasing panoramas. On a standard laptop, a 5-image panorama can be processed in approximately 3.5 seconds. The optimization itself is efficient because all energy terms are quadratic, allowing it to be solved as a sparse linear system.

Detailed view of the stitching results, highlighting the preservation of straight lines and seamless alignment in complex regions.

Key Advantages

  • Anticipatory Warping: By integrating boundary constraints into the stitching phase, the stretching is distributed more gracefully across the entire image.
  • Piecewise Flexibility: The piecewise rectangular approach provides the mathematical flexibility needed to prevent "funhouse mirror" distortions.
  • Robustness: The use of Boolean operations allows the system to handle complex overlapping patterns and an arbitrary number of images.

Conclusion and Future Work

While the method excels at preserving content and boundaries, challenges remain in regions with extremely dense intersecting lines or strong geometric structures at mesh intersections. Future work will focus on incorporating semantic understanding and visual saliency to further refine the optimization, as well as extending the framework to handle the complex temporal coherence required for handheld video stitching.

Summary updated

BibTeX
@misc{zhang2018content,
  author = {Yun Zhang and Yu-Kun Lai and Fang-Lue Zhang},
  title = {{Content-Preserving Image Stitching with Regular Boundary Constraints}},
  year = {2018},
  eprint = {1810.11220},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.11220},
}
Figure