| Image Processing Toolbox™ | ![]() |
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.
LOW_HIGH = stretchlim(I, TOL) where TOL is a two-element vector [LOW_FRACT HIGH_FRACT] that specifies the fraction of the image to saturate at low and high pixel values.
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(:))].
LOW_HIGH = stretchlim(RGB, TOL) returns a 2-by-3 matrix of intensity pairs to saturate each plane of the RGB image. TOL specifies the same fractions of saturation for each plane.
Note If TOL is too big, such that no pixels would be left after saturating low and high pixel values, stretchlim returns [0 1]. |
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.
I = imread('pout.tif');
J = imadjust(I,stretchlim(I),[]);
imshow(I), figure, imshow(J)

![]() | strel | subimage | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |