Monday, September 20, 2010

Binary Operations


    Closing and opening operations are both derived from dilation and erosion.  Closing is defined as dilation followed by an erosion using the same structuring element [1].  Opening on the other hand is closing in reverse.  It is defined as erosion followed by dilation using the same structuring element [2].  In this activity, operations such as closing and opening will be applied to facilitate separation of region of interest  (ROI) from the background in an image.


A.  Computation for the area of a single cell.
     Figure 1 shows a scanned image of punched papers.  These punched papers were imagined to be the "normal cells".  Now, the task is to measure the area of the cell.  To do this, the image was divided into 12 sub-images. Then, each sub-image was converted into a binary image with the threshold depending on its histogram values.  Figure 2 shows a sample of a binarized sub-image.


 Figure 1.  Randomly scattered "cells".

Figure 2.  Sample of a binarized sub-image.  Noisy image (left) and cleaned
image (right).

     Notice that the sub-image has grains of pixels scattered on the background.  To clean this, I applied closing and opening on the sub-images.  The strel used was a circle with a radius of 2, shown in figure 3.  Note that the area of the strel must be greater than the area of the unwanted  noise but less than the area of the normal cells.  All blobs that have a smaller area than the strel will be removed, and the blobs with higher area value will be retained [1].

Figure 3. Structuring element used for closing and 
opening operations.

     After cleaning the sub-images of noise, the function bwlabel() was used to gain access to each blob and then find the area in terms of pixels.  Notice that there are overlapping blobs, but bwlabel() considers them as one blob only.  To remedy this, an image of a single blob was taken and the area is measured.  The value of the area is 527, and from this the values of the areas of all other blobs will be compared.  If the areas of the succeeding blobs are too high or too low, they will be discarded.   Then, the average and the standard deviation were taken.  The estimated area of the cells is 516.8333+-28.89538.

B.  Isolation of enlarged cells.  
     Figure 4 shows an image of scanned punched papers with some papers larger than the others.  These larger punched papers will be treated as "cancer cells".

Figure 4.  Cells with "cancer".

     The histogram value of figure 4 was taken and it was converted into a binary image with a threshold value of 0.8.  Figure 5 shows the noisy and cleaned binary image, respectively.

Figure 5.  Noisy binarized image of the cells with cancer (top) and its
cleaned version (bottom).

     A sample cancer cell was cropped out and its area was measured.  The area has a value of 929.  From this value, the succeeding areas were compared.  And like in the first part of the activity, any area value too mush higher or lower than this will be ignored.  From the obtained values, the mean and the standard deviation was taken.  The estimated area of a cancer cell is 1006.091+-61.25758.  This range was used to eliminate blobs that have a lower or a higher area.  Figure 6 shows the filtered image.


Figure 6.  Screened cancer cells using the obtained range
of area in terms of pixels.

     Note that only two cancer cells out of five were left and the other blobs were just overlapping normal cells.  This discrepancy can be attributed to the overlapping cells having an area close to the area of the sample cancer cell.  
     Another method to separate the cancer cells is the use of the opening operation on the binarized image.  A circle structuring element with an area of 732 pixels was used, as shown in figure 7.   Any blob with an area lower than this will be eliminated, and the blobs with higher area will remain.  Since it is higher than the estimated area of the normal cells and lower than the estimated area of the cancer cells, the strel is just perfect for screening the image. Also, any blob that has a different shape to the strel will be eliminated. This would take care of the problem in the case of overlapping blobs.    Figure 8 shows the resulting image. Notice that all five cancer cells were left!!!!! :) 

Figure 7.  Structuring element used for opening of the image in figure 5.

 
Figure 8.  Screened cancer cells using opening operation.

     I would like to thank Joseph Raphael Bunao and Ma'am Jing for helping me understand this activity.  I would give myself a score of 10/10 since all of the required outputs were presented.

References:
[1]  http://homepages.inf.ed.ac.uk/rbf/HIPR2/close.htm
[2] http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm



                 




No comments:

Post a Comment