Content deleted Content added
ElkoSoltius (talk | contribs) Major re-organisation of the article as I thought it was a bit of a mess. In particular, redefinition of what "automatic threshold" is. I'll create a topic in the Talk page to explain more. |
|||
(22 intermediate revisions by 18 users not shown) | |||
Line 2:
[[Image:Pavlovsk Railing of bridge Yellow palace Winter.jpg|thumb|250px|Original image.]][[Image:Pavlovsk Railing of bridge Yellow palace Winter bw threshold.jpg|thumb|250px|The binary image resulting from a thresholding of the original image.]]
In [[digital image processing]], '''thresholding''' is the simplest method of [[image segmentation|segmenting images]]. From a [[grayscale]] image, thresholding can be used to create [[binary image]]s.
==Definition==
Line 10:
==Automatic thresholding==
While in some cases, the threshold <math>T</math> can
Many types of automatic thresholding methods exist, the most famous and widely
* '''[[Histogram]] shape'''-based methods, where, for example, the peaks, valleys and curvatures of the smoothed histogram are analyzed.<ref>{{Cite journal |
* '''Clustering'''-based methods, where the gray-level samples are clustered in two parts as background and foreground,<ref>{{Cite journal |date=1978 |title=Picture Thresholding Using an Iterative Selection Method
* '''[[Entropy (information theory)|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.,<ref>{{Cite journal |
* '''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 use higher-order probability distribution and/or correlation between pixels.
Line 24 ⟶ 23:
=== Global vs local thresholding ===
In most methods, the same threshold is applied to all
Software such as [[ImageJ]] propose a wide range of automatic threshold methods, both
=== Benefits of Local Thresholding Over Global Thresholding<ref>Zhou, Huiyu., Wu, Jiahua., Zhang, Jianguo. Digital Image Processing: Part II. United States: Ventus Publishing, 2010.{{pn|date=April 2024}}</ref> ===
* Adaptability to Local Image Characteristics: Local thresholding can adapt to variations in illumination, contrast, and texture within different parts of the image. This adaptability helps in handling images with non-uniform lighting conditions or complex textures.
▲Software such as [[ImageJ]] propose a wide range of automatic threshold methods, both [https://imagej.net/plugins/auto-threshold global] and [https://imagej.net/plugins/auto-local-threshold local].
* Preservation of Local Details: By applying tailored thresholds to different regions, local thresholding can preserve fine details and edges that might be lost in global thresholding, especially in areas with varying intensities or gradients.
* Reduced Sensitivity to Noise: Local thresholding can be less sensitive to noise compared to global thresholding, as the thresholding decision is based on local statistics rather than the entire image.
=== Examples of Algorithms for Local Thresholding ===
* Niblack's Method:<ref>{{Cite book |first=Wayne |last=Niblack |title=An introduction to digital image processing |date=1986 |publisher=Prentice-Hall International |isbn=0-13-480600-X |oclc=1244113797 |pages=115-116 }}</ref> Niblack's algorithm computes a local threshold for each pixel based on the mean and standard deviation of the pixel's neighborhood. It adjusts the threshold based on the local characteristics of the image, making it suitable for handling variations in illumination.
* Bernsen's Method:<ref>Chaki, Nabendu., Shaikh, Soharab Hossain., Saeed, Khalid. Exploring Image Binarization Techniques. Germany: Springer India, 2014.{{pn|date=April 2024}}</ref> Bernsen's algorithm calculates the threshold for each pixel by considering the local contrast within a neighborhood. It uses a fixed window size and is robust to noise and variations in background intensity.
* Sauvola's Method:<ref>{{cite journal |last1=Sauvola |first1=J. |last2=Pietikäinen |first2=M. |title=Adaptive document image binarization |journal=Pattern Recognition |date=February 2000 |volume=33 |issue=2 |pages=225–236 |doi=10.1016/S0031-3203(99)00055-2 |bibcode=2000PatRe..33..225S }}</ref> Sauvola's algorithm extends Niblack's method by incorporating a dynamic factor that adapts the threshold based on the local contrast and mean intensity. This adaptive factor improves the binarization results, particularly in regions with varying contrasts.
==Extensions of binary thresholding==
=== Multi-band images ===
Color images can also be thresholded. One approach is to designate a separate threshold for each of the [[RGB color model|RGB]] components of the image and then combine them with an [[Binary and|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 color. Therefore, the [[HSL and HSV]] color models are more often used; note that since [[hue]] is a circular quantity it requires [[circular thresholding]]. It is also possible to use the [[CMYK color model|CMYK]] color model.<ref>{{Cite journal |
=== Multiple thresholds ===
Line 48 ⟶ 57:
==References==
{{Reflist}}
==Further reading==
*Gonzalez, Rafael C. & Woods, Richard E. (2002). Thresholding. In Digital Image Processing, pp. 595–611. Pearson Education. {{ISBN|81-7808-629-8}}
*
*
*Scott E. Umbaugh (2018). Digital Image Processing and Analysis, pp 93–96. CRC Press. {{ISBN|978-1-4987-6602-9}}
|