Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: How to add standard gaussian noise to a image pixel
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
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