How to add random valued impulse noise in the image?

2 views (last 30 days)
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)".

Accepted Answer

Thorsten
Thorsten on 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 Comments
syeda hira
syeda hira on 14 Jan 2017
can you please explain this code so that i can understand and change it according to my requirement
sravani honey
sravani honey on 12 Apr 2018
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?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!