Categories
code Mapping opencv Tracking video vision

Simplest 20-lines OpenCV video stabilizer [w/ code]

A simple and short video stabilizer with OpenCV.

Just sharing a simple recipe for a video stabilizer in OpenCV based on goodFeaturesToTrack() and calcOpticalFlowPyrLK().
Well… it’s a bit more than 20 lines, but it is short. And it doesn’t work for every kind of video (although the results are funny anyway! :).

Result


The original video is from Vimeo: http://vimeo.com/71719896
Under Creative Commons license, attribution goes to: Anton Withagen http://vimeo.com/user454264
Enjoy!
Roy.

One reply on “Simplest 20-lines OpenCV video stabilizer [w/ code]”

Hello,
Thank you for the code. I ran it on Visual Studio and it stops at a point where it detects only the features. Only the original window opens and is still. No movement. Tried it with different video formats. Your help is appreciated.
Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *