mac_snakes Maximizing Average Contrast Snakes for contour detection
mac_snakes [-p power] [-n niter] [-s step] [-v] [-V V] u in out
-p power : g(s)= | s | power (default power=1.0)
-n niter : number of iterations (default 1000)
-s step : evolution step (default 1.0)
-v : verbose mode
-V V : select video mode and specify zoom (e.g. 2)
u : input Fimage
in : input curves (Dlists)
out : output curves (modified input)
Dlists mac_snakes (u , in , niter , step , power , v , V )
Fimage u ;
Dlists in ;
int *niter ;
float *V ;
double *step , *power ;
char *v ;
This module implements the Kimmel and Bruckstein snake model [KB02] for contour detection (or optimization). Its goal is to maximize with respect with (an arclength parameterized curve) the average contrast
This module only implements the case g(s) = | s|power, but it could be easily adapted to more general functions g. The influence of the choice of g is discussed in [DMM03]. The default is g(s) = | s|, but powers smaller than 1 could be preferred in order to reduce even more the sensitivity to the image contrast.
The numerical scheme is based on a gradient descent (with step step)
associated to a discrete version of E() (see the description
below, and [DMM03] for a complete discussion and full details).
An input Fimage (u) and an initial set in
of curves (Dlists) should be provided
to the module, which outputs a new (final) set of curves out
after niter iterations (
-n option). Intermediate
states can be monitored by printing the energy evolution (with
-v option) or visually with the
-V option followed by
a zoom factor (try 2 for example). Note that the number of points of
each curve is kept constant during the evolution,
so that an appropriate (fine enough) sampling
of each initial curve is needed: rough polygons will not do in general!
Due to their sensitivity to initial conditions, snakes models should be used for interactive contour optimization rather than for contour detection. To obtain good results, one should
amss) in order to avoid local maxima of the snakes model;
readpolyshould be followed by
-soption), which can easily go from 0.01 to more than 1000.
An example is given by the following sequence of commands:
circle -r 20 -n 100 c fkzrt c c 1 0 115 170 fkview -s -b cimage c & fsepconvol -g 1 cimage u mac_snakes -V 2 -s 1 -n 3000 u c out
For an interactive choice of the initial contour, the first two lines may be replaced by
readpoly cimage c gass -e 2 c c(type 'q' after drawing manually the initial contour).
For a non-Euclidean parameterization (p) : [a, b]IR2, the energy we want to maximize writes
To compute the evolution of the snake, we use a two-steps iterative scheme.
Last Modification date : Tue Apr 8 04:08:35 2003