image thumbnail

histogram Equilization

by

 

histogram Equilization without matlab build function

histequilization.m
f=imread('moon.tif');
imshow(f),figure,imhist(f);
ylim('auto')
g=histeq(f,256);%default is 64
figure ,imshow(g)
figure,imhist(g)
ylim('auto')
%ylim([ymin ymax]);
%Normalized histogram
hnorm=imhist(f)./numel(f);
cdf=cumsum(hnorm);% cumulative sum of elements
x=linspace(0,1,256);
figure,plot(x,cdf)
set(gca, 'xtick',0:0.2:1)% xtick show horizontal interval,gca(get Current axis)
set(gca, 'ytick',0:0.2:1)
xlabel('Input Intensity values', 'fontsize',9)
ylabel('Output Intensity values', 'fontsize',9)
text(0.10,0.5,'Transformation function','fontsize',9)

Contact us