Tuesday, July 15, 2008

A8 - Morphological Operations

Morphology refers to shape or structure. In image processing, classical morphological operations are treatments done on binary images, particularly aggregates of 1's that form a particular shape, to improve the image for further processing or to extract information from it. All morphological operations affect the shape of the image in some way, for example, the shapes may be expanded, thinned, internal holes could be closed, disconnected blobs can be joined.

In this activity, we learned two basic morphological operations done on images --- DILATION and EROSION.

From Dr. Soriano's lecture notes, dilation is defined as follows.



On the other hand, erosion operator is defined as



From these definitions, we predicted the outcome of an image after dilating and eroding it with certain structuring elements.

We used the following binary images as test objects:

square (50×50)
triangle (base = 50 , height = 30)
hollow square (60×60, edges are 4 pixels thick)
plus sign (8 pixels thick and 50 pixels long for each line)
circle (radius 25)


The structuring elements used are shown below.
1. 4×4 ones
2. 4×2 ones
3. 2×4 ones
4. cross, 5 pixels long, one pixel thick.



We then check our predictions using SciLab's dilate and erode functions.

DILATION
The dilation results for each structuring element is shown below







EROSION
The erosion results for each structuring element is shown below







THIN
According to SciLab:
thin - thinning by border deletion
Function thin performs thinning of binary objects. It uses the Zhang-Suen, a de facto standard and simple technique. The resulting image, the skeleton, is not always connected and is very sensible to noise. For thin shapes, it should work faster and provide better quality. You will need some pruning criterium to eliminate spurs.



SKEL
According to SciLab:
skel - skeletonization, thinning, Medial Axis Transform
Function skel performs skeletonization (thinning) of a binary object. The resulting medial axis is multi-scale, meaning that it can be progressively pruned to eliminate detail. This pruning is done by thresholding the output skeleton image.
The algorithm computes skeletons that are guaranteed to be connected over all scales of simplification. The skeletons are computed using the euclidean metric. This has the advantage to produce high-quality, isotropic and well-centered skeletons in the shape. However the exact algorithm is computationally intensive.




-o0o-
Notes:
The predictions were visualized and written in a piece of paper. I'll try to scan them for posting and for comparison as well. For now, I could only say that some of my predictions, as to what the outcome of the image looked like after dilation and erosion using the given structuring elements, did not match the simulation done in SciLab. I would say 70% of my predictions were correct. I had difficulty especially with predicting images after erosion. Also, I wasn't so sure about my prediction in using the cross structuring element.
With all these reasons and knowing that I'd only predict roughly 70% of the outcome of the images, I give myself a 7/10 for this activity.

-o0o-
Collaborators:
Thank you JC Nadora, Jeric Tugaff, Toni Lei Uy, Benj Palmares, Cole Fabros, Ed David, Angel Lim, Mark Bejemino for the invaluable discussions regarding erosion and dilation, especially with prediction. More thanks to Ed for pointers in drawing the test objects in GIMP. (I was doing it in Paint with so much difficulty so he showed me how to do it easily.)

No comments: