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)".

 Akzeptierte Antwort

Thorsten
Thorsten am 19 Nov. 2014
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 Kommentare

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?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by