grayslice
Convert grayscale image to indexed image using multilevel thresholding
Description
X = grayslice(I,N)N. To learn more about the threshold calculation, see Algorithms.
X = grayslice(I,thresholds)
Examples
Input Arguments
Output Arguments
Tips
- You can view the thresholded image using - imshow(X,map)with a colormap of appropriate length.
Algorithms
The function performs multilevel thresholding of the input grayscale image and returns an
      indexed image as the output. If you specify the number of thresholds N,
      then grayslice assigns pixels to N indices according
      to these thresholds.
- The first index in - Xconsists of the grayscale pixels in the range
- The k-th index in - Xconsists of the grayscale pixels in the range
- The last index in - Xconsists of the grayscale pixels in the range .
max_intensity depends on the data type of the input image.
| Image Data Type | max_intensity | 
|---|---|
| uint8 | 255 | 
| int16oruint16 | 65535 | 
| singleordouble | 1 | 
Note
Before thresholding an image of data type int16, the
          grayslice function converts the image to uint16 by
        adding 32,768 to each pixel.



