Skip to content

An implementation of Google's Auto Directed Video Stabilization with Robust L1 Optimal Camera Paths Research Paper done as a self study to better understand the mechanisms and methods presented in the paper

Notifications You must be signed in to change notification settings

thejarlid/VideoStabilizationPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Stabilization

This is an implementation of the methods presented in this research paper from Google which aims to stabilise video using linear programming and L1 optimization of the optimal camera path.

Beginning originally as a computer vision class final project in 2018 I had the idea to take frame by frame homographies, plot the x and y jitter, and then take a gausian filter over some window of frames to produce a smooth path. This had flaws in stabilization as it got rid of high frequency jitter that spanned a small window of frames but didn't produce inherently smooth videos. I later discovered this paper which fits constant, linear, and parabolic paths to the overall motion.

This implementation was done as a self study on the research paper to better understand the methods proposed

Results

On the left is the original video and on the right is my smoothed clip.

smooth

motion

Setup

python3 -m venv venv/               # you can change venv/ to whatever you want your virtual environment directory to be called
source venv/bin/activate            # to start the virtual environment 
pip install -r requirements.txt     # get the dependencies 

Usage

python3 src/video_stabilization.py input.mp4 -o output.mp4 -c 0.9

usage: L1 Video Stabilizer [-h] [-o OUT_FILE] [-c CROP_RATIO] [-p] in_file

positional arguments:
  in_file               input video file to stabilize

optional arguments:
  -h, --help            show this help message and exit
  -o OUT_FILE, --out_file OUT_FILE
                        name of the output file default will be the input file name with the suffix _stable
  -c CROP_RATIO, --crop_ratio CROP_RATIO
                        crop ratio for the crop window [0, 1]
  -p, --plot            flag for whether to save and output the plot graphs

Credits

Matlab implementation which influenced some of the decisions in this implementation https://github.com/ishit/L1Stabilizer/tree/master

About

An implementation of Google's Auto Directed Video Stabilization with Robust L1 Optimal Camera Paths Research Paper done as a self study to better understand the mechanisms and methods presented in the paper

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages