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:
videodatandarray, shape (numFrames, height, width, channel)

A sequence of frames

methodstring

“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]

mbSizeint

Macroblock size

pint

Algorithm search distance parameter

Returns:
motionDatandarray, 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