You are here : matlabImage Processingimadjust

imadjust() - Image Processing

J = imadjust(I) maps
the intensity values in grayscale image I to new
values in J such that 1% of data is saturated
at low and high intensities of I. This increases
the contrast of the output image J. This syntax
is equivalent to imadjust(I,stretchlim(I)). exampleJ = imadjust(I,[low_in;
high_in],[low_out; high_out]) maps
the values in I to new values in J such
that values between low_in and high_in map
to values between low_out and high_out. Note  


If high_out is less than low_out, imadjust reverses
the output image, as in a photographic negative.J = imadjust(I,[low_in;
high_in],[low_out; high_out],gamma) maps
the values in I to new values in J,
where gamma specifies the shape of the curve describing
the relationship between the values in I and J.newmap = imadjust(map,[low_in;
high_in],[low_out; high_out],gamma) transforms
the m-by-3 array colormap associated with an indexed
image. low_in, high_in, low_out,
and high_out must be 1-by-3 vectors. gamma can
be a 1-by-3 vector that specifies a unique gamma value for each channel
or a scalar that specifies the value used for all three channels.
The rescaled colormap newmap is the same size as map.exampleRGB2 = imadjust(RGB1,___) performs
the adjustment on each plane (red, green, and blue) of the RGB image RGB1.
If low_in, high_in, low_out, high_out,
and gamma are scalars, imadjust applies
the same mapping to the red, green, and blue components of the image.
To specify unique mappings for each color component of the image,
specify low_in, high_in, low_out, high_out,
and gamma as 1-by-3 vectors.examplegpuarrayB = imadjust(gpuarrayA,___) performs
the contrast adjustment on a GPU. The input gpuArray gpuarrayA is
an intensity image, RGB image, or a colormap. The output gpuArray gpuarrayB is
the same as the input image. This syntax requires the Parallel Computing Toolbox™.Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

J = imadjust(I) exampleJ = imadjust(I,[low_in;
high_in],[low_out; high_out]) exampleJ = imadjust(I,[low_in;
high_in],[low_out; high_out],gamma)newmap = imadjust(map,[low_in;
high_in],[low_out; high_out],gamma)RGB2 = imadjust(RGB1,___) examplegpuarrayB = imadjust(gpuarrayA,___) example


Example

Adjust Contrast of Grayscale ImageOpen This Example
Read a low-contrast grayscale image into the workspace and display it.I = imread('pout.tif');
imshow(I);

Adjust the contrast of the image so that 1% of the data is saturated at low and high intensities, and display it.J = imadjust(I);
figure
imshow(J)

Adjust Contrast of Grayscale Image on GPURead an image into a gpuArray and then pass the gpuArray
to imadjust.I = gpuArray(imread('pout.tif'));
figure
imshow(I)

J = imadjust(I); 
figure
imshow(J)Adjust Contrast of Grayscale Image Specifying Contrast LimitsOpen This Example
Read a low-contrast grayscale image into the workspace and display it.I = imread('pout.tif');
imshow(I);

Adjust the contrast of the image, specifying contrast limits.K = imadjust(I,[0.3 0.7],[]);
figure
imshow(K)

Adjust Contrast of Grayscale Image Specifying Contrast Limits on GPURead an image into a gpuArray and then pass the gpuArray
to imadjust.I = gpuArray(imread('pout.tif'));
figure
imshow(I)

K = imadjust(I,[0.3 0.7],[]);
figure
imshow(K)Adjust Contrast of RGB ImageOpen This Example
Read an RGB image into the workspace and display it.RGB = imread('football.jpg');
imshow(RGB)

Adjust the contrast of the RGB image, specifying contrast limits.RGB2 = imadjust(RGB,[.2 .3 0; .6 .7 1],[]);
figure
imshow(RGB2)

Adjust Contrast of RGB Image on GPURead an RGB image into a gpuArray and then pass the gpuArray
to imadjust, specifying contrast limits for the
input image.RGB = gpuArray(imread('football.jpg'));
RGB2 = imadjust(RGB,[.2 .3 0; .6 .7 1],[]);
figure
imshow(RGB)
figure
imshow(RGB2)


Output / Return Value


Limitations


Alternatives / See Also


Reference