Activity 9 – Morphological Operations

In this activity, different patterns were made though they ought to be hand-drawn, I constructed them in Microsoft excel . The pattern are binary and they are as follows: a 5×5 square, a triangle with base of 4 units and hight of 3units, a hollow 10×10 square of 2 units in thickness and a plus sign whose thickness is 1 unit and length of 3 units. The unit chosen is the dimension of a single cell in excel. Then smaller patterns are made and they will serve as the structuring elements to the larger patterns which were initially constructed. They are as follows: a 2x2ones, 2x1ones, 1x2ones, a cross 3 pixels in length and 1 pixel in width and a diagonal line in a 2×2 matrix oriented leaning to the right. For a clearer representation of these patterns, the figure below shows the patterns made.

Patterns to be structured(1st row) & structuring patterns(2nd row)

Now, each of the smaller patterns were eroded and dilated with the larger patterns. The figures below shows the erosion in the first row and dilation in the second of 5×5 square, triangle, hollow square and plus sign respectively with 2x2ones, 2×1 ones, 1x2ones, cross and diagonal line respectively from left to right. These patterns were done in excel and they will later on be checked against the dilation and erosion function in scilab.

5x5 square eroded(1st row) & dilated(2nd row) using the different structuring elements

Triangle eroded(1st row) & dilated(2nd row) using the different structuring elements

Hollow square eroded(1st row) & dilated(2nd row) using the different structuring elements

Hollow square eroded(1st row) & dilated(2nd row) using the different structuring elements

Plus sign eroded(1st row) & dilated(2nd row) using the different structuring elements

The concept of erosion as I used it in the above figures can be interpreted as decking out in every cell of the larger figure the smaller patterns. The center of which coincides with every cell of value 1 (or cell with the lighter color). We note here that the center of a figure varies depending on the symmetry. If the pattern is in an odd square matrix, the center is the geometric center while if even, the center is on the uppermost left cell of the matrix. Erosion happens when the pattern does not fit onto the designated shape, so the corresponding cell is transformed to zero; otherwise, it will retain its value.However, dilation happens when the pattern does not fit onto the shape of the larger pattern, if it happens, the borders of the larger pattern will have to adjust its shape such that it will now fit on each cell of the larger figure.

Now, designing the elements to be structured and the structuring elements putting the operations in scilab will produce the following. The presentation below is transformed in a matrix of 1’s and 0’s since they will be easier to visualize since if i use the ‘imshow’ function in scilab, some patterns will be very small to be presented.

First is the erosion and dilation of the same 5×5 square with the same set of structuring elements:

Next is the erosion and dilation of a triangle with the same set of structuring elements:

Also, there is erosion and dilation of a hollow square with the structuring elements:

And finally, there is erosion and dilation of plus sign with the structuring elements:

There is no observed difference for the structured patterns in the manual and the automated morphological operation. This high degree of similarity is due to the fact that I first ran a few dilation and erosion operations in scilab to study how these operations work. And the rest of the operations was purely prediction.

Likewise, different operations like the thinning and skeleton was studied. I constructed a polygon and an oblong and see what would be the difference if i implemented thin and skel function to it.

Arbitrarily constructed shapes where thin and skel function will be implemented

Image after applying thin function to it

Image after applying skel function to it

I observed that skel function produces a more continuous ‘downsizing’ of the image and it focuses on finding the central shape of any image and it peaks out its value there, unlike thin function which i rather find too difficult to interpret.

I would probably give myself a grade of 9, since i got all the manual morphological operations to match with the automated one. So much time has been done to manually execute the dilation and erosion functions. But I wasn’t able to fully expound on the concept of thin and skel.

About jrafrica

applied physics student
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment