Find limits to contrast stretch image
LOW_HIGH = stretchlim(I)
LOW_HIGH = stretchlim(I, TOL)
LOW_HIGH = stretchlim(RGB, TOL)
LOW_HIGH = stretchlim(I) returns LOW_HIGH, a two-element vector of pixel values that specify lower and upper limits that can be used for contrast stretching image I. By default, values in LOW_HIGH specify the bottom 1% and the top 1% of all pixel values. The gray values returned can be used by the imadjust function to increase the contrast of an image.
If TOL is a scalar, LOW_FRACT = TOL, and HIGH_FRACT = 1 - LOW_FRACT, which saturates equal fractions at low and high pixel values.
If you omit the argument, TOL defaults to [0.01 0.99], saturating 2%.
If TOL = 0, LOW_HIGH = [min(I(:)); max(I(:))].
The input image can be of class uint8, uint16, int16, double, or single. The output limits returned, LOW_HIGH, are of class double and have values between 0 and 1.