Erosion (usually represented by ⊖) is one of two fundamental operations (the other being
dilation
wiktionary:dilation, Dilation (or dilatation) may refer to:
Physiology or medicine
* Cervical dilation, the widening of the cervix in childbirth, miscarriage etc.
* Coronary dilation, or coronary reflex
* Dilation and curettage, the opening of ...
) in
morphological image processing from which all other morphological operations are based. It was originally defined for
binary image
A binary image is a digital image that consists of pixels that can have one of exactly two colors, usually black and white. Each pixel is stored as a single bit — i.e. either a 0 or 1.
A binary image can be stored in memory as a bitmap: a p ...
s, later being extended to
grayscale
In digital photography, computer-generated imagery, and colorimetry, a greyscale (more common in Commonwealth English) or grayscale (more common in American English) image is one in which the value of each pixel is a single sample (signal), s ...
images, and subsequently to
complete lattice
In mathematics, a complete lattice is a partially ordered set in which all subsets have both a supremum ( join) and an infimum ( meet). A conditionally complete lattice satisfies at least one of these properties for bounded subsets. For compariso ...
s. The erosion operation usually uses a
structuring element In mathematical morphology, a structuring element is a shape, used to probe or interact with a given image, with the purpose of drawing conclusions on how this shape fits or misses the shapes in the image. It is typically used in morphological oper ...
for probing and reducing the shapes contained in the input image.
Binary erosion
In binary morphology, an image is viewed as a
subset
In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
of a
Euclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
or the
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
grid
Grid, The Grid, or GRID may refer to:
Space partitioning
* Regular grid, a tessellation of space with translational symmetry, typically formed from parallelograms or higher-dimensional analogs
** Grid graph, a graph structure with nodes connec ...
, for some dimension ''d''.
The basic idea in binary morphology is to probe an image with a simple, pre-defined shape, drawing conclusions on how this shape fits or misses the shapes in the image. This simple "probe" is called
structuring element In mathematical morphology, a structuring element is a shape, used to probe or interact with a given image, with the purpose of drawing conclusions on how this shape fits or misses the shapes in the image. It is typically used in morphological oper ...
, and is itself a binary image (i.e., a subset of the space or grid).
Let ''E'' be a Euclidean space or an integer grid, and ''A'' a binary image in ''E''.
The erosion of the binary image ''A'' by the structuring element ''B'' is defined by:
:
,
where ''B''
''z'' is the translation of ''B'' by the vector z, i.e.,
,
.
When the structuring element ''B'' has a center (e.g., a disk or a square), and this center is located on the origin of ''E'', then the erosion of ''A'' by ''B'' can be understood as the locus of points reached by the center of ''B'' when ''B'' moves inside ''A''. For example, the erosion of a square of side 10, centered at the origin, by a disc of radius 2, also centered at the origin, is a square of side 6 centered at the origin.
The erosion of ''A'' by ''B'' is also given by the expression:
, where ''A
−b'' denotes the translation of ''A'' by ''-b''.
This is more generally also known as a
Minkowski difference
In geometry, the Minkowski sum of two set (mathematics), sets of position vectors ''A'' and ''B'' in Euclidean space is formed by vector addition, adding each vector in ''A'' to each vector in ''B'':
A + B = \
The Minkowski difference (also ''M ...
.
Example
Suppose A is a 13 x 13 matrix and B is a 3 x 3 matrix:
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
Assuming that the origin B is at its center, for each pixel in A superimpose the origin of B, if B is completely contained by A the pixel is retained, else deleted.
Therefore the Erosion of A by B is given by this 13 x 13 matrix.
0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 0 0 0 1 1 1 1 0
0 1 1 1 1 0 0 0 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0
This means that only when B is completely contained inside A that the pixels values are retained, otherwise it gets deleted or eroded.
Properties
* The erosion is
translation invariant
In physics and mathematics, continuous translational symmetry is the invariance of a system of equations under any translation (without rotation). Discrete translational symmetry is invariant under discrete translation.
Analogously, an operato ...
.
* It is
increasing, that is, if
, then
.
* If the origin of ''E'' belongs to the structuring element ''B'', then the erosion is ''anti-extensive'', i.e.,
.
* The erosion satisfies
, where
denotes the
morphological dilation.
* The erosion is
distributive over
set intersection
In set theory, the intersection of two sets A and B, denoted by A \cap B, is the set containing all elements of A that also belong to B or equivalently, all elements of B that also belong to A.
Notation and terminology
Intersection is writt ...
Grayscale erosion

In
grayscale
In digital photography, computer-generated imagery, and colorimetry, a greyscale (more common in Commonwealth English) or grayscale (more common in American English) image is one in which the value of each pixel is a single sample (signal), s ...
morphology, images are
functions mapping a
Euclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
or
grid
Grid, The Grid, or GRID may refer to:
Space partitioning
* Regular grid, a tessellation of space with translational symmetry, typically formed from parallelograms or higher-dimensional analogs
** Grid graph, a graph structure with nodes connec ...
''E'' into
, where
is the set of
reals,
is an element larger than any real number, and
is an element smaller than any real number.
Denoting an image by ''f(x)'' and the grayscale structuring element by ''b(x)'', where B is the space that b(x) is defined, the grayscale erosion of ''f'' by ''b'' is given by
::