Mathematical Morphology – Erosion in OpenCV

By | September 28, 2016

Mathematical Morphology – Erosion

Erosion can be used to shrink object shapes by removing pixels from boundary. It is exact opposite of dilation (expands the object pixels).

Performing erode operation on object shape results the following :

  • Removes any small points of noise or any narrow features
  • Reduce the size of objects ( Number of points in set)

Erosion using 5 x 5 isotropic structuring element

Here is a code example to use erosion on video frames.

Watch video to find the outcome of the erosion operation

Erosion using the default 3 x 3 isotropic structuring element

Watch video to find the outcome of the erosion operation