NAME

     neg_exp_noise - Add Negative Exponential noise to an image

SYNOPSIS

     #include "CVIPnoise.h"

     Image *neg_exp_noise(Image *imageP,float *var);

      <imageP> - pointer to Image structure
      <var> - variance of noise distribution

PATH

     $CVIPHOME/NOISE/noise.c

DESCRIPTION

     Negative Exponential type noise is the result  of  acquiring
     an image illuminated with a coherent laser.  The optics com-
     munity refers to this type of noise as laser speckle. It has
     a histogram as indicated by the following equation:

                 1
          hi = ----exp(-Gi/a)
                 a

     where Gi is the grey-level value of the ith  pixel,  a*a  is
     the variance.

RETURN VALUES

     The neg_exp_noise()  function  returns  the  modified  Image
     pointer on success, and returns a NULL pointer on failure

BUGS

     none

EXAMPLE

      #include <CVIPtoolkit.h>
      #include <CVIPimage.h>
      #include <CVIPconvert.h>
      #include <CVIPview.h>
      #include "CVIPnoise.h"
      #define VIEWER "picture"
      #define VIDEO_APP "SunVideo &"

      void main()
      {
      Image *cvipImage;
      IMAGE_FORMAT format;
      char *inputfile,*outputfile;
      float var=100.0;

      setDisplay_Image(VIEWER, "Default");

      print_CVIP("\n\t\tEnter the Input File Name:  ");
      inputfile =(char *) getString_CVIP();
      format = getFormat_CVIP(inputfile);
      cvipImage = read_Image(inputfile, 1);
      view_Image(cvipImage, inputfile);
      free(inputfile);
      /* the following call adds negative exponential noise
      to the input image with the variance equal to 100.0.
      We can use the function neg_exp_noise_setup so
      that the user can specify the inputs  */
      cvipImage = neg_exp_noise(cvipImage,&var);
      print_CVIP("\n\t\tEnter the Output File Name:  ");
      outputfile = getString_CVIP();
      view_Image(cvipImage,outputfile);
      free(outputfile);;
      }

SEE ALSO

     gamma_noise(3),    gaussian_noise(3),     rayleigh_noise(3),
     speckle_noise(3), uniform_noise(3)

AUTHOR

     Copyright (C) 1992, 1996 SIUE -  by  Scott  E.  Umbaugh  and
     David Lyons.