**Name**

**median** apply discrete median to a Cimage

**Command Synopsis**

**median** [-s *s*] [-r *r*] [-n *n*] *in* *out*

-ss: if set, the shape s is taken as structuring element

-rr: otherwise, a disc of radius r (default 1.0) is used

-nn: number of iterations (default: 1)

in: input Cimage

out: output Cimage

**Function Summary**

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

Cimage u , v ;

float *r ;

Curve s ;

int *n ;

**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 *R*^{2}, this operator processes an image *u*(*x*) into

med (*x*_{i})_{i=1..n} = *y*_{[]}.

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

**See Also**

`disc`.

**Version 2.4**

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

**Author**

Lionel Moisan