NAME
inverse_xformfilter - performs inverse filtering
SYNOPSIS
#include "CVIPimage.h"
#include "CVIPtransform.h"
#include "CVIPxformfilter.h"
#include "CVIPdef.h"
#include "CVIParithlogic.h"
Image *inverse_xformfilter(Image *numP, Image *denP, int
choice, float cutoff)
<numP> - pointer to the numerator, the degraded image
<denP> - pointer to the denominator, the inverse filter
(PSF)
<choice> - 1 to let R(u,v) = 1, or 2 to let R(u,v) = 0
(R(u,v) = restoration filter, this is used
when the denominator = 0)
<cutoff> - cutoff frequency
PATH
$CVIPHOME/XFORMFILTER/InverseFilter.c
DESCRIPTION
This function performs an inverse filter, a frequency domain
filter defined:
G(u,v)
F(u,v) = ------
H(u,v)
where F(u,v) is the Fourier transform of the restored image,
G(u,v) is the Fourier transform of the degraded image, and
H(u,v) is the Fourier transform of the degradation function.
TYPES AND CONSTANTS
None
RETURN VALUES
A filtered image
HISTORY
History information recorded:
parameter #1 = filter cutoff.
parameter #2 = method 1: F(u,v)=G(u,v) when H(u,v)=0
method 2: F(u,v)=0 when H(u,v)=0
EXAMPLE
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPdef.h>
#include <CVIPconvert.h>
#include <CVIPview.h>
#define VIEWER "picture"
#define VIDEO_APP "SunVideo &"
void main()
{
Image *cvipImage,*cvipImage1;
IMAGE_FORMAT format;
char *inputfile,*outputfile;
(void) 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 creates a gaussian mask of size
3*3 */
cvipImage1 = (Image *)h_image(3,3,3);
/* the following call performs the inverse filter on the
input image with the gaussian mask and the cutoff
frequency equal to 32 (choice=1)*/
cvipImage=(Image *)inverse_xformfilter(cvipImage,
cvipImage1,1,32.0);
cvipImage=(Image *)ifft_transform(cvipImage,256);
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
libxformfilter
AUTHOR
Copyright (C) 1996 SIUE - by Scott E. Umbaugh, Arve Kjoelen
and Greg Hance.