How to add to an image white Gaussian noise of zero mean and standard deviation of certain gray levels?
Show older comments
Hello everyone, How can we add white Gaussian noise to an image with zero mean and standard deviation of 64 gray levels? I do know how to add noise of zero mean and variance using imnoise but I do not know about standard deviation of 64 gray levels.
Accepted Answer
More Answers (1)
lakpa tamang
on 13 Dec 2019
0 votes
why is the mean not 0 in your code, yet he is asking for awgn?
1 Comment
Image Analyst
on 13 Dec 2019
I used randn() to get 640*480 = 307,200 samples. Since these are RANDOM, the mean will not necessarily be exactly at zero. Imagine if you asked for only 4 values. Would you expect the value to be at exactly zero:
>> r=randn(1, 4)
r =
-0.740261712090743 -0.384816596337627 -0.581927647800475 1.27720101511378
>> mean(r)
ans =
-0.107451235278765
See, not exactly zero even though randn() draws from a standard normal distribution.
I don't know how important it was to him to have a mean of exactly zero versus having random numbers drawn from a distribution. I'd imagine having the random numbers is fine and the fact that they don't have a mean of exactly zero doesn't really matter to him. If it did, he could subtract the mean or something like that.
Categories
Find more on Red in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!