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.
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:
Any way I can use this to generate noise in an image
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));