API Reference >> skvideo.motion.blockMotion
Fork me on GitHub

skvideo.motion.blockMotion

skvideo.motion.blockMotion(videodata, method='DS', mbSize=8, p=2, **plugin_args)[source]

Block-based motion estimation

Given a sequence of frames, this function returns motion vectors between frames.

Parameters:

videodata : ndarray, shape (numFrames, height, width, channel)

A sequence of frames

method : string

“ES” –> exhaustive search

“3SS” –> 3-step search

“N3SS” –> “new” 3-step search [1]

“SE3SS” –> Simple and Efficient 3SS [2]

“4SS” –> 4-step search [3]

“ARPS” –> Adaptive Rood Pattern search [4]

“DS” –> Diamond search [5]

mbSize : int

Macroblock size

p : int

Algorithm search distance parameter

Returns:

motionData : ndarray, shape (numFrames - 1, height/mbSize, width/mbSize, 2)

The motion vectors computed from videodata. The first element of the last axis contains the y motion component, and second element contains the x motion component.

References

[1]Renxiang Li, Bing Zeng, and Ming L. Liou, “A new three-step search algorithm for block motion estimation.” IEEE Transactions on Circuits and Systems for Video Technology, 4 (4) 438-442, Aug 1994
[2]Jianhua Lu and Ming L. Liou, “A simple and efficient search algorithm for block-matching motion estimation.” IEEE Transactions on Circuits and Systems for Video Technology, 7 (2) 429-433, Apr 1997
[3]Lai-Man Po and Wing-Chung Ma, “A novel four-step search algorithm for fast block motion estimation.” IEEE Transactions on Circuits and Systems for Video Technology, 6 (3) 313-317, Jun 1996
[4]Yao Nie and Kai-Kuang Ma, “Adaptive rood pattern search for fast block-matching motion estimation.” IEEE Transactions on Image Processing, 11 (12) 1442-1448, Dec 2002
[5]Shan Zhu and Kai-Kuang Ma, “A new diamond search algorithm for fast block-matching motion estimation.” IEEE Transactions on Image Processing, 9 (2) 287-290, Feb 2000