Stabilo video stabilizer

From Noah.org
Revision as of 19:18, 15 August 2007 by Root (talk | contribs) (New page: Category:Engineering Category:Free_Software == stabilo -- video stabilization filter == This script processes successive frames of a video stream and finds the offset between eac...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


stabilo -- video stabilization filter

This script processes successive frames of a video stream and finds the offset between each frame. It then adjust each frame of the output to minimize the offset. The result is smoother video.

This is a working alpha project at the moment.

This requires a patch to PIL to add an RMS function. This function will calculate the RMS difference between two images. I could have implemented this in pure Python, but writing the function in C yielded a 10X speed increase. This processing is slow to begin with, so any factor of speed increase is a great help.

the script source

The code is fairly simple. Currently the algorithm does not check if rotation of the image will improve smoothness. Rotations are very slow and don't help much. I have code stubbed out to add this feature as a final enhancement once a good translation offset is found.

The algorithm is fairly stupid. It's O(N^2). I have a few ideas for improving this, but sampling different offsets and ignoring regions that hurt smoothness and then returning to regions that improved smoothness.

<include svncat src="file:///home/svn/src/python/stabilo/stabilo.py" highlight="py" />