FindThreshold
FindThreshold[image]
finds a global threshold value that partitions the intensity values in image into two intervals.
Details and Options
- Thresholding is one of the most common techniques for binary clustering or segmentation.
- FindThreshold works with 2D and 3D images as well as data arrays of any rank. It converts multichannel and color images into grayscale, and then finds a global threshold.
- FindThreshold[image,Method->method] specifies the method to use to determine the threshold.
- Possible settings for the Method option include:
-
{"BlackFraction",b} make a fraction b of all pixels black "Cluster" cluster variance maximization (Otsu's algorithm) "Entropy" histogram entropy minimization (Kapur's method) "Mean" use the mean level as the threshold "Median" use the median pixel level as the threshold "MinimumError" Kittler–Illingworth minimum error thresholding method - The default setting is Method->"Cluster".
Examples
open allclose allBasic Examples (1)
Scope (3)
Options (5)
Method (5)
By default, the "Cluster" method is used, maximizing variance between two clusters:
Show the histogram and computed threshold:
Use the "MinimumError" method to classify data drawn from two Gaussian distributions:
Show the histogram and computed threshold:
Use the "BlackFraction" method to specify how much of the data should be below the threshold:
Compare the threshold returned by different methods:
Compute the threshold for a color image and compare values for each method:
Text
Wolfram Research (2010), FindThreshold, Wolfram Language function, https://reference.wolfram.com/language/ref/FindThreshold.html (updated 2012).
CMS
Wolfram Language. 2010. "FindThreshold." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/FindThreshold.html.
APA
Wolfram Language. (2010). FindThreshold. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindThreshold.html