lvggauss(3)

LIBRARY ROUTINE
lvggauss - Creates a Gaussian (noise) image.

LIBRARY CALL
#include "vinclude.h"
int
lvggauss(image,rows,cols,bands,mean,var,type,doadd)
  struct xvimage **image;
  int            rows,cols,bands,type,doadd;
  float          mean,var;

INPUT

image
    pointer to VIFF structure containing image data to be processed.

rows
    number of rows in image

cols
    number of columns in image

bands
    number of data bands in image

mean
    mean of Gaussian data

variance
    variance of Gaussian data

type
    data type of resulting image. Must be either VFF_TYP_FLOAT or VFF_TYP_COMPLEX

doadd
    flag to indicate if data is to be added to the input image. If this flag is set, then add the noise to the data that currently sits in image.

OUTPUT

image
    pointer to VIFF structure containing image data after processing.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

Jeremy Worley   June 4, 1990
    library now calls ggauss in vmath.a

Jeremy Worley   June 5, 1990
    single band bug in call to createdata fixed

Jeremy Worley   Februaru 1, 1991
    modified to accept optional input image

DESCRIPTION
creates a two dimensional multi-band Gaussian (noise) image of dimension rows * columns or adds noise to the optional input image. The Gaussian image is generated using the Box-Muller transformation.

SEE ALSO
vggauss(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
can only generate VFF_TYP_FLOAT and VFF_TYP_COMPLEX type images.

AUTHOR
Ramiro Jordan, Jeremy Worley

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.