Remove Salt and Pepper Noise from Images
Amin Ur RehmanWaqas AdnanWaqar Alam
CECOS UNIVERSITY OF IT & EMERGING SCIENCES PESHAWAR
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.
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
Codding
>> i=imread('chm.jpg');>> imshow(i)
Now for image size we have the code
>> size(i)
ans =
302 218 2
>> whos iName Size Bytes Class Attributes
i 302x218x2 197508 uint8
For Pixcel Infomation
>> imtool(i)
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)
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);
Contact: [email protected]