Activity 8 – Morphological Operations

in this activity we were tasked to perform morphological operations. morphological operations affect the shape of a binary object, whether to enlarge it, or eliminate it, or to combine two blobs together, or whatever task needed. this is important, since it can be used to clear out any noise in a signal, or to enhance the information that is needed to be extracted.

to perform a morphological operation one needs a binary image, containing the object/s to be modified, and a structuring element, which would determine the shape of the modification. there are two main types of morphological operation: erosion and dilation. the former chips off parts of the object, while the latter expands it.

the binary objects used were:

  1. a 5 x 5 square
  2. a triangle, with base = 4 px, height = 3 px
  3. a hollow 10 x 10 square. 2 boxes thick
  4. a plus sign

and the structuring elements used were:

  1. 2 x 2 ones matrix
  2. 2 x 1 ones matrix
  3. 1 x 2 ones matrix
  4. 3 px-wide cross
  5. a diagonal line, 2 px long

below are the results of the morphological operations. the lower left corresponds to the dilation, while the lower right corresponds to the erosion.

to expand on morphological operations, we were tasked to determine the area of the circles shown below:

Circles002

this would require isolating the circles using image segmentation, after which morphological operations can now be used.

three new morphological operations are introduced: Open, Close, and TopHat. the Open operator is a combination of the erosion and dilation operations. the object is eroded first, and then dilated. it opens the gaps between two connected blobs, and eliminates objects smaller than the structuring element. the Close operator dilates, and then erodes the object. this closes the gaps between two objects, and can be used to coagulate many objects with potentially the same characteristics. TopHat is basically the difference between the opening of the image and the original image.

the original image was split into 12 equally sized sub-images (256 x 256) in order to have many samples for the determination of the area of the circle.

the morphological operation used here was the Open operator, to eliminate the noise the might result from the thresholding. after performing the opening, the blobs are then labeled and the areas of each individual blob were determined. this was done by using the MATLAB function regionprops.

the area was found to be around 572 px, with standard deviation of 258 px.

one can then used this information to determine abnormally large cells (cancer cells) in an image. below is an image of normal cells wixed together with cancer cells.

Circles with cancer

using the Open operator, and by isolating the normal cells using the MATLAB function bwareaopen, i was able to extract the normal cells:

Normal_cells

as well as the cancer cells (green = normal cells; purple = cancer cells)Cancer_cells

Leave a comment