Image Threshold

Thresholding is a non-linear operation that converts a gray-scale image into a binary image where the two levels are assigned to pixels that are below or above the specified threshold value. You can apply a threshold to data directly from the command line, e.g.,

myBinaryImage = myGrayImage > thresholdValue ? 255 : 0

It is however far more efficient to use the ImageThreshold operation which also provides several methods for finding the "optimal" threshold value for a given image. ImageThreshold provides the following methods for determining the threshold value:

Thresholding methods

  1. Automatically calculate a threshold value using an iterative method.
  2. Approximate the histogram of the image as a bimodal distribution and choose a mid point value as the threshold level.
  3. Adaptive thresholding. Evaluate the threshold based on the last 8 pixels in each row, using alternating rows. Note that this method is not supported when used as part of the operation ImageEdgeDetection.
  4. Fuzzy thresholding using entropy as the measure for "fuzziness".
  5. Fuzzy thresholding using a method that minimizes a "fuzziness" measure involving the mean gray level in the object and background.
  6. Determines an ideal threshold by histograming the data and representing the image as a set of clusters that is iteratively reduced until there are two clusters left. The threshold value is then set to the highest level of the lower cluster. This method is based on a paper by A.Z. Arifin and A. Asano but modified for handling images with relatively flat histograms.
  7. Determines the ideal threshold value by maximizing the total variance between the "object" and "background".
  8. Default method where you must use the /T flag to specify a threshold value.