KEMBAR78
4.Image Filtering | PDF
0% found this document useful (0 votes)
2 views1 page

4.Image Filtering

Uploaded by

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

4.Image Filtering

Uploaded by

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

% image filtering

i = im2double(imread('D:\Zhahi tech\project\final\img\fa.jpg'));
% Implement Image Filter
g = rgb2gray(i);
subplot(3, 3, 1);
imshow(g);
title('Original Gray Image');

% Add Gaussian noise to simulate a noisy image


noise = imnoise(g, 'gaussian'); % Gaussian noise
subplot(3, 3, 2);
imshow(noise);
title('Gaussian Noise Image');

% 1. Mean Filter
mean = fspecial('average');
x = imfilter(noise, mean);
subplot(3, 3, 3);
imshow(x);
title('Mean Filtered Image');

% 2. Gaussian Filter
gaussian = fspecial('gaussian');
y = imfilter(noise, gaussian);
subplot(3, 3, 4);
imshow(y);
title('Gaussian Filtered Image');

% 3. Median Filter
median = medfilt2(noise);
subplot(3, 3, 5);
imshow(median);
title('Median Filtered Image');

You might also like