mihaispr
Administrator
Inregistrat: acum 17 ani
Postari: 2142
|
|
Extras din documentatia functiei:
ADAPTHISTEQ Performs Contrast-Limited Adaptive Histogram Equalization (CLAHE). ADAPTHISTEQ enhances the contrast of images by transforming the values in the intensity image I. Unlike HISTEQ, it operates on small data regions (tiles), rather than the entire image. Each tile's contrast is enhanced, so that the histogram of the output region approximately matches the specified histogram. The neighboring tiles are then combined using bilinear interpolation in order to eliminate artificially induced boundaries. The contrast, especially in homogeneous areas, can be limited in order to avoid amplifying the noise which might be present in the image. J = ADAPTHISTEQ(I) Performs CLAHE on the intensity image I. J = ADAPTHISTEQ(I,PARAM1,VAL1,PARAM2,VAL2...) sets various parameters. Parameter names can be abbreviated, and case does not matter. Each string parameter is followed by a value as indicated below: 'NumTiles' Two-element vector of positive integers: [M N]. [M N] specifies the number of tile rows and columns. Both M and N must be at least 2. The total number of image tiles is equal to M*N. Default: [8 8]. 'ClipLimit' Real scalar from 0 to 1. 'ClipLimit' limits contrast enhancement. Higher numbers result in more contrast. Default: 0.01. 'NBins' Positive integer scalar. Sets number of bins for the histogram used in building a contrast enhancing transformation. Higher values result in greater dynamic range at the cost of slower processing speed. Default: 256. 'Range' One of the strings: 'original' or 'full'. Controls the range of the output image data. If 'Range' is set to 'original', the range is limited to [min(I() max(I()]. Otherwise, by default, or when 'Range' is set to 'full', the full range of the output image class is used (e.g. [0 255] for uint8). Default: 'full'. 'Distribution' Distribution can be one of three strings: 'uniform', 'rayleigh', 'exponential'. Sets desired histogram shape for the image tiles, by specifying a distribution type. Default: 'uniform'. 'Alpha' Nonnegative real scalar. 'Alpha' is a distribution parameter, which can be supplied when 'Dist' is set to either 'rayleigh' or 'exponential'. Default: 0.4. Notes ----- - 'NumTiles' specify the number of rectangular contextual regions (tiles) into which the image is divided. The contrast transform function is calculated for each of these regions individually. The optimal number of tiles depends on the type of the input image, and it is best determined through experimentation. - The 'ClipLimit' is a contrast factor that prevents over-saturation of the image specifically in homogeneous areas. These areas are characterized by a high peak in the histogram of the particular image tile due to many pixels falling inside the same gray level range. Without the clip limit, the adaptive histogram equalization technique could produce results that, in some cases, are worse than the original image. - ADAPTHISTEQ can use Uniform, Rayleigh, or Exponential distribution as the basis for creating the contrast transform function. The distribution that should be used depends on the type of the input image. For example, underwater imagery appears to look more natural when the Rayleigh distribution is used. Class Support ------------- Intensity image I can be uint8, uint16, int16, double, or single. The output image J has the same class as I. Example 1 --------- Apply Contrast-Limited Adaptive Histogram Equalization to the rice.png image. Display the enhanced image. I = imread('tire.tif'); A = adapthisteq(I,'clipLimit',0.02,'Distribution','rayleigh'); figure, imshow(I); figure, imshow(A); Example 2 --------- Apply Contrast-Limited Adaptive Histogram Equalization to a color photograph. [X MAP] = imread('shadow.tif'); RGB = ind2rgb(X,MAP); % convert indexed image to truecolor format cform2lab = makecform('srgb2lab'); LAB = applycform(RGB, cform2lab); %convert image to L*a*b color space L = LAB(:,:,1)/100; % scale the values to range from 0 to 1 LAB(:,:,1) = adapthisteq(L,'NumTiles',[8 8],'ClipLimit',0.005)*100; cform2srgb = makecform('lab2srgb'); J = applycform(LAB, cform2srgb); %convert back to RGB figure, imshow(RGB); %display the results figure, imshow(J);
|
|