Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

(binary=applications)=

Applications

The four morphological tools seen above are the elementary operations for more complex processing. In this section, we 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 II and its opening by the structuring element EE:

    Tw=I∖I∘E.T_w = I \setminus I \circ E.
  • The black top-hat transform is defined as the difference between the closing by the structuring element EE and the image:

    Tb=I∙E∖I.T_b = I \bullet E \setminus I.

Figure 1 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). Note that the structuring element, present in the original image, is not kept because it is not narrower than itself. The results also show many of very small artifacts that can be easily removed by discarding the objects whose size is smaller than a predefined threshold.

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

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

Granulometry

Granulometry (French: granulométrie) is an approach that successively selects particles of increasing sizes in a binary image. It consists of successive openings of an image II by a sequence of structural elements EkE_k of increasing size (usually, Ek=E⊕…⊕E⏟k timesE_k = \underbrace{E\oplus \ldots \oplus E} _{k{\mbox{ times}}}) where EE is a disk).

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

Figure 3 shows the granulometry function obtained on the binary image of Figure 2 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.

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

Figure 2:The original image and the corresponding openings by the successive structuring element (a disk).

The granulometry function.

Figure 3: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 hit-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 EE of this transformation is composed of two elements E1E_1 and E2E_2 (disjoint but with the 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 E1E_1: I⊖E1I \ominus E_1,

  • the erosion of the image background by E2E_2: Ic⊖E2I^\mathrm{c} \ominus E_2

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

I⊗(E1,E2)=(I⊖E1)∩(Ic⊖E2)=(I⊖E1)∩(I⊕E2)c\begin{align*} 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{align*}
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.
Some white pixels in I^\mathrm{c} \ominus E_2 comes from the background outside I^\mathrm{c} which is considered as white.

Figure 4:Example of a hit-or-miss transform applied on the image II by the structuring elements E1E_1 and E2E_2. The origin of the structuring elements are marked by the blue dot. Some white pixels in Ic⊖E2I^\mathrm{c} \ominus E_2 comes from the background outside IcI^\mathrm{c} which is considered as white.

Skeleton

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

From a structuring element EE, let us define ∀k∈N∗\forall k \in \mathbb{N}^*:

Ek=E⊕…⊕E⏟k timesE_k = \underbrace{E\oplus \ldots \oplus E} _{k{\mbox{ times}}}

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

S(I)=⋃k∈N∗(I⊖Ek)∖(I⊖Ek)∘E.S(I) = \bigcup_{k \in \mathbb{N}^*} (I \ominus E_k) \setminus (I \ominus E_k) \circ E.
Skeleton of the image I.

Figure 5:Skeleton of the image II.