Re: How to add standard gaussian noise to a image pixel [message #42182] |
Thu, 06 January 2005 08:01 |
coold
Messages: 8 Registered: December 2004
|
Junior Member |
|
|
Can you please suggest how I can add standard gaussian noise with
zero mean and standard deviation of different values like .5, 1,1.5 in
IDL to a pixel using randomn()
The following code
nx=60
ny=60
nz=100
noisy[*,*,*] = original[*,*,*] + randomn(seed,nx,ny,nz) does seem to
work.
Thanks.
coold
|
|
|
Re: How to add standard gaussian noise to a image pixel [message #42188 is a reply to message #42182] |
Wed, 05 January 2005 12:54  |
K. Bowman
Messages: 330 Registered: May 2000
|
Senior Member |
|
|
In article <1104952168.802765.153500@c13g2000cwb.googlegroups.com>,
"coold" <rodricks_is@yahoo.com> wrote:
> Could you please suggest how I can add standard gaussian noise with
> zero mean and standard deviation of different values like .5, 1,1.5 in
> IDL
>
> I have tried the following as mentioned in IDL help guide
> nx=60
> ny=60
> nz=100
> noisy[*,*,*] = original[*,*,*] + randomn(seed,nx,ny,nz)
>
> But the spectrum(output) I get for each pixel is not like expected.
> Thanks for any help.
> coold
>
It looks like uncorrelated Gaussian noise to me:
IDL> nx=60
IDL> ny=60
IDL> nz=100
IDL> r = randomn(seed,nx,ny,nz)
IDL> help, r
R FLOAT = Array[60, 60, 100]
IDL> print, mean(r)
% Compiled module: MEAN.
% Compiled module: MOMENT.
-0.00114778
IDL> print, stdev(r)
% Compiled module: STDEV.
0.999860
IDL> plot, histogram(r,nbins=100)
IDL> plot, r, shift(r,1), psym=3, /isotropic
Ken Bowman
|
|
|