This activity is about some morphological operations: erosion and dilation. We were tasked to hand-draw the effect of erosion and dilation on particular images. Predicted sketches were compared to the generated image from erode( ) and dilate( ) functions in Scilab.
Erosion of an image A by structuring element B is denoted by
where Bz is the translation of B by z. The structuring element dictates the shape of the original image. It generally shrinks the size of the image.
On the other hand, dilation is denoted by
Dilation increases the shape of the original image according to the structuring element.
To see the effects of erosion and dilation, different shapes were drawn and eroded by different structuring elements. Figure 1 shows the shapes that were drawn while Figure 2 shows the structuring elements used for each shape.
Figure 1. Shapes to be eroded: square, triangle, hollow square, and plus sign |
Figure 2. Structuring elements: 2x2 ones, 2x1 ones, 1x2 ones, cross, diagonal |
Figure 3. Predicted effect of erosion(1st row) and dilation(2nd row) on a square |
Figure 4. Predicted effect of erosion(1st row) and dilation(2nd row) on a triangle |
Figure 5. Predicted effect of erosion(1st row) and dilation(2nd row) on a hollow square |
Figure 6. Predicted effect of erosion(1st row) and dilation(2nd row) on a plus sign |
Lastly, the predicted images were compared to the output images generated by Scilab. Fortunately, the SIP toolbox has the functions erode( ) and dilate( ). It was quite easy then. Figure 7 to Figure 10 displays the output images when the shapes in Figure 1 were eroded and dilated by the structuring elements seen in Figure 2.
Figure 7. Output images when square was eroded(1st row) and dilated(2nd row) by the structuring elements |
Figure 8. Output images when triangle was eroded(1st row) and dilated(2nd row) by the structuring elements |
Figure 9. Output image when a hollow square was eroded(1st row) and dilated(2nd row) by the structuring elements |
Figure 10. Output image when plus sign was eroded(1st row) and dilated(2nd row) by the structuring elements |
It can be clearly seen that the predicted images matched the output images generated from Scilab.
Reference:
[1] Soriano, M. A7 - Morphological Operations. 2012
Self-evaluation:
I will give myself a grade of 10/10 for understanding the concept of erosion and dilation. I was also able to present all the necessary output clearly.
No comments:
Post a Comment