next up previous contents index
Next: opening Up: Reference Previous: mam   Contents   Index

median

$ \bigcirc$Name


median apply discrete median to a Cimage




$ \bigcirc$Command Synopsis


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




$ \bigcirc$Function Summary


Cimage median (u , v , r , s , n )

Cimage u , v ;

float *r ;

Curve s ;

int *n ;




$ \bigcirc$Description


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

v(x) = med$\displaystyle \left(\vphantom{\,u(x+\delta)\,}\right.$ u(x + $\displaystyle \delta$$\displaystyle \left.\vphantom{\,u(x+\delta)\,}\right)_{{\delta \epsilon s}}^{}$,

where the med operator of a sequence (xi)i=1..n is defined as follows : first sort (xi) into (yi) so that y1 $ \leq$ y2 $ \leq$...$ \leq$ yn, and then define

med (xi)i=1..n = y[$\scriptstyle {\frac{{n}}{{2}}}$].

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.




$ \bigcirc$See Also


disc.




$ \bigcirc$Version 2.4


Last Modification date : Thu Nov 29 20:23:56 2001


$ \bigcirc$Author


Lionel Moisan






next up previous contents index
Next: opening Up: Reference Previous: mam   Contents   Index
mw 2004-05-05