FindThreshold

FindThreshold[image]
finds a global threshold value that partitions the intensity values in image into two intervals.

Details and OptionsDetails and Options

  • FindThreshold works with any image. It converts multichannel and color images into grayscale images, and then finds a global threshold.
  • FindThreshold also works with real arrays of arbitrary dimensions.
  • 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".

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Find the threshold of pixel intensities:

In[1]:=
Click for copyable input
Out[1]=

Find the clustering threshold for an array of data:

In[1]:=
Click for copyable input
Out[1]=
New in 8 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »