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"KittlerIllingworth minimum error thresholding method
  • The default setting is Method->"Cluster".

Examples

open allclose all

Basic Examples  (1)

Find the threshold of pixel intensities:

Use the threshold to perform an image binarization:

Scope  (3)

Find the clustering threshold for an array of data:

Find a threshold to segment a color image:

Find a threshold of a 3D volume:

Options  (2)

Method  (2)

Use the "MinimumError" method to classify data drawn from two Gaussian distributions:

Use the "BlackFraction" method to specify how much of the data should be below the threshold:

Applications  (1)

Find a cutoff for the vertical dimension of letters in a text image:

Wolfram Research (2010), FindThreshold, Wolfram Language function, https://reference.wolfram.com/language/ref/FindThreshold.html (updated 2012).

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

BibTeX

@misc{reference.wolfram_2023_findthreshold, author="Wolfram Research", title="{FindThreshold}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/FindThreshold.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_findthreshold, organization={Wolfram Research}, title={FindThreshold}, year={2012}, url={https://reference.wolfram.com/language/ref/FindThreshold.html}, note=[Accessed: 18-March-2024 ]}