Morphology Filters

Morphological operators — dilate, erode, open, and close — can be applied through image filtering to grow or shrink image regions, as well as to remove or fill-in image region boundary pixels. These basic operators, which process objects in the input image based on the characteristics encoded in the selected structuring element, are described below. Additional morphology filters include top-hat transforms. morphological gradient, and morphological Laplace.

Morphology filters and settings
  What it does
Black Top Hat Returns an image containing the objects or elements of the input image that are smaller than the selected structuring element and darker than their surroundings.

In mathematical morphology and digital image processing, top-hat transform is an operation that extracts small elements and details from given images. There are two types of top-hat transform — the white top-hat transform and the black top-hat transform. The white top-hat transform can be defined as the difference between the input image and its opening by some structuring element, while the black top-hat transform can be defined as the difference between the closing and the input image. Top-hat transforms can be used for various image processing tasks, such as feature extraction, background equalization, image enhancement, and others.

References
[1] http://utam.gg.utah.edu/tomo03/03_mid/HTML/node120.html
[2] http://en.wikipedia.org/wiki/Top-hat_transform

Close Smoothes objects and fills-in small holes by performing a dilation operation followed by erosion using the same structuring element for both operations. Closing is similar in some ways to dilation in that it tends to enlarge the boundaries of foreground (bright) regions in an image and fill-in small background holes known as pepper noise. However, it is often less destructive of the original boundary shape. The effect of the operator is to preserve background regions that have a similar shape to the selected structuring element, or that can completely contain the structuring element, while eliminating all other regions of background pixels.

As with erosion and dilation, a 3 by 3 square structuring element is commonly used. The effect of closing using a 3 by 3 square structuring element on a binary image is shown in the following illustration.

Effect of closing

References
[1] http://homepages.inf.ed.ac.uk/rbf/HIPR2/close.htm

Dilate The basic effect of dilation on an image is to gradually enlarge the boundaries of regions of foreground pixels, typically white pixels. As areas of foreground pixels grow in size, holes within those regions become smaller. The selected structuring element determines the precise effect of the dilation on the input image.

Dilation can also be used for edge detection by taking the dilation of an image and then subtracting away the original image, thereby highlighting just those new pixels at the edges of objects that were added by the dilation. See Arithmetic Operations for information about subtracting one dataset from another.

The effect of a dilation using a 3 by 3 square structuring element on a binary image is shown in the following illustration. The 3 by 3 square is probably the most common structuring element used in dilation and erosion operations. With larger structuring elements, it is quite common to use an approximately round-shaped structuring element, as opposed to a square one.

Effect of dilation

References
[1] http://homepages.inf.ed.ac.uk/rbf/HIPR2/erode.htm#1

Erode The basic effect of erosion on an image is to erode away the boundaries of regions of foreground pixels, typically white pixels. As areas of foreground pixels shrink in size, holes within those areas become larger. The selected structuring element determines the precise effect of the erosion on the input image.

Erosion can also be used for edge detection by taking the erosion of an image and then subtracting it away from the original image. This will highlight just those pixels at the edges of objects that were removed by the erosion. See Arithmetic Operations for information about subtracting one dataset from another.

The effect of an erosion using a 3 by 3 square structuring element on a binary image is shown in the following illustration. The 3 by 3 square is probably the most common structuring element used in dilation and erosion operations. With larger structuring elements, it is quite common to use an approximately round-shaped structuring element, as opposed to a square one.

Effect of erosion

References
[1] http://homepages.inf.ed.ac.uk/rbf/HIPR2/erode.htm#1

Morphological Gradient Produces an image where each pixel value indicates the contrast intensity in the close neighborhood of that pixel.

In digital image processing, a morphological gradient is the difference between the dilation and the erosion of a given image. Applying the Morphological Gradient filter produces an image where each pixel value indicates the contrast intensity in the close neighborhood of that pixel. This can be useful for edge detection and segmentation applications.

References
[1] Morphological gradients, Jean-F Rivest, Pierre Soille, and Serge Beucher. Proc. SPIE "Image Science and Technology", San Jose, California, Feb. 1992.

Morphological Laplace Enhances the edges of an image. The morphological Laplacian can be defined as half the sum of a morphological dilation and a morphological erosion with the same structuring element, minus the original image.
Open Performs an erosion operation, followed by a dilation to smooth objects and remove isolated pixels. The basic effect of opening is somewhat like erosion in that it tends to remove some of the foreground (bright) pixels from the edges of regions of foreground pixels. In general, it is less destructive than erosion. As with other morphological operators, the exact operation is determined by a structuring element.

You should note that opening is the dual of closing, which means that opening the foreground pixels with a particular structuring element is equivalent to closing the background pixels with the same element.

The effect of opening using a 3 by 3 square structuring element on a binary image is shown in the following illustration. As with erosion and dilation, it is very common to use a 3 by 3 structuring element. Opening can also be used in conjunction with closing to achieve subtle effects.

Effect of opening

References
[1] http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm#1

White Top Hat White top-hat filtering returns an image containing objects or elements of the input image that are smaller than the structuring element and brighter than their surroundings.

In mathematical morphology and digital image processing, top-hat transform is an operation that extracts small elements and details from given images. There are two types of top-hat transform — the white top-hat transform and the black top-hat transform. The white top-hat transform can be defined as the difference between the input image and its opening by some structuring element, while the black top-hat transform can be defined as the difference between the closing and the input image. Top-hat transforms can be used for various image processing tasks, such as feature extraction, background equalization, image enhancement, and others.

References
[1] http://utam.gg.utah.edu/tomo03/03_mid/HTML/node120.html
[2] http://en.wikipedia.org/wiki/Top-hat_transform