Lesson 30: Removing Salt and Pepper Noise using Mean Filter in Matlab

Published: 23 November 2023
on channel: Nuruzzaman Faruqui
135
2

Noise is a common problem for image. And that makes the noise removal is a frequent task in image processing. In this tutorial, we are going to learn, how to remove salt and pepper noise using mean filter in MATLAB. Image processing in MATLAB is easier. Because, here we can use the built-in functions. To remove noise, we will use a built-in function of MATLAB named ‘imfilter()’. This function is used to apply various types of filter to images. In this tutorial, first I loaded an image. Then added salt and pepper noise to the image. After that, I created a 3 x 3 convolutional kernel. I converted the kernel into a mean filter by replacing the values of the matrix by 1/9. Finally using the ‘imfilter()’ function, I applied the mean filter to the image.

The code used in this lesson:

I = imread('sky.jpg');
N=imnoise(I,'salt & pepper', 0.03);
mf = ones(3, 3)/9;
noise_free = imfilter(N,mf);

subplot(2,2,1),imshow(I), title('Original Image');
subplot(2,2,2),imshow(N), title('Noisy Image');
subplot(2,2,3),imshow(noise_free), title('After Removing Noise');


Watch video Lesson 30: Removing Salt and Pepper Noise using Mean Filter in Matlab online without registration, duration hours minute second in high quality. This video was added by user Nuruzzaman Faruqui 23 November 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 135 once and liked it 2 people.