Mathematical morphology

From HandWiki
A shape (in blue) and its morphological dilation (in green) and erosion (in yellow) by a diamond-shaped structuring element.

Mathematical morphology (MM) is a theory and technique for the analysis and processing of geometrical structures, based on set theory, lattice theory, topology, and random functions. MM is most commonly applied to digital images, but it can be employed as well on graphs, surface meshes, solids, and many other spatial structures.

Topological and geometrical continuous-space concepts such as size, shape, convexity, connectivity, and geodesic distance, were introduced by MM on both continuous and discrete spaces. MM is also the foundation of morphological image processing, which consists of a set of operators that transform images according to the above characterizations.

The basic morphological operators are erosion, dilation, opening and closing.

MM was originally developed for binary images, and was later extended to grayscale functions and images. The subsequent generalization to complete lattices is widely accepted today as MM's theoretical foundation.

History

Mathematical Morphology was developed in 1964 by the collaborative work of Georges Matheron and Jean Serra, at the École des Mines de Paris, France . Matheron supervised the PhD thesis of Serra, devoted to the quantification of mineral characteristics from thin cross sections, and this work resulted in a novel practical approach, as well as theoretical advancements in integral geometry and topology.

In 1968, the Centre de Morphologie Mathématique was founded by the École des Mines de Paris in Fontainebleau, France, led by Matheron and Serra.

During the rest of the 1960s and most of the 1970s, MM dealt essentially with binary images, treated as sets, and generated a large number of binary operators and techniques: Hit-or-miss transform, dilation, erosion, opening, closing, granulometry, thinning, skeletonization, ultimate erosion, conditional bisector, and others. A random approach was also developed, based on novel image models. Most of the work in that period was developed in Fontainebleau.

From the mid-1970s to mid-1980s, MM was generalized to grayscale functions and images as well. Besides extending the main concepts (such as dilation, erosion, etc.) to functions, this generalization yielded new operators, such as morphological gradients, top-hat transform and the Watershed (MM's main segmentation approach).

In the 1980s and 1990s, MM gained a wider recognition, as research centers in several countries began to adopt and investigate the method. MM started to be applied to a large number of imaging problems and applications, especially in the field of non-linear filtering of noisy images.

In 1986, Serra further generalized MM, this time to a theoretical framework based on complete lattices. This generalization brought flexibility to the theory, enabling its application to a much larger number of structures, including color images, video, graphs, meshes, etc. At the same time, Matheron and Serra also formulated a theory for morphological filtering, based on the new lattice framework.

The 1990s and 2000s also saw further theoretical advancements, including the concepts of connections and levelings.

In 1993, the first International Symposium on Mathematical Morphology (ISMM) took place in Barcelona, Spain . Since then, ISMMs are organized every 2–3 years: Fontainebleau, France (1994); Atlanta, United States of America (1996); Amsterdam, Netherlands (1998); Palo Alto, California , United States of America (2000); Sydney, Australia (2002); Paris, France (2005); Rio de Janeiro, Brazil (2007); Groningen, Netherlands (2009); Intra (Verbania), Italy (2011); Uppsala, Sweden (2013); Reykjavík, Iceland (2015); and Fontainebleau, France (2017).

References

  • "Introduction" by Pierre Soille, in (Serra et al. (Eds.) 1994), pgs. 1-4.
  • "Appendix A: The 'Centre de Morphologie Mathématique', an overview" by Jean Serra, in (Serra et al. (Eds.) 1994), pgs. 369-374.
  • "Foreword" in (Ronse et al. (Eds.) 2005)

Binary morphology

In binary morphology, an image is viewed as a subset of a Euclidean space [math]\displaystyle{ \mathbb{R}^d }[/math] or the integer grid [math]\displaystyle{ \mathbb{Z}^d }[/math], for some dimension d.

Structuring element

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 the structuring element, and is itself a binary image (i.e., a subset of the space or grid).

Here are some examples of widely used structuring elements (denoted by B):

  • Let [math]\displaystyle{ E = \mathbb{R}^2 }[/math]; B is an open disk of radius r, centered at the origin.
  • Let [math]\displaystyle{ E = \mathbb{Z}^2 }[/math]; B is a 3 × 3 square, that is, B = {(−1, −1), (−1, 0), (−1, 1), (0, −1), (0, 0), (0, 1), (1, −1), (1, 0), (1, 1)}.
  • Let [math]\displaystyle{ E = \mathbb{Z}^2 }[/math]; B is the "cross" given by B = {(−1, 0), (0, −1), (0, 0), (0, 1), (1, 0)}.

Basic operators

The basic operations are shift-invariant (translation invariant) operators strongly related to Minkowski addition.

Let E be a Euclidean space or an integer grid, and A a binary image in E.

Erosion

The erosion of the dark-blue square by a disk, resulting in the light-blue square.

The erosion of the binary image A by the structuring element B is defined by

[math]\displaystyle{ A \ominus B = \{z\in E | B_{z} \subseteq A\}, }[/math]

where Bz is the translation of B by the vector z, i.e., [math]\displaystyle{ B_z = \{b + z \mid b \in B\} }[/math], [math]\displaystyle{ \forall z \in E }[/math].

When the structuring element B has a center (e.g., B is 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 [math]\displaystyle{ A \ominus B = \bigcap_{b \in B} A_{-b} }[/math].

Example application: Assume we have received a fax of a dark photocopy. Everything looks like it was written with a pen that is bleeding. Erosion process will allow thicker lines to get skinny and detect the hole inside the letter "o".

Dilation

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

The dilation of A by the structuring element B is defined by

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

The 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, as before, 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. In the above example, the dilation of the square of side 10 by the disk of radius 2 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 application: dilation is the dual operation of the erosion. Figures that are very lightly drawn get thick when "dilated". Easiest way to describe it is to imagine the same fax/text is written with a thicker pen.

Opening

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

The opening of A by B is obtained by the erosion of A by B, followed by dilation of the resulting image by B:

[math]\displaystyle{ A \circ B = (A \ominus B) \oplus B. }[/math]

The opening is also given by [math]\displaystyle{ A \circ B = \bigcup_{B_x \subseteq A} B_x }[/math], which means that it is the locus of translations of the structuring element B inside the image A. In the case of the square of side 10, and a disc of radius 2 as the structuring element, the opening is a square of side 10 with rounded corners, where the corner radius is 2.

Example application: Let's assume someone has written a note on a non-soaking paper and that the writing looks as if it is growing tiny hairy roots all over. Opening essentially removes the outer tiny "hairline" leaks and restores the text. The side effect is that it rounds off things. The sharp edges start to disappear.

Closing

The closing of the dark-blue shape (union of two squares) by a disk, resulting in the union of the dark-blue shape and the light-blue areas.

The closing of A by B is obtained by the dilation of A by B, followed by erosion of the resulting structure by B:

[math]\displaystyle{ A \bullet B = (A \oplus B) \ominus B. }[/math]

The closing can also be obtained by [math]\displaystyle{ A \bullet B = (A^c \circ B^s)^c }[/math], where Xc denotes the complement of X relative to E (that is, [math]\displaystyle{ X^c = \{x \in E \mid x \notin X\} }[/math]). The above means that the closing is the complement of the locus of translations of the symmetric of the structuring element outside the image A.

Properties of the basic operators

Here are some properties of the basic binary morphological operators (dilation, erosion, opening and closing):

  • They are translation invariant.
  • They are increasing, that is, if [math]\displaystyle{ A\subseteq C }[/math], then [math]\displaystyle{ A\oplus B \subseteq C\oplus B }[/math], and [math]\displaystyle{ A\ominus B \subseteq C\ominus B }[/math], etc.
  • The dilation is commutative: [math]\displaystyle{ A\oplus B = B\oplus A }[/math] .
  • If the origin of E belongs to the structuring element B, then [math]\displaystyle{ A\ominus B\subseteq A\circ B\subseteq A\subseteq A\bullet B\subseteq A\oplus B }[/math].
  • The dilation is associative, i.e., [math]\displaystyle{ (A\oplus B)\oplus C = A\oplus (B\oplus C) }[/math]. Moreover, the erosion satisfies [math]\displaystyle{ (A\ominus B)\ominus C = A\ominus (B\oplus C) }[/math].
  • Erosion and dilation satisfy the duality [math]\displaystyle{ A \oplus B = (A^{c} \ominus B^{s})^{c} }[/math].
  • Opening and closing satisfy the duality [math]\displaystyle{ A \bullet B = (A^{c} \circ B^{s})^{c} }[/math].
  • The dilation is distributive over set union
  • The erosion is distributive over set intersection
  • The dilation is a pseudo-inverse of the erosion, and vice versa, in the following sense: [math]\displaystyle{ A\subseteq (C\ominus B) }[/math] if and only if [math]\displaystyle{ (A\oplus B)\subseteq C }[/math].
  • Opening and closing are idempotent.
  • Opening is anti-extensive, i.e., [math]\displaystyle{ A\circ B\subseteq A }[/math], whereas the closing is extensive, i.e., [math]\displaystyle{ A\subseteq A\bullet B }[/math].

Other operators and tools

Grayscale morphology

Watershed of the gradient of the cardiac image

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 larger than any real number, and [math]\displaystyle{ -\infty }[/math] is an element smaller than any real number.

Grayscale structuring elements are also functions of the same format, called "structuring functions".

Denoting an image by f(x) the structuring function by b(x) and the support of g by B, the grayscale dilation of f by b is given by

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

where "sup" denotes the supremum.

Similarly, the erosion of f by b is given by

[math]\displaystyle{ (f \ominus b)(x) = \inf_{y \in B}[f(y) - b(y - x)], }[/math]

where "inf" denotes the infimum.

Just like in binary morphology, the opening and closing are given respectively by

[math]\displaystyle{ f \circ b = (f \ominus b) \oplus b, }[/math]
[math]\displaystyle{ f \bullet b = (f \oplus b) \ominus b. }[/math]

Flat structuring functions

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) = \begin{cases} 0, & x \in B, \\ -\infty & \text{otherwise}, \end{cases} }[/math]

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

In this case, the dilation and erosion are greatly simplified, and given respectively by

[math]\displaystyle{ (f \oplus b)(x) = \sup_{z \in B^s} f(x + z), }[/math]
[math]\displaystyle{ (f \ominus b)(x) = \inf_{z \in B} f(x + z). }[/math]

In the bounded, discrete case (E is a grid and B is bounded), the supremum and infimum operators can be replaced by the maximum and minimum. Thus, dilation and erosion are particular cases of order statistics filters, with dilation returning the maximum value within a moving window (the symmetric of the structuring function support B), and the erosion returning the minimum value within the moving window B.

In the case of flat structuring element, the morphological operators depend only on the relative ordering of pixel values, regardless their numerical values, and therefore are especially suited to the processing of binary images and grayscale images whose light transfer function is not known.

Other operators and tools

By combining these operators one can obtain algorithms for many image processing tasks, such as feature detection, image segmentation, image sharpening, image filtering, and classification. Along this line one should also look into Continuous Morphology[1]

Mathematical morphology 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").

Adjunctions (dilation and erosion)

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{ \emptyset }[/math], respectively. Moreover, let [math]\displaystyle{ \{ X_{i} \} }[/math] be a collection of elements from L.

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

  • [math]\displaystyle{ \bigvee_{i}\delta(X_i)=\delta\left(\bigvee_{i} X_i\right) }[/math],
  • [math]\displaystyle{ \delta(\emptyset)=\emptyset }[/math].

An erosion is any operator [math]\displaystyle{ \varepsilon\colon L\rightarrow L }[/math] that distributes over the infimum, and preserves the universe. I.e.:

  • [math]\displaystyle{ \bigwedge_{i}\varepsilon(X_i)=\varepsilon\left(\bigwedge_{i} X_i\right) }[/math],
  • [math]\displaystyle{ \varepsilon(U)=U }[/math].

Dilations and erosions form Galois connections. That is, for every dilation [math]\displaystyle{ \delta }[/math] there is one and only one erosion [math]\displaystyle{ \varepsilon }[/math] that satisfies

[math]\displaystyle{ X\leq \varepsilon(Y)\Leftrightarrow \delta(X)\leq Y }[/math]

for all [math]\displaystyle{ X,Y\in L }[/math].

Similarly, for every erosion there is one and only one dilation satisfying the above connection.

Furthermore, if two operators satisfy the connection, then [math]\displaystyle{ \delta }[/math] must be a dilation, and [math]\displaystyle{ \varepsilon }[/math] an erosion.

Pairs of erosions and dilations satisfying the above connection are called "adjunctions", and the erosion is said to be the adjoint erosion of the dilation, and vice versa.

Opening and closing

For every adjunction [math]\displaystyle{ (\varepsilon,\delta) }[/math], the morphological opening [math]\displaystyle{ \gamma \colon L \to L }[/math] and morphological closing [math]\displaystyle{ \phi \colon L \to L }[/math] are defined as follows:

[math]\displaystyle{ \gamma = \delta\varepsilon, }[/math]
[math]\displaystyle{ \phi = \varepsilon\delta. }[/math]

The morphological opening and closing are particular cases of algebraic opening (or simply opening) and algebraic closing (or simply closing). Algebraic openings are operators in L that are idempotent, increasing, and anti-extensive. Algebraic closings are operators in L that are idempotent, increasing, and extensive.

Particular cases

Binary morphology is a particular case of lattice morphology, where L is the power set of E (Euclidean space or grid), that is, L is the set of all subsets of E, and [math]\displaystyle{ \leq }[/math] is the set inclusion. In this case, the infimum is set intersection, and the supremum is set union.

Similarly, grayscale morphology is another particular case, where L is the set of functions mapping E into [math]\displaystyle{ \mathbb{R}\cup\{\infty,-\infty\} }[/math], and [math]\displaystyle{ \leq }[/math], [math]\displaystyle{ \vee }[/math], and [math]\displaystyle{ \wedge }[/math], are the point-wise order, supremum, and infimum, respectively. That is, is f and g are functions in L, then [math]\displaystyle{ f\leq g }[/math] if and only if [math]\displaystyle{ f(x)\leq g(x),\forall x\in E }[/math]; the infimum [math]\displaystyle{ f\wedge g }[/math] is given by [math]\displaystyle{ (f\wedge g)(x)=f(x)\wedge g(x) }[/math]; and the supremum [math]\displaystyle{ f\vee g }[/math] is given by [math]\displaystyle{ (f\vee g)(x)=f(x)\vee g(x) }[/math].

See also

Notes

  1. G. Sapiro, R. Kimmel, D. Shaked, B. Kimia, and A. M. Bruckstein. Implementing continuous-scale morphology via curve evolution. Pattern Recognition, 26(9):1363–1372, 1993.

References

  • 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)
  • Morphological Image Analysis; Principles and Applications by Pierre Soille, ISBN:3-540-65671-5 (1999), 2nd edition (2003)
  • Mathematical Morphology and its Application to Signal Processing, J. Serra and Ph. Salembier (Eds.), proceedings of the 1st International workshop on mathematical morphology and its applications to signal processing (ISMM'93), ISBN:84-7653-271-7 (1993)
  • Mathematical Morphology and Its Applications to Image Processing, J. Serra and P. Soille (Eds.), proceedings of the 2nd international symposium on mathematical morphology (ISMM'94), ISBN:0-7923-3093-5 (1994)
  • Mathematical Morphology and its Applications to Image and Signal Processing, Henk J.A.M. Heijmans and Jos B.T.M. Roerdink (Eds.), proceedings of the 4th international symposium on mathematical morphology (ISMM'98), ISBN:0-7923-5133-9 (1998)
  • Mathematical Morphology: 40 Years On, Christian Ronse, Laurent Najman, and Etienne Decencière (Eds.), ISBN:1-4020-3442-3 (2005)
  • Mathematical Morphology and its Applications to Signal and Image Processing, Gerald J.F. Banon, Junior Barrera, Ulisses M. Braga-Neto (Eds.), proceedings of the 8th international symposium on mathematical morphology (ISMM'07), ISBN:978-85-17-00032-4 (2007)
  • Mathematical morphology: from theory to applications, Laurent Najman and Hugues Talbot (Eds). ISTE-Wiley. ISBN:978-1-84821-215-2. (520 pp.) June 2010

External links