GeoFill: Reference-Based Image Inpainting of Scenes with Complex Geometry

Yunhan Zhao, Connelly Barnes, Yuqian Zhou, Eli Shechtman, Sohrab Amirghodsi, Charless C. Fowlkes

Introduction

Image inpainting traditionally relies on hallucinating missing pixels from surrounding context. While effective for small regions, this approach often fails for large holes or complex textures. Reference-based inpainting offers a solution by utilizing a secondary "source" image of the same scene. However, the core challenge is alignment: camera movement between shots introduces parallax, causing objects to shift at varying rates. Previous state-of-the-art methods, such as TransFill, assumed a "flat world" composed of a few homographies. GeoFill addresses these limitations by explicitly modeling the 3D geometry of the scene to ensure precise pixel alignment.

Methodology

The GeoFill pipeline transitions from 2D warping to a principled 3D reconstruction approach. The process involves four main stages:

  1. Initialization: Sparse matching points are identified between the target and reference images (using SIFT and OANet) to estimate an initial camera pose. A dense depth map for the reference image is predicted using a pretrained monocular depth model (DPT).
  2. Joint Optimization: Recognizing that initial estimates are often imperfect, GeoFill performs a joint optimization of the camera pose and the depth map's scale and offset. This differentiable 3D reprojection minimizes a combination of multiscale photometric loss, feature correspondence loss, and a negative depth penalty.
  3. Pixel Importance Weighting: Optimization is weighted to favor pixels near hole boundaries and high-gradient edges, where alignment errors are most perceptible.
  4. Mesh Rendering and Refinement: The reference image is treated as a textured 3D mesh and rendered from the target camera's perspective. A final "Color-Spatial Transformation" module corrects exposure or white balance mismatches before merging.
GeoFill Pipeline: The framework jointly optimizes depth and pose through a differentiable rendering loop to ensure precise alignment.

Experimental Results

GeoFill was evaluated on several challenging benchmarks, including RealEstate10K (indoor/outdoor walkthroughs) and MannequinChallenge (complex camera paths around static subjects).

Quantitative Performance

GeoFill consistently outperformed existing baselines such as TransFill, OPN, and ProFill. On the RealEstate10K dataset, GeoFill achieved a PSNR of 31.47, significantly higher than TransFill’s 30.64. The performance gap was even more pronounced in geometrically complex scenes.

Qualitative Comparison

Qualitative analysis demonstrates that GeoFill successfully fills holes in scenes where previous methods produce structural artifacts or ghosting. By leveraging a depth-based mesh rather than simple planes, the model handles arbitrary scene complexity with high fidelity.

Qualitative comparison: GeoFill provides a more geometrically consistent result compared to TransFill by leveraging 3D scene structure.

User Study

In a blind preference test, human users preferred GeoFill’s results over TransFill approximately 70% of the time and over single-image inpainting methods more than 95% of the time.

Conclusion and Future Work

GeoFill demonstrates that reference-based inpainting is fundamentally a 3D geometry problem. By refining initial depth and pose predictions through a differentiable rendering loop, the system corrects the "drift" that typically causes visual artifacts.

Current limitations include a high computational cost (approximately 58 seconds per image) and the assumption of a static scene. Future work will explore acceleration techniques and the incorporation of object masking to handle dynamic scenes.

Summary updated

BibTeX
@inproceedings{zhao2023geofill,
  author = {Yunhan Zhao and Connelly Barnes and Yuqian Zhou and Eli Shechtman and Sohrab Amirghodsi and Charless C. Fowlkes},
  title = {{GeoFill: Reference-Based Image Inpainting of Scenes with Complex Geometry}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=NuUQ6h9ErI},
}
Figure