NAME
rayleigh_noise - Add Rayleigh noise to an image
SYNOPSIS
#include "CVIPnoise.h"
Image *rayleigh_noise(Image* imageP,float *variance);
<imageP> - pointer to Image structure
<var> - variance of noise distribution
PATH
$CVIPHOME/NOISE/noise.c
DESCRIPTION
Rayleigh type noise appears typically in radar range and
velocity images and is derivable from uniform noise. The
Rayleigh noise histogram is defined as:
Gi
hi = --------exp(-Gi^2/(2a^2) 0<=Gi<infinity
a^2
where Gi is the grey-level value of the ith pixel, and the
mean can be defined as follows: mean=sqrt(pi/2a).
RETURN VALUES
The rayleigh_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 rayleigh noise to the input
image with the variance equal to 100.0.We can use the
function rayleigh_noise_setup so that the user can
specify the inputs */
cvipImage = rayleigh_noise(cvipImage,&var);
print_CVIP("\n\t\tEnter the Output File Name: ");
outputfile = getString_CVIP();
view_Image(cvipImage,outputfile);
write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,format,1);
free(outputfile);
}
SEE ALSO
gamma_noise(3), gaussian_noise(3), neg_exp_noise(3),
speckle_noise(3), uniform_noise(3)
AUTHOR
Copyright (C) 1992, 1996 SIUE - by Scott E. Umbaugh and
David Lyons.