Applications#

The four morphological tool seen above are the elementary operations for more complex processings. In this section, we just focus on some specific processings, others are given by [Bloch 2005, chapter 6].

Top-hat transform#

The top-hat transformation (French: transformée du chapeau haut-de-forme) keeps in the image only the objects that are narrower than the structuring element. There are two dual top-hat transforms:

  • the white top-hat transform is defined as the difference between the image \(I\) and its opening by the structuring element \(E\):

    \[ T_w = I \setminus I \circ E \]

    (where \(\setminus\) is the set subtraction).

  • the black top-hat transform is defined as the difference between the closing by the structuring element \(E\) and the image:

    \[ T_b = I \bullet E - I. \]

Fig. 87 shows the effect of a white top-hat transform (only the white objects narrower than the structuring element are kept) and a black top-hat transform (only the black objects narrower than the structuring element are kept). Look that the structuring element, present in the original image, is not kept because it is not narrower as itself. The results also show lots of very small artifacts that can be easily removed by discarding the objects whose size is lower than a predefined threshold.

../_images/top-hat.svg

Fig. 87 Example of a white and black top-hat transforms with a disk or radius 3 pixels as structuring element (the latter is visible in the bottom-right corner in the original image).#

Granulometry#

Granulometry (French: granulométrie) is an approach that successively select particles of given increasing sizes in a binary image. It consists of successive openings of an image \(I\) by a sequence of structural elements \(E_k\) of increasing size (usually, \(E_k = \underbrace{E\oplus \ldots \oplus E} _{k{\mbox{ times}}}\)) where \(E\) is a disk).

At each stage of opening, the finer details are successively eliminated, and the are of the image is reduced (the area is the total number of pixels in the objects.).

Fig. 89 shows the granulometry function obtained on the binary image of Fig. 88 by openings with a disk of different sizes. When the size of the opening corresponds to the characteristic size of most objects, a jump appears in the curve.

../_images/granulometry-images.svg

Fig. 88 The original image and the corresponding openings by the successive structuring element (a disk).#

../_images/granulometry-plot.svg

Fig. 89 The granulometry function.#

Hit-or-miss transform#

The hit-or-miss transform (French: transformée tout-ou-rien) is used to detect objects of a particular shape. Contrary to the transformations seen so far, the hi-or-miss transform examines configurations where certain pixels verify a relationship with the object and others verify a relationship with the complement of the object. Thus the structuring element \(E\) of this transformation is composed of two elements \(E_1\) and \(E_2\) (disjointed but with same origin).

The result of the hit-or-miss transform is the intersection of the two sets given by:

  • the erosion of the image by \(E_1\): \(I \ominus E_1\),

  • the erosion of the image background by \(E_2\): \(I^\mathrm{c} \ominus E_2\)

The hit-or-miss transform by the two structuring elements \(E_1\) and \(E_2\) is noted \(I \otimes (E_1, E_2)\):

\[\begin{split} I \otimes (E_1, E_2) &= (I \ominus E_1) \cap (I^\mathrm{c} \ominus E_2) \\ &= (I \ominus E_1) \cap (I \oplus E_2)^\mathrm{c} \end{split}\]
../_images/hit-or-miss-toy.svg

Fig. 90 Example of a hit-or-miss transform applied on the image \(I\) by the structuring elements \(E_1\) and \(E_2\). The origin of the structuring elements are marked by the blue dot.#

Skeleton#

The skeleton (French: squelette) is a useful notion in pattern recognition: it is a “compact” form of the objects (thin lines centered in the objects), with the same number of connected components and same number of holes.

From a structuring element \(E\), let define \(\forall k \in \mathbb{N}^*\):

\[ E_k = \underbrace{E\oplus \ldots \oplus E} _{k{\mbox{ times}}} \]

The skeleton \(S(I)\) of image \(I\) is defined as:

\[ S(I) = \bigcup_{k \in \mathbb{N}^*} (I \ominus E_k) \setminus (I \ominus E_k) \circ E. \]
../_images/skeleton.svg

Fig. 91 Example of a hit-or-miss transform applied on the image \(I\) by the structuring elements \(E_1\) Skeleton.#