And so it is now time to apply what we have learned so far, or at least some of it. For this activity we will be using an image of scattered punched paper, shown in figure 1, which we will treat like cells. The objective is to be able to estimate the area of a single cell (one punched paper)

Figure 1. Image to be processed

Part of the activity is to be able to design the program such that it will process one sub-image at a time in a loop. This could easily be done using for loop and naming each subimage properly (i.e.: name1.jpg, name2.jpg, name3.jpg, …). So we divide the image first into twelve 256X256 subimages as shown in figure 2.

Figure 2. Original image cropped into twelve 256x256 images

We then binarized the images and perform opening and closing operations to clean them up and separate as much cells from one another as possible. The results are shown in figure 3. (Review: to open means to erode then dilate an image while to close means to dilate then erode an image)

Binarized images after closing and opening

The command ‘bwlabel’ was used to label each blob on the image. By analyzing the histogram of the area of each blob, one will have an idea on the range of area measurements that are possibly single cell. Using this range, we can filter the region(s) of interest. By averaging the areas of these ROI’s we can have our best estimate for the area of a cell which was found to be 514 pixels. For reference, I cropped an image of a single cell and computed for its area which is 500 pixels. My approach obtained an error of 2.8%.

Reference cell

— to be continued