基于图像粘贴技术的摄像机运动补偿
camocomp的Python项目详细描述
它是什么
camocomp是一个可以稳定视频的python包,即生成 补偿摄像机运动的视频拷贝。这将生成一个视频 固定背景(如建筑物、道路)看起来是静态的。
它能用于什么
相机运动补偿可用于各种任务,包括
- 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)
从何处获取
源代码当前托管在github上,位于:http://github.com/daien/camocomp
python上提供了最新版本的二进制安装程序 包索引:
http://pypi.python.org/pypi/camocomp/
通过easy_install或pip:
easy_install camocomp pip install camocomp
从源安装
在camocomp目录中(与找到此文件的目录相同),执行:
python setup.py install
注意:这只适用于类unix平台。
许可证
新的BSD许可证
如何使用
我们提供了一个名为camocomp_video的实用程序脚本,它可以生成 视频的稳定拷贝。
example目录中的视频example_mocomp.avi包含 使用以下命令获得稳定视频:
camocomp_video -o example_mocomp.avi -c -v p_y -f 40 example.avi
根据您的输入视频,您可能需要播放输入 视野参数(-f选项)和/或要优化的变量 ('v'iewpoint,'p'itch,'y'aw和'r'oll)。
它是如何工作的
它依赖于与创建 多张照片的全景图。这样可以补偿大量 时变相机运动(如相机抖动、平移、缩放、倾斜)。
限制
缝合方法面临以下限制:
- it assumes that a large part of each frame is the background;
- it also assumes that the background is textured (in order to detect ^{tt7}$ 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.