Skip to main content

CAmera MOtion COMPensation using image stiching techniques to generate stabilized videos

Project description

What is it

camocomp is a Python package that can stabilize videos, i.e. generate a video copy in which the camera motion is compensated. This results in a video where the fixed background (e.g. buildings, roads) appears to be static.

What can it be used for

Camera motion compensation is useful for a variety of tasks, including

  • stabilizing camera shake

  • recovering the camera motion for video and scene analysis

  • differentiating between the foreground motion (e.g. of actors) and the motion caused by the moving camera (for motion analysis)

Where to get it

The source code is currently hosted on GitHub at: http://github.com/daien/camocomp

Binary installers for the latest released version are available at the Python Package Index:

http://pypi.python.org/pypi/camocomp/

And via easy_install or pip:

easy_install camocomp
pip install camocomp

Dependencies

  • Numpy: 1.6.1 or higher

  • Hugin: a recent version (around 2012)

  • FFmpeg: a recent version (around 2012)

  • OpenCV: version 2.4.1 or higher (fixes a bug of the ffmpeg wrapper)

Note: this package relies on Hugin’s python scripting interface (HSI): http://wiki.panotools.org/Hugin_Scripting_Interface

Installation from sources

In the camocomp directory (same one where you found this file), execute:

python setup.py install

Note: this only works on Unix-like platforms.

License

New BSD License

How to use it

We provide a utility script called camocomp_video that can generate a stabilized copy of a video.

The video example_mocomp.avi in the example directory contains a stabilized video obtained with the command:

camocomp_video -o example_mocomp.avi -c  -v p_y -f 40 example.avi

Depending on your input videos, you might need to play around with the input field of view parameter (-f option) and/or the variables to optimize (‘v’iewpoint, ‘p’itch, ‘y’aw, and ‘r’oll).

How does it work

It relies on image stitching techniques similar to the ones used to create panoramas from multiple photos. This allows to compensate for a vast array of time-varying camera motions (e.g. camera shake, pan, zoom, tilt).

Limitations

The stitching approach faces the following limitations:

  • it assumes that a large part of each frame is the background;

  • it also assumes that the background is textured (in order to detect control points on the background);

  • the spatial extent of the camera motion must be rather limited (i.e. restricted panning or translation, such that the background covered is limited) in order to avoid an extravagantly large output resolution;

  • some camera motions are problematic (e.g. rotation around the subject);

  • finding the correct input field of view parameter might require some trial and error;

  • the stitching optimization step (using hugin’s autooptimizer) is VERY slow.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

camocomp-0.1.tar.gz (1.2 MB view details)

Uploaded Source

File details

Details for the file camocomp-0.1.tar.gz.

File metadata

  • Download URL: camocomp-0.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for camocomp-0.1.tar.gz
Algorithm Hash digest
SHA256 a06c5efc6c559d5db270b870763f5326babfa729dd448815277157b75e433708
MD5 0df9413eaf0b88186ce6f3514fb1da12
BLAKE2b-256 b16d7621521012fdfbf9bd31b9f1cf505e7e9d41108e81c351cd8865e23b6dc6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page