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 a binary image, all pixels which are “OFF” or have value equal to zero are considered background and all pixels which are “ON” or 1 are foreground.
Source: M. Soriano, A8 - Morphological Operations.pdf
In this activity, we will investigate two kinds of morphological operations: dilation and erosion. These have functions in Scilab and we will apply them to simple geometric shapes for now.
(1) Dilation
In set theory,

(2) Erosion
The erosion operator is defined by

We apply this to 5 shapes: 50x50 pixel square, triangle (50 pixel base, 30 pixel height), circle with radius 25, hollow square (60x60 pixels with 4 pixel wide edges), and plus sign (8 pixels wide and 50 pixels long) using 4 different structuring elements, namely, 4x4 square, 2x4 rectangle, 4x2 rectangle, and a 5 pixel long, 1 pixel thick cross. We have already predicted the outcome of this operation on these images and we will now verify them using Scilab. The predictions are submitted separately on a sheet of yellow pad paper.
ORIGINAL SHAPES





i) SE = 4x4 square
DILATE





ERODE





ii) SE = 2x4 rectangle
DILATE





ERODE





iii) SE = 4x2 rectangle
DILATE





ERODE





iv) SE = 5 pixels long, 1 pixel wide cross
DILATE





ERODE





(3) THIN
Function thin performs thinning of binary objects. The resulting image, the skeleton, is not always connected and is very sensible to noise. It is also slower than a good skeletonization algorithm (see skel). For thin shapes, it should work faster and provide better quality.





(4) SKEL
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.





____________________________________________________________________
I give myself 9 points for this activity because some of the predictions were wrong especially in the erosion part. Thanks to Julie Dado, Angel Lim, Lei Uy, JC Nadora, Jeric Tugaff, and Mark Leo Bejemino for their help in the predictions in this activity.
0 comments:
Post a Comment