How to add random valued impulse noise in the image?

to processing the noisy image i want to add random valued impulse noise in the image..is there any keyword like to add salt and pepper noise i have used "imnoise(image name,'salt & pepper',0.2)".

 Réponse acceptée

To add uniformly distributed random noise you can use
I = im2double(rgb2gray(imread('peppers.png')));
p = 0.2; % p between 0 and 1
Ir = (I + p*rand(size(I)))/(1+p);
imshow([I Ir])
If that's not what you want, please expand on what you mean by "random valued impulse noise".

2 commentaires

can you please explain this code so that i can understand and change it according to my requirement
sir/madam, I am using this p = 0.2; % p between 0 and 1 Ir = (I + p*rand(size(I)))/(1+p) code for adding a random-valued impulse noise from grayscale images but this code doesn't give the clear results on my project. Can you please give me any other code related to adding a random-valued impulse noise?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by