Create indexed image from intensity image using multilevel thresholding.
The intensity image I is split into multiple threshold levels. For regularly spaced intervals, the number of levels can be specified as the numeric scalar n (defaults to 10), which will use the intervals:
1 2 n-1 -, -, ..., --- n n n
For irregularly spaced intervals, a numeric vector v of threshold values can be used instead.
The output image will be of class uint8 if the number of levels is less than 256, otherwise it will be double.
See also: im2bw, gray2ind.
Package: image