Saturday, December 28, 2013

Morphological filters in opencv: erosin , dilation, opening and closing.

While reading through this famous book for getting started with opencv  I came across this simple explanation of morphological filters. In fact erosion and dilation are the most fundamental morphological operators. The fundamental instrument in mathematical morphology is the structuring element. A structuring element is simply defined as a configuration of pixels (a shape) on which an origin is defined (also called anchor point). Applying a morphological filter consists of probing each
pixel of the image using this structuring element.
The two filters of this recipe operate on the set of pixels (or neighborhood) around each pixel.
  • Erosion: replaces the current pixel with the minimum pixel value found in the defined pixel set.
  • Dilation: is the complementary operator, and it replaces the current pixel with the maximum pixel value found in the defined pixel set.
 If the input binary image contains only black (0) and white (255) pixels, each pixel is replaced by either a white or black pixel. In the opening and closing filters are simply defined in terms of the basic erosion and dilation operations:
  •  Closing: is defined as the erosion of the dilation of an image.
  •  Opening: is defined as the dilation of the erosion of an image.



No comments:

Post a Comment