A8: Morphological Operations

In this activity, we are to demonstrate the effect of different morphological operations on images. By morphological operations we mean treatments done on binary images that make use of Set Theory. From our knowledge on set operations, we are able to erode and dilate an image (set A) with a structuring element (set B). These operations involve scanning through the edges of set A with set B and removing the intersection of these sets for erosion and taking the union of these sets for dilation. This may be visualized better from Figure 1. The blue regions represent the intersection of set A (triangle with thick edges) and set B (square) removed in erosion to form the small inner triangle. The pink regions, on the other hand, represent the added part due to the union of set A and set B in dilation to form the larger outer shape.


Figure 1. Blue regions show the intersections of the triangle and the square. Pink regions show the area contributed by the square in its union with the triangle.

Before simulating anything, we were to predict erosion and dilation results for different shape and structuring element pairs. Figure 2 shows the rough predictions with rough sketches while Figure 3 shows the final predictions. :) (click on images to enlarge)

Figure 2. Rough predictions and sketches.


Figure 3. Final predictions and sketches.

The next sets of images are results of Scilab's erode and dilate functions. Predictions were accurate except for the dilation of the circle and the erosion of the hollow square with a cross for a structuring element.

For all figures:
TOP: original shape
MIDDLE: shape eroded by (left to right) 4x4 square, 2x4 rectangle, 4x2 rectangle, and 5px long and 1px thick cross
BOTTOM: shape dilated by the same structuring elements used in erosion




OBJECT: 50x50 square




OBJECT: triangle with base = 50px and height = 30px




OBJECT: circle with radius = 25px




OBJECT: hollow 60x60 square with thickness = 4px




OBJECT: cross 8px thick and 50px long

Scilab also has other morphological operations such as skel and thin built-in (Figure 4). Skeletonization elimintates the boundaries of an object while making sure that the object does not break into separate pieces. Thinning reduces all lines to only 1px in thickness.



Figure 4. Results of skel (top) and thin (bottom) for square, triangle, circle, hollow square, and cross.

I give myself a grade of 9 in this activity because the predictions were accurate except for a few lapses in using a cross for a structuring element. And speaking of lapses, I have forgotten who to thank for this activity, so thank you to all concerned. :D

EDIT: Thank you Ms. Cherry May Palomero for taking a picture of my final predictions! :)

0 comments:

Post a Comment