RecDiffusion: Rectangling for Image Stitching with Diffusion Models
Tianhao Zhou, Haipeng Li, Ziyi Wang, Ao Luo, Chen-Lin Zhang, Jiajun Li, Bing Zeng, Shuaicheng Liu
TL;DR
RecDiffusion tackles the problem of irregular boundaries in stitched images by introducing a two-stage diffusion framework. It first uses a Motion Diffusion Model ($MDM$) to generate rectangling motion fields and warp the stitched image, then employs a Content Diffusion Model ($CDM$) to refine the content, guided by a weighted confidence map derived from a Rank-Nullity-inspired sampling strategy. The approach achieves state-of-the-art quantitative and qualitative results on public benchmarks, outperforming cropping, inpainting, and warping-based methods while preserving content integrity. The method offers robust rectangling with geometric accuracy and visual appeal, and the public release of code and weights facilitates application to related motion-rectangling tasks.
Abstract
Image stitching from different captures often results in non-rectangular boundaries, which is often considered unappealing. To solve non-rectangular boundaries, current solutions involve cropping, which discards image content, inpainting, which can introduce unrelated content, or warping, which can distort non-linear features and introduce artifacts. To overcome these issues, we introduce a novel diffusion-based learning framework, \textbf{RecDiffusion}, for image stitching rectangling. This framework combines Motion Diffusion Models (MDM) to generate motion fields, effectively transitioning from the stitched image's irregular borders to a geometrically corrected intermediary. Followed by Content Diffusion Models (CDM) for image detail refinement. Notably, our sampling process utilizes a weighted map to identify regions needing correction during each iteration of CDM. Our RecDiffusion ensures geometric accuracy and overall visual appeal, surpassing all previous methods in both quantitative and qualitative measures when evaluated on public benchmarks. Code is released at https://github.com/lhaippp/RecDiffusion.
