No BSD License
-
clipHistogram(Hist,NrBins,Cli...
This function performs clipping of the histogram and redistribution of bins.
-
interpolate(subBin,LU,RU,LB,R...
-
makeHistogram(Bin,XSize,YSize...
This function classifies the greylevels present in the array image into
-
makeLUT(Min,Max,NrBins)
To speed up histogram clipping, the input image [Min,Max] is scaled down to
-
mapHistogram(Hist,Min,Max,NrB...
This function calculates the equalized lookup table (mapping) by
-
runCLAHE(Image,XRes,YRes,Min,...
"Contrast Limited Adaptive Histogram Equalization"
-
View all files
from
Contrast Limited Adaptive Histogram Equalization (CLAHE)
by Leslie Smith
Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485
|
| interpolate(subBin,LU,RU,LB,RB,XSize,YSize)
|
function [subImage] = interpolate(subBin,LU,RU,LB,RB,XSize,YSize)
% pImage - pointer to input/output image
% uiXRes - resolution of image in x-direction
% pulMap* - mappings of greylevels from histograms
% uiXSize - uiXSize of image submatrix
% uiYSize - uiYSize of image submatrix
% pLUT - lookup table containing mapping greyvalues to bins
% This function calculates the new greylevel assignments of pixels within a submatrix
% of the image with size uiXSize and uiYSize. This is done by a bilinear interpolation
% between four different mappings in order to eliminate boundary artifacts.
% It uses a division; since division is often an expensive operation, I added code to
% perform a logical shift instead when feasible.
%
subImage = zeros(size(subBin));
num = XSize * YSize;
for i = 0:XSize-1
inverseI = XSize - i;
for j = 0:YSize-1
inverseJ = YSize - j;
val = subBin(i+1,j+1);
subImage(i+1,j+1) = fix((inverseI*(inverseJ*LU(val) + j*RU(val)) ...
+ i*(inverseJ*LB(val) + j*RB(val)))/num);
end
end
|
|
Contact us at files@mathworks.com