signal lab (matlab)

13
Remove Salt and Pepper Noise from Images Amin Ur Rehman Waqas Adnan Waqar Alam CECOS UNIVERSITY OF IT & EMERGING SCIENCES PESHAWAR

Upload: amin-ur-rehman

Post on 14-Apr-2017

109 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Signal lab (matlab)

Remove Salt and Pepper Noise from Images

Amin Ur RehmanWaqas AdnanWaqar Alam

CECOS UNIVERSITY OF IT & EMERGING SCIENCES PESHAWAR

Page 2: Signal lab (matlab)

INTRODUCTION

We have use Median filtering Technique for removal of Salt andPepper Noise from Images.

Because it can remove salt and pepper noise without significantly reducing the sharpness of an image.

In this project we have used the Median Filter block to remove saltand pepper noise from an intensity image.

Page 3: Signal lab (matlab)

PROCEDURE

STEP 01:

Define an intensity image in the MATLAB workspace and addnoise to it.

Typing the code we get the image.

Coding for image display

Page 4: Signal lab (matlab)

Codding

>> i=imread('chm.jpg');>> imshow(i)

Page 5: Signal lab (matlab)
Page 6: Signal lab (matlab)

Now for image size we have the code

>> size(i)

ans =

302 218 2

>> whos iName Size Bytes Class Attributes

i 302x218x2 197508 uint8

Page 7: Signal lab (matlab)

For Pixcel Infomation

>> imtool(i)

Page 8: Signal lab (matlab)

Now we add noisy to the above original image by typing the following code and got the noisy image as shown below.

Coding for getting salt & pepper image:

>> noisy_img = imnoise(i,'salt & pepper',0.02);>> imshow(noisy_img)

Page 9: Signal lab (matlab)
Page 10: Signal lab (matlab)

Now for removing the noisy we use direct filtering command

“Med filter command” with ‘2’ for two dimensional vector image.

Coding for removing:

k = medfilt2(noisy_img);close all;subplot(211);imshow(noisy_img); subplot(212); imshow(k);

Page 11: Signal lab (matlab)
Page 12: Signal lab (matlab)
Page 13: Signal lab (matlab)

Contact: [email protected]