Name
hs_flow Horn and Schunck iterative scheme to compute optical flow
Command Synopsis
hs_flow [-n niter] [-a alpha] in xflow yflow
-n niter : number of iterations, default 200
-a alpha : weight on smoothing term, default 50.
in : input Fmovie
xflow : output Fmovie: x coordinate of optical flow
yflow : output Fmovie: y coordinate of optical flow
Function Summary
void hs_flow (niter , alpha , in , xflow , yflow )
int *niter ;
float *alpha ;
Fmovie in , xflow , yflow ;
Description
This module computes the optical flow of a Fmovie of N Fimages using the method proposed by Horn and Schunck [HS81]. It generates two movies of N-1 Fimages representing the coordinates of the vectors w of the apparent motion.
Let I(x, y, t) be the intensity brightness at point (x, y) of an image of the sequence.
With Horn and Schunck the functionnal which has to be minimized is the following:
Start from u^{0} and v^{0} ( u^{0} = v^{0} = 0)
I_{x} | = | (I_{i+1, j+1, t+1} - I_{i, j+1, t+1} + I_{i+1, j, t+1} - I_{i, j, t+1} | |
+ I_{i+1, j+1, t} - I_{i, j+1, t} + I_{i+1, j, t} - I_{i, j, t}) *0.3cm | |||
I_{y} | = | (I_{i+1, j+1, t+1} - I_{i+1, j, t+1} + I_{i, j+1, t+1} - I_{i, j, t+1} | |
+ I_{i+1, j+1, t} - I_{i+1, j, t} + I_{i, j+1, t} - I_{i, j, t}) *0.3cm | |||
I_{t} | = | (I_{i+1, j+1, t+1} - I_{i+1, j, t} + I_{i, j+1, t+1} - I_{i, j+1, t} | |
+ I_{i+1, j, t+1} - I_{i+1, j, t} + I_{i, j, t+1} - I_{i, j, t}) |
and
are the local averages
= | (u_{i-1, j, t} + u_{i, j+1, t} + u_{i+1, j, t} + u_{i, j-1, t}) | ||
+ (u_{i-1, j-1, t} + u_{i-1, j+1, t} + u_{i+1, j+1, t} + u_{i+1, j-1, t}) *0.3cm | |||
= | (v_{i-1, j, t} + v_{i, j+1, t} + v_{i+1, j, t} + v_{i, j-1, t}) | ||
+ (v_{i-1, j-1, t} + v_{i-1, j+1, t} + v_{i+1, j+1, t} + v_{i+1, j-1, t}) |
Exemple of use:
hs_flow cmovie /tmp/U /tmp/V ofdraw /tmp/U /tmp/V /tmp/disp cmview -l /tmp/disp &
Version 1.0
Last Modification date : Thu Apr 15 06:44:30 2004
Author
Olivia Sanchez