skvideo.motion.blockComp
skvideo.motion.blockComp¶Block-based motion compensation
Using the given motion vectors, this function returns the motion-compensated video data.
an input frame sequence, shape (T, M, N, C), (T, M, N), (M, N, C) or (M, N)
ndarray representing block motion vectors. Expects ndarray, shape (T-1, M/mbSize, N/mbSize) or (M/mbSize, N/mbSize).
Size of macroblock in pixels.
ndarray holding the motion compensated frames, shape (T, M, N, C)
and dtype float64. A single input frame returns shape
(1, M, N, C).
Notes
motionVect’s grid must match the macroblock grid
(M // mbSize by N // mbSize); a mismatch raises ValueError.
When M or N is not a multiple of mbSize, the uncovered
bottom/right border is copied through from the input frame unchanged
(it cannot be motion-compensated). A motion vector that points outside
the frame leaves that block as the original (uncompensated) pixels.