Dip Exp 4 .[ High Pass Filtering ]

 clear all;

clc;
aa=imread('sample.jpg');
a=double(rgb2gray ...
(aa));
% ab=imnoise(aa);
% a=double(ab);
w=[-1 -2 -1;-2 12 -2;-1 -2 -1]
[row col]=size(a);
for x=2:1:row-1
for y=2:1:col-1
a1(x,y)=(a(x-1,y-1)*w(1)+a(x-1,y)*w(2)+a(x-1,y+1)*w(3)+a(x,y-1)*w(4)+a(x,y)*w(5)+a(x,y+1)*w(6)+a(x+1,y-1)*w(7)+a(x+1,y)*w(8)+a(x+1,y+1)*w(9));
end
end
subplot(121)
figure(1)
imshow(uint8(a))
title('ORIGINAL IMAGE');
subplot(122)
imshow(uint8(a1))
title('HIGH PASS FILTERED IMAGE');
Next Post Previous Post
No Comment
Add Comment
comment url