Video Inpainting of Complex Scenes

Alasdair Newson, Andrés Almansa, Matthieu Fradet, Yann Gousseau, Patrick Pérez

Abstract

This paper introduces a fully automatic video inpainting algorithm designed to fill missing regions in complex video sequences, including those featuring dynamic textures and moving backgrounds. By extending the PatchMatch algorithm into the spatio-temporal domain and incorporating a novel texture feature pyramid, the proposed method achieves high-quality results while operating up to an order of magnitude faster than previous state-of-the-art techniques. Notably, the system eliminates the need for manual segmentation, making it a practical solution for high-resolution video editing.

Introduction

Video inpainting—the process of replacing occluded regions with visually natural content—is significantly more challenging than its image-based counterpart. The addition of the temporal dimension requires the algorithm to maintain strict consistency across frames to avoid flickering or motion artifacts. Furthermore, real-world videos often contain dynamic textures (e.g., flowing water) and camera motion, which complicate simple spatial copy-paste logic.

Previous solutions typically relied on tedious manual segmentation of foreground and background objects or were computationally prohibitive, sometimes requiring days of processing for short clips. This work addresses these limitations by optimizing a global functional through a non-local patch-based approach.

Methodology

The authors' approach hinges on several key technical innovations that prioritize both speed and visual fidelity.

3D PatchMatch

The core innovation is the extension of the 2D PatchMatch algorithm to a 3D spatio-temporal volume. Instead of matching square image patches, the algorithm utilizes "rectangular cuboids" of video data. By combining random search with spatial and temporal propagation, the algorithm finds approximate nearest neighbors (ANN) with extreme efficiency.

3D PatchMatch concept: finding a nearest neighbor patch in the unoccluded region.

Texture Feature Pyramid

A critical observation in this research is that standard color distance ($L^2$ norm) often fails to preserve textures, as algorithms naturally favor smooth regions where mathematical "distance" is lower. To counteract this, the authors compute a pyramid of gradient-based texture features. Including these features in the patch distance calculation forces the algorithm to respect the "busyness" of a scene, preventing common blurring artifacts.

Algorithmic Pipeline

The complete pipeline involves an initial global affine realignment to handle moving cameras without explicit segmentation. The video is then processed through a multi-resolution "onion peel" strategy, working from coarse to fine resolutions to ensure structural soundness.

Overview of the video inpainting pipeline, from input video to multi-resolution reconstruction.

Experimental Setup and Datasets

As a non-learning-based approach, the method was evaluated on a variety of challenging real-world benchmark sequences rather than a massive training set. Key datasets included:

  • "Crossing Ladies" & "Jumping Girl": Focused on complex human motion and occlusion.
  • "Waves": Focused on the reconstruction of dynamic textures.
  • "Museum": A high-definition (1120x754) sequence testing performance on moving backgrounds and multiple moving objects.

Results and Discussion

The most significant contribution of this work is the dramatic reduction in computational cost. The 3D PatchMatch search is 20-50 times faster than traditional kd-tree searches. For the high-resolution "Museum" sequence, the algorithm achieved comparable or superior visual quality in just 6.2 hours, compared to the 90 hours required by previous leading methods.

Visually, the method successfully reconstructs rhythmic motions and walking gaits that typically cause ghosting or flickering in other algorithms. By using affine realignment, the authors demonstrate that explicit foreground/background segmentation is optional; if patches are matched well in a realigned space, the scene structure emerges naturally from the data.

Conclusion

While the algorithm represents a major leap in efficiency, limitations remain regarding long-term occlusions where no temporal reference data exists. Future work may explore dimensionality reduction of the patch space to move closer to real-time performance. Nevertheless, this framework provides a robust, automatic solution for high-quality video inpainting in complex, dynamic environments.

Summary updated

BibTeX
@article{newson2014video,
  author = {Alasdair Newson and Andrés Almansa and Matthieu Fradet and Yann Gousseau and Patrick Pérez},
  title = {{Video Inpainting of Complex Scenes}},
  journal = {SIAM J. Imaging Sci.},
  year = {2014},
  url = {https://openreview.net/forum?id=hywY6L4QwF},
}
Figure