median apply discrete median to a Cimage
median [-s s] [-r r] [-n n] in out
-s s : if set, the shape s is taken as structuring element
-r r : otherwise, a disc of radius r (default 1.0) is used
-n n : number of iterations (default: 1)
in : input Cimage
out : output Cimage
Cimage median (u , v , r , s , n )
Cimage u , v ;
float *r ;
Curve s ;
int *n ;
This module implements one of the most effective denoising operator of
mathematical morphology, the median filter.
Let s be a shape, i.e. a
discrete subset of R2, this operator processes an image u(x) into
where the med operator of a sequence
(xi)i=1..n is defined as follows :
first sort (xi) into (yi) so that
y1 y2 ... yn, and
The iteration of the infinitesimal median filter leads theoritically to mean
curvature motion, but in practice this process blocks (i.e. the image is
stabilized) after several
iterations because of the discrete spatial resolution of the image.
In this module, the
median operator is iterated n times. If no shape s is specified, a disc
of radius r is taken. A message is printed to the standard output
if the process blocked before the n iterations were achieved.
The complexity of the algorithm is
O(| u| nr2log r), so that it costs
less to increase n than r.
Last Modification date : Thu Nov 29 20:23:56 2001