0% found this document useful (0 votes)
6 views8 pages

Advanced Power Protection Techniques

This document discusses various image filtering techniques including spatial filtering using correlation and convolution, nonlinear spatial filtering using padding, median filtering for salt and pepper noise removal, Laplacian filtering, and Gaussian filtering. Examples are provided using MATLAB code to demonstrate the different filtering methods on various test images.

Uploaded by

Ajmal Khan
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)
6 views8 pages

Advanced Power Protection Techniques

This document discusses various image filtering techniques including spatial filtering using correlation and convolution, nonlinear spatial filtering using padding, median filtering for salt and pepper noise removal, Laplacian filtering, and Gaussian filtering. Examples are provided using MATLAB code to demonstrate the different filtering methods on various test images.

Uploaded by

Ajmal Khan
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

ASSIGNMENT NO.

2
SUBJECT: ADVANCE POWER PROTECTION

Submitted By: RANA FARAN AHMED


[Link]: 16062244-009
Submitted To: [Link]
DATE: 06-05-2017

Spatial filtering
Correlation

f=[0 0 0 1 0 0 0 0];

w=[1 2 3 2 8];

g=imfilter(f,w,'corr',0,'full')

g=

0 0 0 8 2 3 2 1 0 0 0 0

f=imread('[Link]');
subplot(2,1,1);
imshow(f);
w=ones(31);
gd=imfilter(f,w);
subplot(2,1,2);
imshow(gd,[]);

Convolution
f=[0 0 0 0 0 ; 0 0 0 0 0 ; 0 0 1 0 0; 0 0 0 0 0;0 0 0 0 0];

w=[1 2 3;4 5 6;7 8 9];

g=imfilter(f,w,'conv','replicate')

0 0 0 0 0
0 1 2 3 0
0 4 5 6 0
0 7 8 9 0
0 0 0 0 0
Nonlinear spatial filter

f=[1 2;3 4];


fp=padarray(f,[3 2],'replicate' ,'post')

output
1 2 2 2
3 4 4 4
3 4 4 4
3 4 4 4
3 4 4 4

Median filter
f=imread('[Link]');
subplot(2,1,1);
imshow(f);
title('orginal image');
fn=imnoise(f,'salt & pepper',0.2);
gm=medfilt2(fn);
subplot(2,1,2);
imshow(gm);

Laplacian filter
I=imread('[Link]');
subplot(2,2,1);
imshow(I);
w4=fspecial('laplacian',0);
w8=[1 1 1;1 -8 1;1 1 1];
f=im2double(I);
g4=f-imfilter(f,w4,'replicate');
g8=f-imfilter(f,w8,'replicate');
subplot(2,2,2);
imshow(g4);
subplot(2,2,3);
imshow(g8);

Gaussian filter

f=imread('[Link]');
subplot(2,2,1);
imshow(f);
title('orignal image');
a=imnoise(f,'gaussian',0.01);
subplot(2,2,2);
imshow(a);
title('noised image');

sigma=3;
cutoff=ceil(3*sigma);
h=fspecial('gaussian',2*cutoff+1,sigma);
out=conv2(f,h,'same');
subplot(2,2,3);
imshow(out/256);
title('final image');

You might also like