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

skvideo.motion.globalEdgeMotion

skvideo.motion.globalEdgeMotion(frame1, frame2, r=6, method='hamming')[source]

Global motion estimation using edge features

Given two frames, find a robust global translation vector found using edge information.

Parameters:

frame1 : ndarray

first input frame, shape (1, M, N, C), (1, M, N), (M, N, C) or (M, N)

frame2 : ndarray

second input frame, shape (1, M, N, C), (1, M, N), (M, N, C) or (M, N)

r : int

Search radius for measuring correspondences.

method : string

“hamming” –> use Hamming distance when measuring edge correspondence distances. The distance used in the census transform. [1]

“hausdorff” –> use Hausdorff distance when measuring edge correspondence distances. [2]

Returns:

globalMotionVector : ndarray, shape (2,)

The motion to minimize edge distances by moving frame2 with respect to frame1.

References

[1]Ramin Zabih and John Woodfill. Non-parametric local transforms for computing visual correspondence. Computer Vision-ECCV, 151-158, 1994.
[2]Kevin Mai, Ramin Zabih, and Justin Miller. Feature-based algorithms for detecting and classifying scene breaks. Cornell University, 1995.