NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Numerical analysis of shell-based geometric image inpainting algorithms and their semi-implicit extension

L. Robert Hocking, Thomas Holding, Carola-Bibiane SchönliebarXiv 2017

Abstract

In this paper we study a class of fast geometric image inpainting methods based on the idea of filling the inpainting domain in successive shells from its boundary inwards. Image pixels are filled by assigning them a color equal to a weighted average of their already filled neighbors. However, there is flexibility in terms of the order in which pixels are filled, the weights used for averaging, and the neighborhood that is averaged over. Varying these degrees of freedom leads to different algorithms, and indeed the literature contains several methods falling into this general class. All of them are very fast, but at the same time all of them leave undesirable artifacts such as "kinking" (bending) or blurring of extrapolated isophotes. Our objective in this paper is to build a theoretical model, based on a continuum limit and a connection to stopped random walks, in order to understand why these artifacts occur and what, if anything, can be done about them. At the same time, we consider a semi-implicit extension in which pixels in a given shell are solved for simultaneously by solving a linear system. We prove (within the continuum limit) that this extension is able to completely eliminate kinking artifacts, which we also prove must always be present in the direct method. Although our analysis makes the strong assumption of a square inpainting domain, it makes weak smoothness assumptions and is thus applicable to the low regularity inherent in images.

Introduction

Image inpainting is the process of reconstructing missing or damaged parts of an image. While exemplar-based methods are often used for texture synthesis, geometric methods are preferred for maintaining structural lines and thin regions. The fastest class of geometric methods operates like an "onion skin," filling the hole in successive layers (shells) from the boundary inward.

Figure 1: Visual artifacts like kinking and blurring in shell-based inpainting.

Despite their speed, these methods suffer from two primary artifacts: kinking, where extrapolated lines bend unnaturally at shallow angles, and blurring, where sharp edges lose definition as they propagate deeper into the hole. This research provides a rigorous mathematical post-mortem of these artifacts, using synthetic benchmarks—such as dots, lines, and low-regularity Weierstrass functions—to explain why these "bugs" are fundamental to the algorithms' design.

Methodology: Direct vs. Semi-Implicit Methods

The paper analyzes a general class of shell-based algorithms, including well-known methods like Telea’s and Coherence Transport, and proposes a new Semi-Implicit Extension.

  • The Direct Method: In standard implementations, each pixel is calculated as a weighted average of its already-filled neighbors. This "backward-looking" approach restricts the algorithm's "vision" to a half-circle, which mathematically necessitates kinking at certain angles.
  • The Semi-Implicit Method: This proposed extension solves for all pixels in a given shell simultaneously by treating them as a linear system. By allowing pixels to "see" their neighbors within the same shell, the field of view expands to a full circle, allowing structural lines to propagate at any angle without bending.
Figure 5: The shell-based filling process where a pixel (red) is computed from its neighbors (green).

Theoretical Framework

The authors utilize two primary tools to model these algorithms:

  1. Fixed-Ratio Continuum Limit: By keeping the ratio between pixel size ($h$) and averaging radius ($\epsilon$) constant during scaling, the model captures real-world grid behaviors that previous models missed.
  2. Stopped Random Walks: The color of an inpainted pixel is proven to be equivalent to the expected value of a random walk starting at that pixel and stopping when it hits the known boundary. This connection reveals that blurring is essentially the "variance" of the walk; as the walk has more room to wander deeper in the hole, the blur increases.

Key Insights and Results

  • The Kinking-Blurring Trade-off: The research identifies a fundamental "uncertainty principle." Reducing kinking in direct methods requires a larger neighborhood, but a larger neighborhood increases the variance of the random walk, thereby increasing blur.
  • Artifact Elimination: The semi-implicit extension (implemented via Successive Over-Relaxation) is shown to be a "silver bullet" for kinking. It can recover lines at angles as shallow as 2°, whereas direct methods fail at 20°.
  • Convergence and Prediction: The authors prove that these algorithms converge to a specific transport equation even for non-smooth images. Furthermore, they provide a formula (Conjecture 1) that predicts the exact amount of blur at any given depth, accurate to within 1/255th of a color value.

Limitations and Future Work

While the semi-implicit method successfully eliminates kinking, it does not solve the problem of blurring; in fact, blur can increase at very shallow angles. The computational cost is also higher than the one-pass direct method, though still efficient. Future work aims to rigorously prove the blur formula (Conjecture 1) and seek a method that can simultaneously eliminate both kinking and blurring.

Summary updated

BibTeX
@misc{hocking2017numerical,
  author = {L. Robert Hocking and Thomas Holding and Carola-Bibiane Schönlieb},
  title = {{Numerical analysis of shell-based geometric image inpainting algorithms and their semi-implicit extension}},
  year = {2017},
  eprint = {1707.09713},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.09713},
}

Loading related content...

Figure