Wednesday, July 29, 2009

A9 Binary Operations

In this activity, we are tasked to get the best estimate of one "cell". As can be noticed some of these cells are overlapping or incomplete. This task will therefore take all that we have learned so far to get a pretty good estimate of the area.


First, we cropped the image into 12 subimages.

Next we used im2bw to threshold the image and separate background from the cells.

From the image above, we can see thatsome parts of the background were still included. We remove this noise but still preserve the area of the larger pixels by doing morphological cleaning. This is done by first applying erosion to remove the small dots and then performing dilation to restore the cells into their original sizes. The structuring elements should be large enough to remove the dots but not the cells. The structuring element that I used is
se1=zeros(9,9);
se1(:,4:6)=1;
se1(4:6,:)=1;

Next I performed closing on the images by first dilating then eroding the image. The structuring element that I used is a cross three pixels long and 1 pixel thick.
I used bwlabel to name each contiguous blob and did pixel summing for the area. The histogram of the areas is




We can see that the spread is very large. Knowing that the very large or very small areas are from the overlapping and incomplete cells respectively, we can safely limit our histogram to the most likely areas which are in this case 400 to 600 pixels



From here we can get



best estimate of area = 524.90909
standard deviation = 35.852444

Cropping some single random cells, I found that their areas range from 519 to 525, so my estimate is correct.
It is also possible to remove the overlapping cells, by opening to remove the individual cells and leave just the overlapping cells. If we subtract this to the original binary image, what will be left are just the non-overlapping cells. However I have yet to find the right, structuring element to do this.

I give myself a grade of 10 because, I was able to get a good estimate of the area and and a standard deviation that is just 6.83% of the mean.




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

No comments:

Post a Comment