资源简介
对比度受限的自适应直方图均衡化matlab代码
代码片段和文件信息
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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1637 2008-11-06 14:36 CLAHE_matlab代码\clipHistogram.m
文件 1122 2008-11-19 19:22 CLAHE_matlab代码\interpolate.m
文件 653 2008-11-19 18:50 CLAHE_matlab代码\makeHistogram.m
文件 369 2008-11-19 18:31 CLAHE_matlab代码\makeLUT.m
文件 516 2008-11-19 13:26 CLAHE_matlab代码\mapHistogram.m
文件 3397 2008-11-20 07:25 CLAHE_matlab代码\runCLAHE.m
目录 0 2010-03-01 16:30 CLAHE_matlab代码
----------- --------- ---------- ----- ----
7694 7
- 上一篇:matlab曲面拟合
- 下一篇:IEEE 802.11n matlab代码
评论
共有 条评论