문제

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