This activity culminates various techniques that we have learned before for area estimation of "cells". This enables us to sort out possible "cancerous cells" via image manipulation.
Figure 1. Image of sample "cells"
(1)
(2)
Closing (eq. 1) is done by erosion of matrix A with pattern B, then the resulting image is dilated with pattern B. Reversing the process constitutes to opening (eq. 2).Operating these two methods on Fig. 1 yielded Fig. 2:
Figure 2. Result of performing opening and closing of the image in Fig. 1.
Note that the image was divided to 7 segments to have different ROIs.
Fig. 2 was generated by using a circle (r=10px) as erode()/dilate() pattern. Fig. 2 shows that opening is more viable for our image since we want to improve gap areas and to have a better view on the stacked cells. It also removed some deformed images, due to erosion being the first operator for open. Closing though could possibly improve cut segments. To find the average area of the cells, I have selected the Opened images row 1,3 and 4. These were the ones selected since the separation between the cells are, at most well, defined. Using bwlabel() to separate closed clusters of data, the averaged value is 520px/cell.
Finally, we tackle the 2nd image for this activity. This time, our image has 5 cells that are bigger than the rest. To separate these, we implement this process:
- Convert image to black and white
- Perform opening transform
- Using bwlabel(), obtain the average cell size
- Those clusters that exceed the average value are zeroed out.
This method returns an image that has only the cancerous cells retained, thus easily identifying them based from the original image.
Figure 3. Image a)after and b) before operating open. The pattern was a circle with radius of 14px.
Fig. 3 shows the transformed image. The transformation actually cleaned the black and white converted image, because there were some remnant white blots due to the thresholding.
Figure 4. a) Before and b) after filtering the opened image.
Self-Assessment: 9/10