In this activity, we were to estimate the area of a "cell" based on images that contain "cell samples." We were to apply the binary operations we learned in Activity 8 in improving the images and estimate the area of each "cell" with pixel counts as in Activity 2.
The the images used were actually cropped subimages from the one shown in Figure 1. The image was divided into overlapping subimages in Scilab by scanning the image matrix and taking 256x256 submatrices (Figure 2).
The the images used were actually cropped subimages from the one shown in Figure 1. The image was divided into overlapping subimages in Scilab by scanning the image matrix and taking 256x256 submatrices (Figure 2).
We note from Figure 2 that there are overlaps between "cells". Figure 3 shows binarized subimages. We note that aside from the overlaps, we find "cells" that have holes and small areas in the background that are non-zero.
We eliminate the white spots on the background by eroding the image with a structuring element larger than the spots but smaller than the "cells" or regions of interest (ROIs). We have estimated the spots to be less than 20 pixels in width so structuring element element of that maximum width was used in eroding the image. A circular structuring element was used for dilation/reconstruction of circular "cells" later. Figure 4 shows the result of erosion and, as expected, all the background spots were eliminated. We also note that other "cells" that were too small were also removed. This helps in eliminating outliers (partial cells and agglomerated cells) in the area histogram later.
To put back the pixels removed due to erosion, we dilate using the same structuring element. Figure 5 shows the result of dilation.
This process of eroding and then dilating an image with the same structuring element is called the opening morphological operation. The name is justified in this activity since underlying cells in a pile (those with non-whole areas) were separated and hence eliminated from those at the top of the pile. Simply put, the bridges between cells in a pile were removed or opened.
Another interesting morphological operation, although not used in this activity, is the closing operation where you dilate and then erode an image with the same structuring element. Figure 6 shows an example of a result of the closing operator. We find that the bridges thickened and the cells are merged some more. This is why we do not use this operator for area estimation.
Another interesting morphological operation, although not used in this activity, is the closing operation where you dilate and then erode an image with the same structuring element. Figure 6 shows an example of a result of the closing operator. We find that the bridges thickened and the cells are merged some more. This is why we do not use this operator for area estimation.
After the cells have been separated, we then label each cell using the bwlabel command. This labels each cell's pixels with a number unique to that cell. We are then able to estimate the area by counting the white pixels for each cell. The Scilab code below does the labeling and the area estimation:
ctr = 1; areas = []; //compilation of areasfor i = [0:maxc-1],
for j = [0:maxr-1],
img3 = imread(path+pat+'-o-'+string(i*j+1)+'.bmp'); //import subimage
img4 = bwlabel(img3); //label each cell in subimage
for k = [1:max(img4)],
areas(ctr) = sum(img4==k); //compute area for k-th area and save in areas array
ctr = ctr + 1;
end;
end;
end;
Figure 7 shows the histogram of areas using the histplot command [histplot(length(areas),areas)].
We find obvious outliers to be those below 375 and above 600. We then eliminate these outlier and average the areas and get an estimate of 503.21224 +/- 16.609419 pixels.
amin = 475;amax = 600;
fareas = (((areas
I give myself a grade of 9 because I was able to estimate the cell area using different morphological operations.
I would like to thank Ms. Kaye Vergel, Mr. Luis Bu






















0 comments:
Post a Comment