Top-hat transform

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

Mathematical definitions

Let be a grayscale image, mapping points from an Euclidean space or discrete grid E (such as R2 or Z2) into the real line. Let be a grayscale structuring element.

Then, the white top-hat transform of f is given by:

,

where denotes the opening operation.

The black top-hat transform of f (sometimes called the bottom-hat transform[1] ) is given by:

,

where is the closing operation.

Properties

The white top-hat transform returns an image, containing those "objects" or "elements" of an input image that:

The black top-hat returns an image, containing the "objects" or "elements" that:

The size, or width, of the elements that are extracted by the top-hat transforms can be controlled by the choice of the structuring element . The bigger the latter, the larger the elements extracted.

Both top-hat transforms are images that contain only non-negative values at all pixels.

One of important use in image segmentation is to adjust nonuniform lighting condition on image and provide better threshold value for separating objects.

Example

Assume we are only interested in small blobs on the image and we want to remove the larger bright objects. In this case, white top-hat transform can remove larger bright objects and remain small blobs by selecting the size of structuring element that is between removed objects and objects of interest. The radius of six largest bright objects are approximate 50 to 100 pixels whereas the radius of objects of interest are around 2 to 4 pixels. In addition, the objects of interest are circular shape so that we choose the structuring element is disk shape with radius 5. However, selecting different shapes and sizes of structuring element will have different resulting images which depend on whether objects fit in structuring element or not.

Original Image (870x1550)
Applied top-hat transform with disk shape SE radius 5

The other example is that you have an image under nonuniform illumination and you want to extract objects separately from background. The common method for image segmentation is to threshold the input image based on intensity value. However, if the image under nonuniform lighting, it is possible that segmentation errors might present since some objects in darker area have close intensity values as background intensity values and would not be extracted by only utilizing threshold method. In this case, before Otsu's method is applied to input image, white top-hat transform should be implemented to correct nonuniform lighting condition and make obvious contrast between background and objects. Therefore, the objects can be extracted entirely from background without segmentation errors. The threshold values are 0.5216 and 0.2 and normalized to for original image and applied white top-hat transform respectively.

Nonuniform lighting condition input image
Threshold a nonuniform lighting input image
Top-hat transform applied to input image
Threshold image after top-hat transform applied

References

  1. Tcheslavski, Gleb V. (2010). "Morphological Image Processing: Gray-scale morphology" (PDF). Retrieved 4 November 2013.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.