Binarize

Binarize[image]
creates a binary image from image by replacing all values above a globally determined threshold with and others with .

Binarize[image,t]
creates a binary image by replacing all values above t with and others with .

Binarize[image,{t1,t2}]
creates a binary image by replacing all values in the range through with and others with .

Binarize[image,f]
creates a binary image by replacing all channel value lists for which yields True with , and others with .

Details and OptionsDetails and Options

  • Binarize works with any image. It converts multichannel and color images into grayscale images, then produces an image in which every pixel has value or .
  • Binarize[image,{t,t}] effectively sets pixels with value t to , and all other pixels to .
  • Binarize[image,0] sets all nonzero values to .
  • In Binarize[image,f], the function f is applied to the list of channel values for each pixel.
  • Binarize[image] uses Otsu's cluster variance maximization method. See the reference page for FindThreshold for full documentation of available Method settings.
  • Binarize[image] uses Otsu's cluster variance maximization method. Other 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
  • If an explicit threshold value is given, Binarize ignores the Method option. »
  • Binarize also works with Image3D objects.
Introduced in 2008
(7.0)
| Updated in 2012
(9.0)