- Thresholding (image processing)
Thresholding is the simplest method of image segmentation. From a
grayscale image, thresholding can be used to createbinary image s .During the thresholding process, individual
pixels in an image are marked as “object” pixels if their value is greater than some threshold value (assuming an object to be brighter than the background) and as “background” pixels otherwise. This convention is known as "threshold above". Variants include "threshold below", which is opposite of threshold above; "threshold inside", where a pixel is labeled "object" if its value is between two thresholds; and "threshold outside", which is the opposite of threshold inside . Typically, an object pixel is given a value of “1” while a background pixel is given a value of “0.” Finally, a binary image is created by coloring each pixel white or black, depending on a pixel's label.Thresholding is called adaptive thresholding when a different threshold is used for different regions in the image. This may also be known as "local" or "dynamic" thresholding .
The key parameter in the thresholding process is the choice of the threshold value (or "values", as mentioned earlier). Several different methods for choosing a threshold exist; users can manually choose a threshold value, or a thresholding algorithm can compute a value automatically, which is known as "automatic thresholding" . A simple method would be to choose the
mean ormedian value, the rationale being that if the object pixels are brighter than the background, they should also be brighter than the average. In a noiseless image with uniform background and object values, the mean or median will work well as the threshold, however, this will generally not be the case. A more sophisticated approach might be to create ahistogram of the image pixel intensities and use the valley point as the threshold. The histogram approach assumes that there is some average value for the background and object pixels, but that the actual pixel values have some variation around these average values. However, this may be computationally expensive, and image histograms may not have clearly defined valley points, often making the selection of an accurate threshold difficult. One method that is relatively simple, does not require much specific knowledge of the image, and is robust againstimage noise , is the followingiterative method :#An initial threshold (T) is chosen, this can be done randomly or according to any other method desired.
#The image is segmented into object and background pixels as described above, creating two sets:
## = {f(m,n):f(m,n)>T} (object pixels)
## = {f(m,n):f(m,n)T} (background pixels) (note, f(m,n) is the value of the pixel located in the column, row)
#The average of each set is computed.
## = average value of
## = average value of
#A new threshold is created that is the average of and
##T’ = ( + )/2
#Go back to step two, now using the new threshold computed in step four, keep repeating until the new threshold matches the one before it (i.e. untilconvergence has been reached).This iterative algorithm is a special one-dimensional case of the k-means clustering algorithm, which has been proven to converge at a "local" minimum—meaning that a different initial threshold "may" give a different final result.
Categorizing Thresholding Methods
Sezgin and Sankur (2004) categorize thresholding methods into the following six groups based on the information the algorithm manipulates (Sezgin et al, 2004):
* "
histogram shape-based methods, where, for example, the peaks, valleys and curvatures of the smoothed histogram are analyzed
* clustering-based methods, where the gray-level samples are clustered in two parts as background and foreground (object), or alternately are modeled as a mixture of two Gaussians
*entropy -based methods result in algorithms that use the entropy of the foreground and background regions, the cross-entropy between the original and binarized image, etc.
* object attribute-based methods search a measure of similarity between the gray-level and the binarized images, such as fuzzy shape similarity, edge coincidence, etc.
* [...] spatial methods [that] use higher-order probability distribution and/or correlation between pixels
* local methods adapt the threshold value on each pixel to the local image characteristics."Multiband Thresholding
Colour images can also be thresholded. One approach is to designate a separate threshold for each of the RGB components of the image and then combine them with an AND operation. This reflects the way the camera works and how the data is stored in the computer, but it does not correspond to the way that people recognize colour. Therefore, the
HSL and HSV colour models are more often used. An interesting new method uses the CMYK colour model to threshold colour images (Pham et al., 2007).Citations
* Pham N, Morrison A, Schwock J et al. (2007). Quantitative image analysis of immunohistochemical stains using a CMYK color model. [http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pubmed&pubmedid=17326824 "Diagn Pathol." 2:8] .
* Shapiro, Linda G. & Stockman, George C. (2002). "Computer Vision". Prentice Hall. ISBN 0-13-030796-3
* Mehmet Sezgin and Bulent Sankur, Survey over image thresholding techniques and quantitative performance evaluation, Journal of Electronic Imaging 13(1), 146–165 (January 2004). doi|10.1117/1.1631315
References and Further Reading
*Gonzalez, Rafael C. & Woods, Richard E. (2002). Thresholding. In Digital Image Processing, pp. 595–611. Pearson Education. ISBN 81-7808-629-8
Wikimedia Foundation. 2010.