MATLAB adaptive histogram equalization -adapthisteq

Today write call camera image processing functions, uses adapthisteq function, the way to do some function adapthisteq summary.

adapthisteq: adapt histogram equalization contrast limiter. To change the contrast of the image by converting intensity values ​​of the image.

histeq: adaptive histogram equalization.

And histeq function is different, adapthisteq processed image data small area rather than the entire image contrast enhancement, histogram so that approximately match the specified output area histogram. Adjacent pieces using bilinear interpolation mixing them together to eliminate artificially induced boundaries. Contrast, especially in homogeneous areas, may be limited, in order to avoid noise that may be present in an enlarged image.

G = adapthisteq (I, PARAM1, val1, PARAM2, val2, ...)

'NumTiles' : bivariate vector of positive integers [m, n]. [M, n] is the number of specified ranks, M and n small area must be at least 2. Is equal to the total number of image blocks m * n. The default value of [8,8].

'ClipLimit' : real scalar is from 0 to 1, for limiting contrast enhancement. The larger the value, the higher the contrast. The default value: 0.01.

'Nbins' : positive integer scalar. Construct is used to set the number Histograms vessel contrast-enhancing conversion. Higher values have resulted in a larger dynamic range, cost of slower processing speed. Default: 256.

'The Range' : 'Original' or 'full' control range of the output image data. If the 'Range' to 'original', is limited to the range [min (i (:)) max (i (:))]. Otherwise, default, or when the 'Range' is set to 'full', we will use the entire range of the output image class (eg uint8 is [0255]). Default value: full.

'Distribution's' : 'Uniform', 'Rayleigh', 'Exponential'. By specifying the type of distribution, the desired shape of the histogram is provided for the image block. Default value: uniform.

'The Alpha' : is a distribution parameter, when "Dist" is "rayleigh" or "exponential" can use this parameter. Default value: 0.4.

Here is a hand written code, you can visually see adapthisteq the use of methods and results.

I = rgb2gray(imread('tupian.png'));
figure;
imshow(I);

I1 = adapthisteq(I);
figure;
imshow(I1);

I2 = adapthisteq(I,'NumTiles',[50 50]);
figure;
imshow(I2);

I3 = adapthisteq(I,'NumTiles',[50 50],'ClipLimit',0.5);
figure;
imshow(I3);

I4 = adapthisteq(I,'NumTiles',[50 50],'ClipLimit',...
0.5,'NBins',400);
figure;
imshow(I4);

Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Note here that the first line of code,

I = rgb2gray(imread('tupian.png'));
I = imread('tupian.png');

A lot of people forget to do gray scale processing errors lead to adapthisteq use.

Writing time is tight, if wrong, please correct me.

Released four original articles · won praise 7 · views 2566

Guess you like

Origin blog.csdn.net/qq_45504119/article/details/104235772