سؤال

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

هل كانت مفيدة؟

المحلول 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.

نصائح أخرى

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));
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top