**Name**

**erosion** erosion/dilation of a Cimage

**Command Synopsis**

**erosion** [-i] [-s *s*] [-r *r*] [-n *n*] *in* *out*

-i : if set, a dilation is applied instead of an erosion

-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 erosion (u , v , r , s , n , i )

Cimage u , v ;

float *r ;

Curve s ;

int *n ;

char *i ;

**Description**

In this module, we have implemented two basic operators of mathematical
morphology, the so-called erosion and dilation. Let *u*(*x*) be an image
and *F* a shape, i.e. a subset of *R*^{2}, then the erosion of *u* by the
``structuring element'' *F* is the image *v* defined by

The *erosion* module iterates *n* erosions (or dilations if the -i option
is set)
on a cimage *u*, taking shape *s* as structuring element, or a disc of radius
*r* (default *r* = 1.0) if no shape is specified.

The complexity of the algorithm is
*O*(*nr*^{2}| *u*|), so that it is faster to
process many ``little'' erosions than a ``big'' one.

**See Also**

`disc`.

**Version 2.5**

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

**Author**

Lionel Moisan