0% found this document useful (0 votes)
57 views6 pages

Dip - Programs

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views6 pages

Dip - Programs

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

PROGRAM – 1

img = imread("C:\Users\Hp\Downloads\HUMMING
BIRD.jpeg");
if ndims(img)==3 then
img1=rgb2gray(img)
end
hist=histc(img(:),0:255)
subplot(1,3,1);
imshow(img);
title("ORIGINAL IMAGE");
subplot(1,3,2);
imshow(img1);
title("GRAY SCALE IMAGE");
subplot(1,3,3);
bar(hist,'b');
title("IMAGE HISTOGRAM");
xlabel("PIXEL VALUE");
ylabel("FREQUENCY");
PROGRAM – 2
img=imread("C:\Users\Hp\Downloads\LION.jpeg");
maping=imadjust(img,[0.3 0.7],[0 1]);
subplot(1,2,1);
imshow(img);
title("ORIGINAL IMAGE");
subplot(1,2,2);
imshow(maping);
title("ENHANCED IMAGE");
PROGRAM – 3
clc;
clear;
close;
img=imread("C:\Users\Hp\Downloads\LION.jpeg");
grayimg=rgb2gray(img);
hist=histc(grayimg(:),0:255);
cdf=cumsum(hist);
cdf_normal=(cdf-min(cdf))/(max(cdf)-min(cdf))*255;
eqimg=cdf_normal(grayimg+1);
hist1=histc(eqimg(:),0:255)
subplot(1,3,1);
bar(hist1,'g');
title("IMAGE HISTOGRAM");
subplot(1,3,2);
bar(hist1,'g');
title("ORIGINAL IMAGE");
subplot(1,3,3);
bar(hist,'g');
title("HISTOGRAM EQUALIZATION");

PROGRAM – 4
clear;
i=imread("C:\Users\Hp\Downloads\flower.jpeg");
j=imread("C:\Users\Hp\Downloads\HUMMING BIRD.jpeg");
k=imadd(i,j);
subplot(3,2,1);
imshow(i);
title("ORIGINAL MESSAGE 1");
subplot(3,2,2);
imshow(j);
title("ORIGINAL MESSAGE 2");
subplot(3,2,3);
imshow(k);
title("ADDITION");
d=imabsdiff(i,j);
subplot(3,2,4);
imshow(d);
title("DIFFERENCE");
m=immultiply(i,j);
subplot(3,1,4);
subplot(m);
title("MULTIPLY");
v=imdivide(i,j);
subplot(3,2,1);
imshow(v);
title("DIVIDE");
subplot(3,2,4);

You might also like