Dilation (morphology)

Dilation (usually represented by ⊕) is one of the basic operations in mathematical morphology. Originally developed for binary images, it has been expanded first to grayscale images, and then to complete lattices. The dilation operation usually uses a structuring element for probing and expanding the shapes contained in the input image.
Binary dilation.
In binary morphology, dilation is a shift-invariant (translation invariant) operator, equivalent to Minkowski addition. 
A binary image is viewed in mathematical morphology as a subset of a Euclidean space R"d" or the integer grid Z"d", for some dimension "d". Let "E" be a Euclidean space or an integer grid, "A" a binary image in "E", and "B" a structuring element regarded as a subset of R"d".
The dilation of "A" by "B" is defined by
where "A""b" is the translation of "A" by "b".
Dilation is commutative, also given by formula_2.
If "B" has a center on the origin, then the dilation of "A" by "B" can be understood as the locus of the points covered by "B" when the center of "B" moves inside "A". The dilation of a square of size 10, centered at the origin, by a disk of radius 2, also centered at the origin, is a square of side 14, with rounded corners, centered at the origin. The radius of the rounded corners is 2.
The dilation can also be obtained by formula_3, where "B""s" denotes the symmetric of "B", that is, formula_4.
Example.
Suppose A is the following 11 x 11 matrix and B is the following 3 x 3 matrix:
 0 0 0 0 0 0 0 0 0 0 0
 0 1 1 1 1 0 0 1 1 1 0 
 0 1 1 1 1 0 0 1 1 1 0 
 0 1 1 1 1 1 1 1 1 1 0
 0 1 1 1 1 1 1 1 1 1 0 1 1 1
 0 1 1 0 0 0 1 1 1 1 0 1 1 1
 0 1 1 0 0 0 1 1 1 1 0 1 1 1
 0 1 1 0 0 0 1 1 1 1 0 
 0 1 1 1 1 1 1 1 0 0 0 
 0 1 1 1 1 1 1 1 0 0 0 
 0 0 0 0 0 0 0 0 0 0 0
For each pixel in A that has a value of 1, superimpose B, with the center of B aligned with the corresponding pixel in A.
Each pixel of every superimposed B is included in the dilation of A by B.
The dilation of A by B is given by this 11 x 11 matrix.
 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 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 0 0 
 1 1 1 1 1 1 1 1 1 0 0
Properties of binary dilation.
Here are some properties of the binary dilation operator
Grayscale dilation.
In grayscale morphology, images are functions mapping a Euclidean space or grid "E" into formula_9, where formula_10 is the set of reals, formula_11 is an element greater than any real number, and formula_12 is an element less than any real number.
Grayscale structuring elements are also functions of the same format, called "structuring functions".
Denoting an image by "f"("x") and the structuring function by "b"("x"), the grayscale dilation of "f" by "b" is given by
where "sup" denotes the supremum. 
Flat structuring functions.
It is common to use flat structuring elements in morphological applications. Flat structuring functions are functions "b"("x") in the form
where formula_15.
In this case, the dilation is greatly simplified, and given by
In the bounded, discrete case ("E" is a grid and "B" is bounded), the supremum operator can be replaced by the maximum. Thus, dilation is a particular case of order statistics filters, returning the maximum value within a moving window (the symmetric of the structuring function support "B").
Dilation on complete lattices.
Complete lattices are partially ordered sets, where every subset has an infimum and a supremum. In particular, it contains a least element and a greatest element (also denoted "universe").
Let formula_17 be a complete lattice, with infimum and supremum symbolized by formula_18 and formula_19, respectively. Its universe and least element are symbolized by "U" and formula_20, respectively. Moreover, let formula_21 be a collection of elements from "L".
A dilation is any operator formula_22 that distributes over the supremum, and preserves the least element. That is, the following are true: