資源簡介
對比度受限的自適應直方圖均衡化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代碼
評論
共有 條評論