Online video stabilization using a novel MeshFlow motion model
The MeshFlow is a spatial smooth sparse motion field with motion vectors only at the mesh vertexes. The MeshFlow is produced by assigning each vertex an unique motion vector via two median filters. The path smoothing is conducted on the vertex profiles, which are motion vectors collected at the same vertex location in the MeshFlow over time. The profiles are smoothed adaptively by a novel smoothing technique, namely the Predicted Adaptive Path Smoothing (PAPS), which only uses motions from the past.
To stabilize a video execute the script
python Stabilization.py- To run experiments ipython-notebook is present in
src/mesh_flow.ipynb- The stable output video is saved to
homedirectory of cloned repository
pip install --user opencv-python
pip install --user numpy
pip install --user scipy
pip install --user tqdm
pip install --user cvxpy
Mesh Flow only operate on a sparse regular grid of vertex profiles, such that the expensive optical flow can be replaced with cheap feature matches. For one thing, they are similar because they both encode strong spatial smoothness. For another, they are different as one is dense and the other is sparse. Moreover, the motion estimation methods are totally different. Next, we show estimatation of spacial coherent motions at mesh vertexes.
A vertex profile represents the motion of its neighboring image regions. MeshFlow can smooth all the vertex profiles for the smoothed motions. It begin by describing an offline filter, and then extend it for online smoothing.