NAME
homomorphic - performs homomorphic filtering on an input
image
SYNOPSIS
#include "CVIPimage.h"
#include "CVIPtransform.h"
#include "CVIPxformfilter.h"
#include <limits.h>
Image* homomorphic(Image *cvipImage,float upper, float lower,int cutoff)
<cvipImage> - pointer to an Image
<upper> - upper limit, > 1
<lower> - lower limit, < 1
<cutoff> - cutoff frequency
DESCRIPTION
Homomorphic filtering is used to reduce the effect of
illumination variations in a scene while emphasizing the
reflectance components. This function has a setup routine,
called by CVIPtools, to allow the user to input the upper
and lower limits and cutoff frequency of the filter. The
upper limit should be greater than 1; the lower limit should
be less than 1. Typical values range between 2.0 and 0.5.
There is another function, get_function, that will return a
floating point array containing the distribution of a filter
mask created using a sine wave.
PATH
$CVIPHOME/XFORMFILTER/homomorphic.c
TYPES AND CONSTANTS
static float* get_function(int size,int cutoff);
EXAMPLE
The following is a brief example of the use of homomorphic
filtering:
#include "CVIPimage.h"
#include "CVIPtransform.h"
#include "CVIPxformfilter.h"
#include <limits.h>
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *inputfile, *outputfile;
float uppercut, lowercut;
int cutoff;
setDisplay_Image("picture", "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);
print_CVIP("\n\t\tEnter the upper gain (1.0-3.0): ");
uppercut = (float)getFloat_CVIP(1.0, 3.0);
print_CVIP("\n\t\tEnter the lower gain (.5 - 1.0): ");
lowercut = (float)getFloat_CVIP(0.5, 1.0);
print_CVIP("\n\t\tEnter the cutoff frequency (32-128): ");
cutoff = (int)getInt_CVIP(10, 32, 128);
cvipImage = homomorphic(cvipImage, uppercut, lowercut, cutoff);
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(inputfile);
free(outputfile);
}
BUGS
None.
SEE ALSO
AUTHOR
Copyright (C) 1995 SIUE - by Kun Luo and Scott Umbaugh.