Image Processing Toolbox User's Guide |
Perform contrast-limited adaptive histogram equalization (CLAHE)
Syntax
Description
J = adapthisteq(I)
enhances the contrast of the intensity image I
by transforming the values using contrast-limited adaptive histogram equalization (CLAHE).
CLAHE operates on small regions in the image, called tiles, rather than the entire image. Each tile's contrast is enhanced, so that the histogram of the output region approximately matches the histogram specified by the 'Distribution'
parameter. The neighboring tiles are then combined using bilinear interpolation to eliminate artificially induced boundaries. The contrast, especially in homogeneous areas, can be limited to avoid amplifying any noise that might be present in the image.
J = adapthisteq(I,param1,val1,param2,val2...)
specifies any of the additional parameter/value pairs listed in the following table. Parameter names can be abbreviated, and case does not matter.
Class Support
Intensity image I
can be of class uint8
, uint16
, int16
, single
, or double.
The output image J
has the same class as I
.
Example
This example applies Contrast-Limited Adaptive Histogram Equalization (CLAHE) to an image and display the results.
I = imread('tire.tif'); A = adapthisteq(I,'clipLimit',0.02,'Distribution','rayleigh'); figure, imshow(I); figure, imshow(A);
This example applies CLAHE to a color photograph.
[X MAP] = imread('shadow.tif'); % Convert indexed image to true-color (RGB) format RGB = ind2rgb(X,MAP); % Convert image to L*a*b* color space cform2lab = makecform('srgb2lab'); LAB = applycform(RGB, cform2lab); % Scale values to range from 0 to 1 L = LAB(:,:,1)/100; % Perform CLAHE LAB(:,:,1) = adapthisteq(L,'NumTiles',... [8 8],'ClipLimit',0.005)*100; % Convert back to RGB color space cform2srgb = makecform('lab2srgb'); J = applycform(LAB, cform2srgb); % Display the results figure, imshow(RGB); figure, imshow(J);
See Also
Functions -- Alphabetical List | applycform |
© 1994-2005 The MathWorks, Inc.