Wednesday, July 22, 2009

Acitivity 9: Binary Operations

In biomedical fields, cells from sample slides are classified through its size or area. For this purpose, image processing can be applied. In this activity, we were asked to estimate the area of a punched paper given an image.

Area estimation was done by first cutting the image into 256 x 256 subimages. To be able to get a more accurate estimated area, I decided to cut the image into 30 subimages since image cutting was programed in Scilab. After cutting the image, the next step was to convert the grayscale images (the original image was converted to grayscale first before cutting was done) into binary images. This was done by thresholding. A single treshold value was used for all the images since a uniform illumination throughout the original image was assumed. Here is one of the 30 subimages used.
After binarization..
As can be observed, the binarized image is not that "clean". To be able to "clean" it morphological operations must be used. Equipped with the knowledge of the previous activity, erosion and dilation are applied to the images. This was done by creating a opening function in Scilab. Opening can be described as the process of erotion followed by dilation. The structuring element used is a disk that is larger than the noise but must be smaller than the size of the punched papers.

The image above is the resulting image after applying opening into the binarized image. As can be observed the pepper noise found in the first binarized image is now gone. This is because in opening, the image is first eroded then afterward dilated. Since the size of the structuring element used is bigger than the noise and is smaller than the object, all objects with size smaller than the structuring element will be turned into background. The process was done for all the remaining 29 images.

The goal in this actiity is to estimate the area of a single blob, to be able to do this, the function bwlabel was used. The input of this fuction is a binary image and what it does is it labels an object(region of 1). Using this function, the area of each object in the 30 images were calculated through pixel count. The historgram of the areas calculated is given below.
From the histogram, the outliers can be easily distinguised. These outliers are the area of the blobs that are close to each other that they were seen as a single object, or the blobs that became smaller after opening was implemented. These outliers can be filtered. In this case, only areas ranging from 500 to 580 were considered.

From the filtered histogram, it was estimated that the area of a blob is 513.17 ± 23.33 pixels.

For this activity, I will give myself a grade of 10 for I was able to do all the required tasks.

I thank Jica Monsanto for discussing with me this activity.

1 comment: