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 f:E\mapsto R be a grayscale image, mapping points from an Euclidean space or discrete grid E (such as R2 or Z2) into the real line. Let b(x) be a grayscale structuring element.

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

T_w(f)=f-f \circ b,

where \circ denotes the opening operation.

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

T_b(f)=f\bullet b-f,

where \bullet 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 b. The bigger the latter, the larger the elements extracted.

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

References

  1. Tcheslavski, Gleb V. (2010). "Morphological Image Processing: Gray-scale morphology". Retrieved 4 November 2013.