Next: motionseg Up: Reference Previous: thinning   Contents   Index

#### hs_flow

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:

E(u, v) = ((Ix.u+Iy.v+It)2 + (|u|2 + (|v|2) dxdy,

where u and v are the velocity components of the apparent motion w. The first term is a term of basic measurement preserving, and the second one is a smoothing term which is controlled by the weight . The Euler-Lagrange equations are a system of two differential equations which can be solved with an iterative scheme:

Start from u0 and v0 ( u0 = v0 = 0)

The estimates of the derivatives Ix, Iy and It are
 Ix = (Ii+1, j+1, t+1 - Ii, j+1, t+1 + Ii+1, j, t+1 - Ii, j, t+1 + Ii+1, j+1, t - Ii, j+1, t + Ii+1, j, t - Ii, j, t) *0.3cm Iy = (Ii+1, j+1, t+1 - Ii+1, j, t+1 + Ii, j+1, t+1 - Ii, j, t+1 + Ii+1, j+1, t - Ii+1, j, t + Ii, j+1, t - Ii, j, t) *0.3cm It = (Ii+1, j+1, t+1 - Ii+1, j, t + Ii, j+1, t+1 - Ii, j+1, t + Ii+1, j, t+1 - Ii+1, j, t + Ii, j, t+1 - Ii, j, t)

and are the local averages

 = (ui-1, j, t + ui, j+1, t + ui+1, j, t + ui, j-1, t) + (ui-1, j-1, t + ui-1, j+1, t + ui+1, j+1, t + ui+1, j-1, t) *0.3cm = (vi-1, j, t + vi, j+1, t + vi+1, j, t + vi, j-1, t) + (vi-1, j-1, t + vi-1, j+1, t + vi+1, j+1, t + vi+1, j-1, t)

The -n option gives the number of iterations to be done.
The -a option changes the weight of parameter .

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

Next: motionseg Up: Reference Previous: thinning   Contents   Index
mw 2004-05-05