Professional Documents
Culture Documents
Iip Exp 8 31116
Iip Exp 8 31116
PUNE-411043
I. CODE:
(a) Histogran plotting
clc;
close all;
clear all;
x=imread('cameraman.tif');
imshow(x);
[r c]=size(x);
m=max(max(x));
h=zeros(1,m);
z=0;
for i=1:r
for j=1:c
if x(i,j)==0
z=z+1;
else
h(1,x(i,j))=h(1,x(i,j))+1;
end
end
end
out=[z,h];
figure,stem(out);
figure,bar(out);
title('-Histogram-');
set(gca,'XTick',0:25:m);
y=out;
end
RESULT:
1)Dark
2) Light:
3) Low Contrast:
4) High Contrast:
B] Histogram Equalization: