Image Processing Toolbox    
imadjust

Adjust image intensity values or colormap

Syntax

Description

J = imadjust(I,[low_in high_in],[low_out high_out],gamma) maps the values in intensity image I to new values in J such that values between low_in and high_in map to values between low_out and high_out. Values below low_in and above high_in are clipped; that is, values below low_in map to low_out, and those above high_in map to high_out. You can use an empty matrix ([]) for [low_in high_in] or for [low_out high_out] to specify the default of [0 1].

gamma specifies the shape of the curve describing the relationship between the values in I and J. If gamma is less than 1, the mapping is weighted toward higher (brighter) output values. If gamma is greater than 1, the mapping is weighted toward lower (darker) output values. If you omit the argument, gamma defaults to 1 (linear mapping).

newmap = imadjust(map,[low_in; high_in],[low_out;high_out],gamma) transforms the colormap associated with an indexed image. If low_in, high_in, low_out, high_out, and gamma are scalars, then the same mapping applies to red, green and blue components. Unique mappings for each color component are possible when

The rescaled colormap, newmap, is the same size as map.

RGB2 = imadjust(RGB1,...) performs the adjustment on each image plane (red, green, and blue) of the RGB image RGB1. As with the colormap adjustment, you can apply unique mappings to each plane.

The function stretchlim can be used with imadjust to apply an automatically computed contrast stretch.

Class Support

For syntax variations that include an input image (rather than a colormap), the input image can be of class uint8, uint16, or double. The output image has the same class as the input image. For syntax variations that include a colormap, the input and output colormaps are of class double.

Example

See Also

brighten, histeq, stretchlim


  imadd imapprox