Top-hat transform

Last updated

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, while 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.

Contents

Mathematical definitions

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

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 its most important uses in image segmentation is to adjust nonuniform lighting conditions on an image and provide a 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, the white top-hat transform can remove larger bright objects and retain small blobs by selecting the size of the structuring element that is between removed objects and objects of interest. The radius of six largest bright objects are approximately 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 shapes so we choose a disk shaped structuring element with radius 5. However, selecting different shapes and sizes for the structuring element result in different images depending on whether objects fit in the structuring element or not.

Cosmos original.jpg
Original Image (870x1550)
Cosmos tophat.jpg
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 is under nonuniform lighting, it is possible that segmentation errors might present themselves 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.

Lighting original.jpg
Nonuniform lighting condition input image
Lighting threshold.jpg
Threshold a nonuniform lighting input image
Lighting tophat.jpg
Top-hat transform applied to input image
Lighting tophat threshold.jpg
Threshold image after top-hat transform applied

Related Research Articles

Digital image processing is the use of a digital computer to process digital images through an algorithm. As a subcategory or field of digital signal processing, digital image processing has many advantages over analog image processing. It allows a much wider range of algorithms to be applied to the input data and can avoid problems such as the build-up of noise and distortion during processing. Since images are defined over two dimensions digital image processing may be modeled in the form of multidimensional systems. The generation and development of digital image processing are mainly affected by three factors: first, the development of computers; second, the development of mathematics ; third, the demand for a wide range of applications in environment, agriculture, military, industry and medical science has increased.

Binary image Image comprising exactly two colors, typically black and white

A binary image is one that consists of pixels that can have one of exactly two colors, usually black and white. Binary images are also called bi-level or two-level, Pixelart made of two colours is often referred to as 1-Bit or 1bit. This means that each pixel is stored as a single bit—i.e., a 0 or 1. The names black-and-white, B&W, monochrome or monochromatic are often used for this concept, but may also designate any images that have only one sample per pixel, such as grayscale images. In Photoshop parlance, a binary image is the same as an image in "Bitmap" mode.

Mathematical morphology

Mathematical morphology (MM) is a theory and technique for the analysis and processing of geometrical structures, based on set theory, lattice theory, topology, and random functions. MM is most commonly applied to digital images, but it can be employed as well on graphs, surface meshes, solids, and many other spatial structures.

Edge detection includes a variety of mathematical methods that aim at identifying edges, curves in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The same problem of finding discontinuities in one-dimensional signals is known as step detection and the problem of finding signal discontinuities over time is known as change detection. Edge detection is a fundamental tool in image processing, machine vision and computer vision, particularly in the areas of feature detection and feature extraction.

The Hough transform is a feature extraction technique used in image analysis, computer vision, and digital image processing. The purpose of the technique is to find imperfect instances of objects within a certain class of shapes by a voting procedure. This voting procedure is carried out in a parameter space, from which object candidates are obtained as local maxima in a so-called accumulator space that is explicitly constructed by the algorithm for computing the Hough transform.

Image segmentation Partitioning a digital image into segments

In digital image processing and computer vision, image segmentation is the process of partitioning a digital image into multiple image segments, also known as image regions or image objects. The goal of segmentation is to simplify and/or change the representation of an image into something that is more meaningful and easier to analyze. Image segmentation is typically used to locate objects and boundaries in images. More precisely, image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain characteristics.

Erosion (morphology)

Erosion is one of two fundamental operations in morphological image processing from which all other morphological operations are based. It was originally defined for binary images, later being extended to grayscale images, and subsequently to complete lattices. The erosion operation usually uses a structuring element for probing and reducing the shapes contained in the input image.

Dilation is one of the basic operations in mathematical morphology. Originally developed for binary images, it has been expanded first to grayscale images, and then to complete lattices. The dilation operation usually uses a structuring element for probing and expanding the shapes contained in the input image.

Opening (morphology)

In mathematical morphology, opening is the dilation of the erosion of a set A by a structuring element B:

Closing (morphology)

In mathematical morphology, the closing of a set A by a structuring element B is the erosion of the dilation of that set,

In mathematical morphology, a structuring element is a shape, used to probe or interact with a given image, with the purpose of drawing conclusions on how this shape fits or misses the shapes in the image. It is typically used in morphological operations, such as dilation, erosion, opening, and closing, as well as the hit-or-miss transform.

Otsus method In computer vision and image processing

In computer vision and image processing, Otsu's method, named after Nobuyuki Otsu, is used to perform automatic image thresholding. In the simplest form, the algorithm returns a single intensity threshold that separate pixels into two classes, foreground and background. This threshold is determined by minimizing intra-class intensity variance, or equivalently, by maximizing inter-class variance. Otsu's method is a one-dimensional discrete analog of Fisher's Discriminant Analysis, is related to Jenks optimization method, and is equivalent to a globally optimal k-means performed on the intensity histogram. The extension to multi-level thresholding was described in the original paper, and computationally efficient implementations have since been proposed.

Connected-component labeling (CCL), connected-component analysis (CCA), blob extraction, region labeling, blob discovery, or region extraction is an algorithmic application of graph theory, where subsets of connected components are uniquely labeled based on a given heuristic. Connected-component labeling is not to be confused with segmentation.

Region growing is a simple region-based image segmentation method. It is also classified as a pixel-based image segmentation method since it involves the selection of initial seed points.

In mathematical morphology, hit-or-miss transform is an operation that detects a given configuration in a binary image, using the morphological erosion operator and a pair of disjoint structuring elements. The result of the hit-or-miss transform is the set of positions where the first structuring element fits in the foreground of the input image, and the second structuring element misses it completely.

In digital image processing, morphological skeleton is a skeleton representation of a shape or binary image, computed by means of morphological operators.

In mathematical morphology and digital image processing, a morphological gradient is the difference between the dilation and the erosion of a given image. It is an image where each pixel value indicates the contrast intensity in the close neighborhood of that pixel. It is useful for edge detection and segmentation applications.

The random walker algorithm is an algorithm for image segmentation. In the first description of the algorithm, a user interactively labels a small number of pixels with known labels, e.g., "object" and "background". The unlabeled pixels are each imagined to release a random walker, and the probability is computed that each pixel's random walker first arrives at a seed bearing each label, i.e., if a user places K seeds, each with a different label, then it is necessary to compute, for each pixel, the probability that a random walker leaving the pixel will first arrive at each seed. These probabilities may be determined analytically by solving a system of linear equations. After computing these probabilities for each pixel, the pixel is assigned to the label for which it is most likely to send a random walker. The image is modeled as a graph, in which each pixel corresponds to a node which is connected to neighboring pixels by edges, and the edges are weighted to reflect the similarity between the pixels. Therefore, the random walk occurs on the weighted graph.

Foreground detection

Foreground detection is one of the major tasks in the field of computer vision and image processing whose aim is to detect changes in image sequences. Background subtraction is any technique which allows an image's foreground to be extracted for further processing.

Quantum image processing (QIMP) is using quantum computing or quantum information processing to create and work with quantum images.

References

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