Dilation and Erosion
Dilation and erosion was performed by hand on a graphing paper. The initial shapes and structuring elements are outlined in red, while the results are outlined in blue. In the structuring element, we first chose a pixel to use as the “origin”. We reflect the image about this origin.
For Dilation, we move the element around the shape, such that the origin remains in the shape. The combined outlines of the structuring element as it moves through the shape is the Dilation.
Dilation
For Erosion, we move the element around the shape, such that the element remains in the shape. The shape traced out by the origin is the Erosion of the shape due to the element.
Erosion
In general, we can say that Dilation makes the shape bigger, while Erosion makes the shape smaller.
Computer Simulation
Dilation
Erosion
I performed Dilation and Erosion in Scilab using the IPD toolbox. The results I obtained were consistent with my hand drawn Dilations and Erosions.
Cancer Cell Detection
The image file Circles.jpg
was first binarized by setting a threshold value. The binarized image was then cleaned of small white dots using OpenImage, and holes in big circles were filled using CloseImage. The result is shown below (as a whole image, not the subimages). The image was segmented into subimages so that better thresholding can be applied on the different areas of the image, which may not be uniformly illuminated.
From this, we can measure the best estimate for “normal cells”. We used SearchBlobs first, and then filtered the results to remove obviously large and small cells by area. Small cells would be less than 300 in area. Big cells will be above 600. After this filtering we get
mean = 492
stdev = 49.7
From the mean and standard deviation, we used the same process to binarize Circles with cancer.jpg
. Using SearchBlobs, we removed blobs which fit the best estimates for a normal cell. This leaves us with our abnormal cells, shown in the image below.