For this activity, we focus on the morphology or the shape and structure of objects in images. According to our AP186 Activity 10 handout [1] we will work with binary shapes and perform morphological operations on them, essentially changing their form and shape [2]. The morphological operations will allow us to further process or extract information from the image [1]. In particular, we will investigate the dilation and erosion morphological operations.
Morphological Operations
As mentioned above, morphological operations manipulate the shape or structure of objects in images in the interest of processing or extracting information. There are two principal morphological operations: dilation, and erosion [2]. Both operations involve overlaying a structuring element B over the image A, which in this case is binary, and then sliding B over A [2].
(Note that in source [2], the background is white or value 1 while the object is black or value 0. In this activity, our background is black while the object is white. We use the activity's color scheme for the discussion below.)
For dilation, when the origin of B is on a black (or background) pixel, there is no change made to A [2]. However, when it lands on a white (or object) pixel, we convert all pixels within the structuring element from black to white, such that new pixels will be added to the object [2].
For erosion, when the origin of B is on a black (or background) pixel, there is no change made to A [2]. But if it lands on a white (or object) pixel with B laying over at least one black pixel, the origin of B is converted from white to black, such that pixels will be removed from the object [2].
Prediction
Knowing the above concepts about dilation and erosion, I make a hand-drawn prediction of the effect of dilation and erosion on the shapes in Figure 1.
Figure 2 and 3 show the predictions for dilation.
![]() |
| Figure 2. Hand-drawn prediction for dilation. The orange color shows the original shape while the blue color shows the added pixels. |
![]() |
| Figure 3. Hand-drawn prediction for dilation. The orange color shows the original shape while the blue color shows the added pixels. |
Figure 4 is the hand-drawn prediction for erosion of the shapes.
![]() |
| Figure 4. Hand-drawn prediction for erosion. The orange color shows the original shape while the outline shows the removed pixels. |
Numerical Image Processing
Figures 5 and 6 show the resultant images from morphological processing using MATLAB. We can see that my predictions are the same as the resultant images, which is a good sign. :D Yay!
![]() |
| Figure 5. Result of dilation using the structuring element in the 1st column, for the figures: (left to right) square, triangle, hollow box, and cross. |
![]() |
| Figure 6. Result of erosion using the structuring element in the 1st column, for the figures: (left to right) square, triangle, hollow box, and cross. |
Grading
Based on the criteria given, I give myself 8/10 for a few missing pieces in the activity and a lackluster discussion. :(






No comments:
Post a Comment