Help for GAUSNOIS
PURPOSE:
GAUSNOIS generates an image with random pixel values where the pixel values
are distributed according to a gaussian (normal or bell shaped) probability
distribution. This type of a noise image can be useful in tests.
EXECUTION:
GAUSNOIS NOISE.IMG NL=200 NS=300 MEAN=100 SIGMA=25 FORMAT=BYTE SEED=7382382
This is an example using all of the parameters: it produces a 200x300 byte
image with mean 100 and standard deviation 25, and starts the random number
generator with that particular seed.
OPERATION
The SEED parameter is provided so that the same random images can be generated.
If it is defaulted, the seed for the random number generator comes from the
system time.
Convenient seed numbers for test scripts have been: 16777215, 1073741969,
-7382382, 4617316,-74526, 94151, 97, -768825576, and -6.
Then two calls to rangen are used to generate x and y which plug into a formula
u = sqrt((-2.)*log(x)) * cos(2*3.1415927*y)
which, in turn are used to generate each sample value in the buffer.
sample = sigma*u + mean
All of the parameters except the output image can be defaulted.
PERFORMANCE:
The following performance was directed towards VAX/VMS users:
The ported version of GAUSNOIS is approximately half the speed of
the original GAUSNOIS. The primary reason for this is that the random
number generator, RANGEN, is half the speed of the VAX/VMS routine RAN.
Steve Pohorsky agrees that this is unavoidable without a significant
rewrite to the program, including writing a seperate vectorized version of
the random number generator.
The Linux version uses a call to the system time, in seconds passed
1 Jan 70 to initialize the seed.
HISTORY:
VMS Original Programmer : Frank Evans August 1985
Cognizant Programmer: Ray Bambery
Revisions:
1994-06 - Steve Hwan - Ported to UNIX
2011-04-15 - Ray Bambery - Fails under 64-bit linux
Internal call to get_seconds somehow corrupts
sigma parameter to always be zero. Fixed by
reordering xvp calls. This shouldn't be but
I could not find what was tromping on sigma.
2011-05-10 - Ray Bambery - Fixed failure to create file
on gfortran 4.4.4
2012-06-06 - Ray Bambery - gfortran 4.6.3 revealed that
rangen parameters are (long,float) so
created integer*8 dseed replacement for
integer*4 seed - sigma always became zero
when seed was entered into rangen
2012-06-18 - Ray Bambery - get_seconds parameter is also
integer*8
rangen and get_seconds parameters were what
was causing sigma to be 0 in 4-15-2011 comments
2013-08-11 - Ray Bambery - changed internal calls from
get_seconds to get_seconds_big and rangen to
rangen_big to prevent conflict with other
programs which call these routines
2016-06-08 - Walt Bunch - Removed "_big" from get_seconds and
rangen. Migrated back to MIPL.
PARAMETERS:
OUT
Output image
NS
Number of lines
NL
Number of samples
MEAN
The mean of the distribution
SIGMA
The standard deviation
of the distribution
SEED
The starting seed for the
random number generator
FORMAT
Output format (default BYTE)
.END
See Examples:
Cognizant Programmer: