image processing in matlab

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

Upload: amin-ur-rehman

Post on 10-Feb-2017

361 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: image processing in matlab

Remove Salt and Pepper Noise from Images

Amin Ur RehmanWaqas AdnanWaqar Alam

CECOS UNIVERSITY OF IT & EMERGING SCIENCES PESHAWAR

Page 2: image processing in matlab

INTRODUCTION

We have use Median filtering Technique for removal of Salt and Pepper 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 salt and pepper noise from an intensity image.

Page 3: image processing in matlab

PROCEDURE

STEP 01:

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

Typing the code we get the image.

Coding for image display

Page 4: image processing in matlab

Codding

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

Page 5: image processing in matlab
Page 6: image processing in matlab

Now for image size we have the code

>> size(i)

ans =

302 218 2

>> whos i Name Size Bytes Class Attributes

i 302x218x2 197508 uint8

Page 7: image processing in matlab

For Pixcel Infomation

>> imtool(i)

Page 8: image processing in 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: image processing in matlab
Page 10: image processing in 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: image processing in matlab
Page 12: image processing in matlab
Page 13: image processing in matlab

Contact: [email protected]