Thursday, August 6, 2009

Morphological Operation


Align Center

In image processing, it is very important to get a full detail of the image. In some cases such as normalization of images and eye feature extraction, morphological operations are very essential [1]. Morphology refers to the form, structure, shape, size, texture, and phase distribution of objects and images [2].

Since an image could be defined as an amplitude function consisting of a collection of either continuous or discrete coordinates [3], it contains pixels that are needed to be distinguished from the background. These pixels which occupy the region of interest can be separated using different morphological operations such as erosion and dilation.

Dilation of an A by B is denoted as:


which involves all z’s which are translations of reflected B, that when intersected with A is not the empty set. B is called the structuring element. In general, dilation causes an object to expand or elongate following the shape of the structuring element.

On the other hand, erosion is defined as:

which involved all z’s such that B translated by z is contained in A. The general effect of erosion is to shrink or reduce the image by the shape of the structuring element B [4].

In this activity, dilation and erosion are performed to different binary images, namely a square (50×50) , a triangle (base = 50 , height = 30), a circle (radius 25), a hollow square (60×60, edges are 4 pixels thick), and a plus sign (8 pixels thick and 50 pixels long for each line).

The different structuring elements used are shown below.



The succeeding figures shows what happen after eroding and dilating the images with the structure elements.




Figure 1. Dilation (first row) and erosion (second row) of the circle. The first image of each row shows the original image.



Figure 2. Dilation (first row) and erosion (second row) of the square. The first image of each row shows the original image.



Figure 3. Dilation (first row) and erosion (second row) of the triangle. The first image of each row shows the original image.



Figure 4. Dilation (first row) and erosion (second row) of the hollow square. The first image of each row shows the original image.



Figure 5. Dilation (first row) and erosion (second row) of the cross. The first image of each row shows the original image.

It can be observed from the figures above that the statement regarding the general effect of dilation and erosion has been satisfied. For the case of dilation, the image expands depending on the structuring element used. The dilation using 4 x 4 square matrix of one as the structuring element results to the uniform expansion of the image (white color) in all sides. However, using a 2 x 4 and 4 x 2 ones yields to the enlargement of the image in the vertical and horizontal sides, respectively. Finally, using the cross as the structuring element results to the expansion of the image in all sides except at the corners.

For the case of erosion, the same thing happen, only that instead of expansion or the addition of pixels, shrinking or elimination of some pixels in the sides of the images occurs. Taking a look at the effect of erosion on the hollow square, it is noticed that the 2 x 4 matrix structuring element reduces the number of pixels in the left and right side of the image, while the 4 x 2 structuring element shrinks the top and bottom side. Also, it is interesting to note that only the four pixels at the corners of the hollow square remains after eroding it to the cross structuring element.

My predictions for the new images yielded after applying erosion and dilation using the four structuring elements above are correct only for the part of the dilation of the images using the first three structuring elements. I had a hard time imagining for the output of the dilation and erosion of the images using the cross as the structuring element.

After exploring and applying the "skel" function from Scilab in the five images, I arrived at the following outputs below.


Figure 6. Resulting images after applying "skel" function.

For this activity, I give myself a grade of 9 because I failed to predict the dilation and erosion of the the images using the cross as the structuring elements.

References:
1. http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Techniqu.html
2. http://en.wikipedia.org/wiki/Morphology
3.
http://inperc.com/wiki/index.php?title=Special:Whatlinkshere/Dilation_and_erosion
4. “Morphological operations”, Applied Physics 186 Activity 8 Manual.





No comments:

Post a Comment