Thresholding Filters
In digital image processing, thresholding is one of the simplest methods of segmenting images. Basic thresholding methods replace each pixel in an image with a black pixel if the image intensity 'I' is less than some fixed constant 'T', or a white pixel if the image intensity is greater than that constant. In the example below, this results in the lower grayscale values becoming completely black, and higher grayscale values becoming completely white.
Original image (left) and after simple threshold applied (right)
Thresholding algorithms implemented in Dragonfly can be separated into the following categories:
Simple thresholding… For every pixel, the same threshold value is applied. If the pixel value is smaller than the threshold, it is set to 0, otherwise it is set to a maximum value.
Adaptive thresholding… In cases in which using a global value as a threshold might not be adequate, for example when working with images with varying illumination, adaptive thresholding can be applied. In this case, methods to adapt the threshold value on each pixel to the local image characteristics are applied. This results in a different threshold being selected for each pixel in the image. You should note that adaptive thresholding often requires more computation time than simple thresholding.
Thresholding filters output an image composed of two basic classes — foreground and background. These images can be used as masks for segmentation purposes or for other image processing tasks.
| What it does | Options | |
|---|---|---|
| Adaptive | Applies an adaptive threshold to images based on local pixel neighborhood, in which all pixels in the input image higher than the corresponding pixel in the threshold image are considered foreground. The threshold value is the weighted mean for the local neighborhood of a pixel subtracted by a constant.
References |
Kernel size
Method of thresholding Offset |
| Isodata | Computes threshold value(s) based on the ISODATA method. That is, returned thresholds are intensities that separate the image into two groups of pixels, where the threshold intensity is midway between the mean intensities of these groups.
References |
- - |
| Li | Computes the threshold value based on an adaptation of Li's Minimum Cross Entropy method.
References |
- - |
| Liu-Song-S | Accurately and efficiently segments an image with a unimodal gray-level distribution by analyzing the morphology of the gray gradient distribution histogram.
Original image (left) and the result of Liu‐Song‐S thresholding (right) References |
- |
| Local Otsu | Performs local Otsu thresholding on an image, with a user-specified kernel size. Facilitates the threshold-segmentation of images with uneven illumination, without the need for background normalization, and for which global thresholding is inadequate. | Kernel size |
| Mean | Selects the threshold as the mean of the local greyscale distribution. | - |
| Minimum | Selects the threshold as the minimum of the local greyscale distribution. | - |
| Niblack | Applies a Niblack local threshold to an array. Instead of calculating a single global threshold for the entire image, several thresholds are calculated for every pixel by using specific formulae that take into account the mean and standard deviation of the local neighborhood (defined by a window centered around the pixel).
Note Refer to Niblack, W (1986), An introduction to Digital Image Processing, Prentice-Hall for more information. |
Window size
k |
| Otsu | This filter is an implementation of the Otsu thresholding technique and outputs an image composed of two basic classes — foreground and background. In this thresholding technique, the optimal value that minimizes the weighted within class variances of these two classes is computed. You should note that minimizing the within class variance is the same as maximizing the between class variance.
One of the main advantages of the Otsu thresholding technique is speed. However, the technique assumes uniform illumination and doesn’t use any object structure or spatial coherence. Since Otsu thresholding operates over histograms, you should analyze the image histogram before applying this filter (see Plotting Histograms from Annotations). References |
- |
| Sauvola |
Implements Sauvola's thresholding method, which is a variation of Niblack's method. References
|
Window size
k |
| Triangle |
Returns a threshold value based on the triangle algorithm. References
|
- |
| Yen | Computes the threshold value based on Yen’s method.
References |
- |
