Question

I am trying to add gaussian noise to an image using the pdf model. I have searched for hours but the only thing I get is either imnoise or a manual code as below:

Inoise = Orig_img + (sqrt(variance)*randn(size(Orig_img)) + mean);

The pdf for gausssian noise is:

pdf of gaussian

Any way I can use this to generate noise in an image

Était-ce utile?

La solution 2

So the only solution (and correct one) found is

Inoise = Orig_img + (sqrt(variance)*randn(size(Orig_img)) + mean);

pdf are only meant to see the noise shape, pattern etc.

Autres conseils

The code you have given is correct. You can do the same with

mu    = ...
sigma = ...
im_with_noise = im_original + normrnd(mu,sigma, size(im_original));
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top