I want a method to remove the salt and pepper effect from an image without using the built-in functions of MATLAB. How can I do this?

The algorithm used in fspecial is given in the documentation which is very simple in your case.

The algorithm used in fspecial is given in the documentation which is very simple in your case >> fspecial('average',3) ans = 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 >> ones(3,3)/(3*3) ans = 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 0.1111 To implement the median filtering, you should traverse each pixel on the image. If in(x,y) is the value of the pixel at coordinates x,y in the input image, then out(x,y) will be the median of in(x-1:x+1,y-1:y+1) in your case with 3,3 window. I think, you should implement it yourself since this is a homework.

For your information, filter2(fspecial('average',3),RGB)/255; does not remove the salt and pepper noise. It blurs the image, i.e. Removes the Gaussian noise but I actually recommend Gaussian window for that.

You can read this for creating a Gaussian kernel which may help you to understand fspecial better.

Thanks for the help ,ya I am trying now to look for an answer and it kinda confusing as it is my first time using matlab and I hate math :P,thanks once again – user1073372 Nov 30 at 14:35 @user1073372 - You may upvote an answer if you enjoy it. And mark an answer as "accepted" to officially inform the answerer that his answer was correct (and the best if there are more than one). Good luck to you with math :) – Ä°smail Arı Nov 30 at 14:42 I want to upvote it but I still need 15 marks to do that :), and your answer is correct I am just having a proplem translating it :) so I researched the codes again and found , >>J = imnoise(I,'gaussian',0,0.025); >>K = wiener2(J,5 5); hoping it will be good enough for me :D – user1073372 Nov 30 at 17:35.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions