This repository contains my Bachelor’s Thesis Project at the University of Bucharest, Faculty of Mathematics and Computer Science. The project explores deep learning–based video stabilization techniques using optical flow and modern computer vision methods.
The project builds upon the paper Learning Video Stabilization Using Optical Flow (Yu & Ramamoorthi, 2020) and aims to reproduce, modernize, and clarify its implementation using open-source tools. The pipeline combines classical motion estimation and deep learning–based stabilization, trained in an unsupervised fashion.
Initial Stabilization: Global camera motion is reduced using affine transformations estimated via ORB + RANSAC, improving optical flow accuracy.
Optical Flow Generation: The pretrained RAFT model computes dense optical flow between consecutive frames.
Invalid Region Masking & Reconstruction: Dynamic objects and unreliable regions are detected and masked, then reconstructed using PCAFlow.
Neural Network Stabilization: A custom StabilizationNet model processes 21-frame video segments and predicts per-pixel transformations (warp fields) to produce smooth camera motion. The network is trained with a combination of motion loss and spatial smoothness loss to ensure both accuracy and fluidity.
Post-Processing: PCA-based smoothing and a sliding window mechanism are applied for full-video stabilization.
-
Python, PyTorch, OpenCV, NumPy
-
RAFT Optical Flow, PCAFlow, ResNet-101 Segmentation
-
Matplotlib, Adam Optimizer, Affine Transformations