Image Processing Toolbox User's Guide |
Find limits to contrast stretch an image
Syntax
Description
returns LOW_HIGH =
stretchlim(I)
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.
where LOW_HIGH =
stretchlim(I,TOL)
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] .
|
Class Support
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.
Example
See Also
strel | subimage |
© 1994-2005 The MathWorks, Inc.