How can i do BI-HISTOGRAM EQUALIZATION in MATLAB
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tuhin Sheikh
am 5 Mai 2013
Kommentiert: Image Analyst
am 18 Okt. 2015
The folling program i tried but it didn't work properly.
I=imread('tire.tif');
%performing bi-histogram equalization
L=256;
[m,n]=size(I);
len=m*n;
x=reshape(I,len,1);
xm=round(mean(x));
xl=x([x<=xm]);
xu=x([x>xm]);
%%%%%%%%%%%%%%%%%%%%%%%%%%
xlpdf=hist(xl,[0:xm]);
xlnpdf=xlpdf/length(xl);
xupdf=hist(xu,[xm+1:255]);
xunpdf=xupdf/length(xu);
%%%%%%%%%%%%%%%%%%%%%%%%%
skl=xm*xlnpdf*triu(ones(55));
sku=(xm+1)+((L-1-(xm+1))*xunpdf*triu(ones(201)));
sk=[skl,sku];
y0=zeros(m,n);
for k=0:L-1
list=find(I==k); %find locates the non-zero values
y0(list)=sk(k+1);
end
y0=uint8(y0);
imwrite(y0,'biHE.tif','TIFF');
j=imread('biHE.tif');
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 5 Mai 2013
Use intlut() instead of that for loop. You create a look up table of output values for each input value.
8 Kommentare
afrin sulthana
am 18 Okt. 2015
can i use this program for contrast enhancement and brightness preserving using bi histogram equalisation
Image Analyst
am 18 Okt. 2015
Who are you asking? All I know is the opinions and guesses I gave in my last comment. I don't have any code for bi-histogram equalization.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!