Activity 10: Applications of Morphological Operations - Looping through Images
From the previous two activities, several applications of morphological operations were demonstrated. It was used to pre-process text, as well as play notes (music). In this this activity, I will try to show using previously used methods (mainly morphological operations) to determine the best estimate of area of a simulated "normal cells".
For preview, a "normal cell" has a specific size, while cancerous cells are usually larger, or smaller than the normal cells as shown in the figure below.
Image processing is ideal for repetitive process and as such, we note that for us to be able to "see" the cells properly, they must be enlarged (or zoomed in). this therefore presents the problem that a "whole slide" must be examined instead of just a part. As such, we divide the large image into subimages where identifying "cancerous cell" will be repeated for each subimage, instead of applying to the whole image.
This is much similar to actual cancer screening where it would require several samples from the subject before confirming whether there is indeed cancer or not.
The image was initially cut up into 256x256 pixel subimages using Scilab. The resulting sub-images are shown below.
The images were then binarized by analyzing the threshold to separate the background from the cell. The image was initially "cleaned" by using the maximum value in the histogram. However it was noted that this was not enough since some unnecessary parts were still present. Morphological operations were applied too to further "clean" the image. Afterwhich, the function SearchBlobs() were used to identify the blobs that were finally present. Since we know that the cells (cancerous or not) showuld be more than a number of pixels, the function FilterBySize was used to remove smaller blobs. The resulting subimages are shown below.
The function SearchBlobs() essentially assigns a number to a specific blob, thus successfully grouping them together. The area for each blob was then listed in an array. These were all applied to each of the subimage made.
The final result would be an array containing all the areas of the blobs that were identified for all sub-images. The histogram of the array was then plotted to identify the best estimate for the area of a "normal" cell. This is shown in the figure above. It is noted that though some cells are on top of the other, some are scattered. Therefore using this as reference, we can let the area bin with the greatest number of counts to be the best estimate. The area bin with the greatest number of counts was approximately 517 pixels. From the histogram, there were a few cells identified 2 bins from it before it became zero counts.
We now binarized and applied morphological operations on the image to get the regions of interest only. The resulting image after processing it is shown below.
It is noted that there are 5 cells that are slightly larger, and there are some that are chipped after "cleaning" the image. Applying the same method with that of the previous processing, the histogram for the area of the blobs is shown below.
We have initially identified area of each cell was approximately 517 pixels. I considered two cases for the best estimate, that is 1 bin, and 2 bins away from 517 pixels. Having 74 pixels difference for each bin step, we now considered 2 best estimates: 517±74 pixels and 517±148 pixels. Now, we can isolate the cells having these areas which are shown below.
We now consider 2 cases for the cancer cells as well. First, the cancer cells were identified to be within the range of 2-8 bins more (667-1112 pixels), and those that are small than 2 bins less (<370 pixels). The resulting image for the isolated cancer cells is shown below. It was noted that the 5 larger cells were successfully identified. The "halved" cell was also successfully identified.
However, if we consider the cancerous cells to be within the range of 1-8 bins more (593-1112 pixels), and those that are small than 1 bins less (<445 pixels), there will be a difference result as shown in the next image. It was noted that the 5 larger cells, and the "halved" cell were successfully identified as well however some cells that were chipped were also identified.
It was a challenging activity since we want to see several things. However it was very fascinating since I was able to see whichever cell I want to see depending on what I want to see. For this activity, I give myself a 10/10 for producing the desired result which is to isolate the cancer cells.
For preview, a "normal cell" has a specific size, while cancerous cells are usually larger, or smaller than the normal cells as shown in the figure below.
Image processing is ideal for repetitive process and as such, we note that for us to be able to "see" the cells properly, they must be enlarged (or zoomed in). this therefore presents the problem that a "whole slide" must be examined instead of just a part. As such, we divide the large image into subimages where identifying "cancerous cell" will be repeated for each subimage, instead of applying to the whole image.
This is much similar to actual cancer screening where it would require several samples from the subject before confirming whether there is indeed cancer or not.
Getting the best estimate of "normal" cells
For the simulation of such, the image below (filename: Circles002.jpg) was used to determine the best estimate of the "normal cell" size.![]() |
| Original image (with "normal" cells) |
![]() |
| Original Image (with "normal cells) as divided into subimages |
![]() |
Binarized original Image (with "normal cells) as divided into subimages |
![]() |
| Histogram of areas of the subimages of original image (50 bin) |
Identifying "cancerous" cells
Now, we were given an image with "cancerous" cells (refer to image below). We identify this as the cells that are smaller or larger than that of the "normal" cell. We take into account that some cells are overlapping each other. As such, we consider only a range for the larger cells and eliminate the too large areas.![]() |
| Image with "cancer" cells |
![]() |
| Binarized image with "cancer" cells |
![]() |
| Histogram of areas of blobs in image (with "cancer" cells) |
![]() |
| Identified "normal" cells with best estimate of 517±74 pixels |
![]() |
| Indentified "normal" cells with best estimate of 517±148 pixels |
![]() |
| Identified "cancerous" cells (case 1) |
![]() |
| Identified "cancerous" cells (case 2) |











Comments
Post a Comment