Morphological Operations

Application

Consider the test image below. It is a scanned image of small paper circles (the kind that you get from a puncher). These small circles represent cells. The goal is to get the best estimate (mean and standard deviation) of the cell size. Why is cell size important? The size can tell you if a cell is normal, cancerous (large) or ill (small). Hence, if you know the likely cell size, you can isolate and count the cancer cells, allowing doctors to monitor the status of cancer patients.

Circles002
Test Image of “cells”

The problem with the image above is that a lot of “cells” are either touching or overlapping altogether, which makes measuring the area difficult. A solution to this is to use morphological operations to clean the image and isolate the cells from one another.

Methodology

  1. Divide the image into 20 256 x 256 overlapping sub-images.
  2. Use segmentation by threshold to binarize the sub-images.
  3. Use morphological operations to clean the binarized sub-images.
  4. Label connected blobs.
  5. Calculate the area of each connected blob by counting the number of pixels.
  6. Get the best estimate (mean and std dev) of the number of pixels (= cell size).

Here is an example of a sub-image and its binarized counterpart.

 

C1_18
sample sub-image
threshold_C1_18
sample sub-image binarized by thresholding. Note the “white dust” that can be cleaned up using morphological operations.

Note that there are small white dots on the right side of the picture. The morphological opening operation with a structuring element larger than the white dots but smaller than the “cells” can easily remove the white dots. After cleaning and labelling the connected blobs, we get the image below, where different colors represent differently labelled blobs. Having been sufficiently cleaned, the area is easily obtained by pixel counting.

labelled_C1_18
Labelled sub-image. Different colors indicate a different label.

Using this method, the best estimate for the cell size is ~602 sq. pixels with a std dev of ~394 sq. pixels.

One thought on “Morphological Operations

Leave a comment