Dilation (morphology)

From HandWiki
Short description: Operation in mathematical 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

The dilation of a dark-blue square by a disk, resulting in the light-blue square with rounded corners.

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 Rd or the integer grid Zd, 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 Rd.

The dilation of A by B is defined by

[math]\displaystyle{ A \oplus B = \bigcup_{b\in B} A_b, }[/math]

where Ab is the translation of A by b.

Dilation is commutative, also given by [math]\displaystyle{ A \oplus B = B\oplus A = \bigcup_{a\in A} B_a }[/math].

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 [math]\displaystyle{ A \oplus B = \{z \in E \mid (B^s)_z \cap A\neq \varnothing\} }[/math], where Bs denotes the symmetric of B, that is, [math]\displaystyle{ B^s=\{x\in E \mid -x \in B\} }[/math].

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

  • It is translation invariant.
  • It is increasing, that is, if [math]\displaystyle{ A\subseteq C }[/math], then [math]\displaystyle{ A\oplus B \subseteq C\oplus B }[/math].
  • It is commutative.
  • If the origin of E belongs to the structuring element B, then it is extensive, i.e., [math]\displaystyle{ A\subseteq A\oplus B }[/math].
  • It is associative, i.e., [math]\displaystyle{ (A\oplus B)\oplus C = A\oplus (B\oplus C) }[/math].
  • It is distributive over set union

Grayscale dilation

In grayscale morphology, images are functions mapping a Euclidean space or grid E into [math]\displaystyle{ \mathbb{R}\cup\{\infty,-\infty\} }[/math], where [math]\displaystyle{ \mathbb{R} }[/math] is the set of reals, [math]\displaystyle{ \infty }[/math] is an element greater than any real number, and [math]\displaystyle{ -\infty }[/math] 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

[math]\displaystyle{ (f\oplus b)(x)=\sup_{y\in E}[f(y)+b(x-y)], }[/math]

where "sup" denotes the supremum.

Flat structuring functions

Example of dilation on a grayscale image using a 5x5 flat structuring element. The top figure demonstrates the application of the structuring element window to the individual pixels of the original image. The bottom figure shows the resulting dilated image.

It is common to use flat structuring elements in morphological applications. Flat structuring functions are functions b(x) in the form

[math]\displaystyle{ b(x)=\left\{\begin{array}{ll}0,&x\in B,\\-\infty,&\text{otherwise},\end{array}\right. }[/math]

where [math]\displaystyle{ B\subseteq E }[/math].

In this case, the dilation is greatly simplified, and given by

[math]\displaystyle{ (f\oplus b)(x)=\sup_{y\in E}[f(y)+b(x-y)]=\sup_{z\in E}[f(x-z)+b(z)]=\sup_{z\in B}[f(x-z)]. }[/math]

(Suppose x = (pxqx), z = (pzqz), then x − z = (px − pzqx − qz).)

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 [math]\displaystyle{ (L,\leq) }[/math] be a complete lattice, with infimum and supremum symbolized by [math]\displaystyle{ \wedge }[/math] and [math]\displaystyle{ \vee }[/math], respectively. Its universe and least element are symbolized by U and [math]\displaystyle{ \varnothing }[/math], respectively. Moreover, let [math]\displaystyle{ \{ X_{i} \} }[/math] be a collection of elements from L.

A dilation is any operator [math]\displaystyle{ \delta: L\rightarrow L }[/math] that distributes over the supremum, and preserves the least element. That is, the following are true:

  • [math]\displaystyle{ \bigvee_i\delta(X_i)=\delta\left(\bigvee_i X_i\right), }[/math]
  • [math]\displaystyle{ \delta(\varnothing)=\varnothing. }[/math]

See also

Bibliography

  • Image Analysis and Mathematical Morphology by Jean Serra, ISBN:0-12-637240-3 (1982)
  • Image Analysis and Mathematical Morphology, Volume 2: Theoretical Advances by Jean Serra, ISBN:0-12-637241-1 (1988)
  • An Introduction to Morphological Image Processing by Edward R. Dougherty, ISBN:0-8194-0845-X (1992)