3D Video Stabilization With Depth Estimation by CNN-Based Optimization

Yao-Chih Lee, Kuan-Wei Tseng, Yu-Ta Chen, Chien-Cheng Chen, Chu-Song Chen, Yi-Ping Hung

Abstract

Video stabilization aims to remove unwanted camera shake while preserving intentional motion. Traditional 2D methods often suffer from parallax artifacts, while 3D methods are computationally intensive and prone to failure. This paper presents Deep3D Stabilizer, a self-supervised framework that reconstructs a 3D scene model directly from shaky footage using CNN-based optimization. By optimizing depth and camera motion at test time, the method effectively handles complex parallax and dynamic scenes. The pipeline consists of a 3D geometry optimization stage followed by a real-time frame rectification stage, allowing users to interactively adjust stabilization intensity. Experimental results on the NUS dataset demonstrate that Deep3D Stabilizer achieves state-of-the-art performance in stability and visual quality.

Introduction

Video stabilization is the process of removing unwanted camera shake while preserving the intended "primary" motion. Traditional approaches generally fall into two categories: 2D methods and 3D methods. 2D methods use simple geometric transformations like homographies; while fast, they struggle with parallax—the effect where objects at different depths appear to move at different speeds—often resulting in "wobbly" or distorted videos. 3D methods use Structure-from-Motion (SfM) to model the camera's path in space. Although more accurate, they are computationally expensive and "brittle," frequently failing if feature tracking is interrupted by blur or extreme shakiness.

Existing deep learning solutions have mostly focused on the 2D domain or required massive datasets of synchronized stable/unstable video pairs, limiting their generalization. Furthermore, most AI models lack user-tunable parameters, preventing real-time adjustment of stabilization intensity without retraining.

Methodology

The proposed Deep3D Stabilizer is a two-stage pipeline that leverages CNN-based optimization without requiring a pre-existing training dataset.

Overview of the Deep3D Stabilizer pipeline, showing the transition from input frames to 3D optimization and final frame rectification.

Stage 1: 3D Geometry Optimization

The system utilizes two neural networks—DepthNet and PoseNet—to analyze the shaky video. Instead of being pre-trained on a specific dataset, these networks are optimized "on the fly" for the specific video being processed. The optimization is guided by optical flow (calculated via PWC-Net) and a combination of photometric and geometric losses. To ensure temporal consistency, the video is divided into overlapping snippets. The system freezes estimations in overlapping regions and uses parameter propagation (initializing the next snippet with the previous one's weights) to accelerate convergence.

Stage 2: Frame Rectification

Once the 3D camera trajectory and depth maps are estimated, the shaky 3D path is smoothed using a Gaussian filter. The original frames are then re-projected onto this new, smooth 3D path using the estimated depth information. Because the smoothing occurs at this final stage, users can adjust the "smoothness" parameter ($\sigma$) in real-time (34.5 fps) to see results instantly.

Key Insights

  • Test-Time Optimization: By treating stabilization as an optimization problem for a specific video rather than a general learning task, the model avoids the "generalization gap" common in AI methods.
  • 3D Cues for Parallax: Leveraging 3D depth allows the model to understand that foreground and background objects move differently during a shake, inherently solving parallax issues.
  • Handling Dynamic Objects: Moving objects (like pedestrians) can confuse 3D optimization. The authors utilize the "loss map" from the optimization process to identify these dynamic areas and apply spatially variant smoothing to prevent artifacts.
Visualization of dynamic object handling. The loss map (d) identifies moving subjects, allowing for spatially variant smoothing (f) to prevent artifacts.

Evaluation and Results

The authors evaluated Deep3D Stabilizer on the NUS dataset, a standard benchmark containing 144 shaky videos across six motion types: Regular, Large Parallax, Crowd, Running, Quick Rotation, and Zooming.

  • Stability Performance: Deep3D Stabilizer achieved the highest stability scores (Rank-1) across almost all categories, particularly excelling in "Large Parallax" and "Crowd" scenes where 2D methods typically fail.
  • Visual Quality: Qualitative results show significantly fewer shearing artifacts and less over-cropping compared to state-of-the-art methods like Adobe Premiere or StabNet.
  • Efficiency: While the initial 3D optimization takes roughly 0.6 seconds per frame, the rectification stage runs at 34.5 fps, enabling interactive tuning for the end-user.

Conclusion and Future Work

Deep3D Stabilizer provides a robust solution for high-quality video stabilization by combining 3D scene understanding with the flexibility of CNN optimization. While the rectification is real-time, the initial optimization stage remains relatively slow, making it better suited for post-processing. Future work may address intra-frame artifacts like rolling shutter distortion or explore "image outpainting" to fill missing edges in stabilized frames, reducing the need for heavy cropping.

Summary updated

BibTeX
@inproceedings{lee2021d,
  author = {Yao-Chih Lee and Kuan-Wei Tseng and Yu-Ta Chen and Chien-Cheng Chen and Chu-Song Chen and Yi-Ping Hung},
  title = {{3D Video Stabilization With Depth Estimation by CNN-Based Optimization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01048},
}
Figure