资源简介
Matlab编写的CLAHE,非常值得借鉴。
代码片段和文件信息
function [Hist] = clipHistogram(HistNrBinsClipLimitNrXNrY)
% This function performs clipping of the histogram and redistribution of bins.
% The histogram is clipped and the number of excess pixels is counted. Afterwards
% the excess pixels are equally redistributed across the whole histogram (providing
% the bin count is smaller than the cliplimit).
for i = 1:NrX
for j = 1:NrY
% Calculate the total number of excess pixels.
NrExcess = 0;
for nr = 1:NrBins
excess=Hist(ijnr) - ClipLimit;
if excess > 0
NrExcess = NrExcess + excess;
end
end
% Clip histogram and redistribute excess pixels in each bin
binIncr = NrExcess / NrBins;
upper = ClipLimit - binIncr;
for nr = 1:NrBins
if Hist(ijnr) > ClipLimit
Hist(ijnr) = ClipLimit;
else
if Hist(ijnr) > upper
NrExcess = NrExcess + upper - Hist(ijnr);
Hist(ijnr) = ClipLimit;
else
NrExcess = NrExcess - binIncr;
Hist(ijnr) = Hist(ijnr) + binIncr;
end
end
end
if NrExcess > 0
stepSize = max(1fix(1+NrExcess/NrBins));
for nr = 1:NrBins
NrExcess = NrExcess - stepSize;
Hist(ijnr) = Hist(ijnr) + stepSize;
if NrExcess < 1
break;
end
end
end
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2406781 2010-04-27 01:56 CLAHE\Contrast_limited_adaptive_histogram_equalization-JoDI-1998.pdf
文件 516 2008-11-19 18:26 CLAHE\mapHistogram.m
文件 369 2008-11-19 23:31 CLAHE\makeLUT.m
文件 1637 2008-11-06 19:36 CLAHE\clipHistogram.m
文件 3346 2010-04-27 03:58 CLAHE\runCLAHE.m
文件 3346 2010-04-27 04:27 CLAHE\runCLAHE.m~
文件 1122 2008-11-20 00:22 CLAHE\interpolate.m
文件 653 2008-11-19 23:50 CLAHE\makeHistogram.m
- 上一篇:图像滤波算法之guide filter导向滤波
- 下一篇:matlab bgl工具箱
评论
共有 条评论