Archive for September 8, 2010

Morphological Operations

Mathematical morphology is a theory and technique for the analysis and processing of geometric structures, based on set theory, lattice theory, topology, and random functions [1]. It is the foundation of morphological image processing, which consists of a set of operators that transform images.

Morphological operations are used to understand the structure or form of an image [2]. They apply a structuring element of arbitrary shape to an input image, to produce an enhanced image. The most basic morphological operations are dilation and erosion. Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries [2]. In both processes, the transformation of the object depends on a certain shape called structuring element.

For this activity, the objects to be dilated and eroded are shown in Figure 1 whereas the structuring elements used are shown in Figure 2.

Figure 1. Objects to be dilated and eroded.

Figure 2. Structuring elements. The colored boxes refer to the origin used for dilation and erosion.

Dilation

When the origin of a structural element is positioned at a given point on the object, it attaches itself to that point such that it adds pixels to the boundary of the object. The images below show different objects and the result of their dilation by different structuring elements. My predictions match those of Scilab’s dilate() outputs. The yellow blocks depict the original shape of the object.

Figure 3. Dilation of a 5x5 square with the structuring elements. My predicted outputs (upper images) match the outputs using Scilab (lower images).

Figure 4. Dilation of a 3x4 triangle.

Figure 5. Dilation of a cross.

Figure 6. Dilation of a hollow square.

Erosion

If, when positioned at a point on the object, the structuring element is included in the object, then this point will appear in the result of the transformation, otherwise not. The following images show the results of erosion of the objects by different structuring elements. Again, the predicted outputs matched Scilab’s erode() outputs. The pink blocks correspond to the transformed image.

Figure 7. Erosion of a 5x5 square.

Figure 8. Erosion of a 3x4 triangle.

Figure 9. Erosion of a cross.

Figure 10. Erosion of a hollow square.

Other morphological functions available in Scilab are skel() and thin(). The skel function performs skeletonization of a binary image such that its foreground regions are reduced to a skeletal remnant that preserves the extent and connectivity of the original region. The thin function performs thinning of binary objects by reducing all lines to single pixel thickness.

Figure 11. Objects after applying skel function of Scilab.

Figure 12. Objects after applying thin function of Scilab.

References:

[1] http://en.wikipedia.org/wiki/Mathematical_morphology

[2]http://www.mathworks.com/access/helpdesk/help/toolbox/images/f18-12508.html


I give myself 9/10 for this activity.


Design a site like this with WordPress.com
Get started