NAME
simple_wiener - performs a practical wiener filter
SYNOPSIS
#include "CVIPimage.h"
#include "CVIPtransform.h"
#include "CVIPxformfilter.h"
#include "CVIPdef.h"
#include "CVIParithlogic.h"
Image *simple_wiener(Image *degr, Image *degr_fn, float k)
<degr> - pointer to the degraded image
<degr_fn> - pointer to the degradation function
<k> - a constant
PATH
$CVIPHOME/XFORMFILTER/InverseFilter.c
DESCRIPTION
Performs the operations needed to perform a simple
Wiener Filter.
Denoting the degraded image by G(u,v), and using
H(u,v) for the degradation function Image, this func-
tion calculates
2
|H(u,v)|
F(u,v) = G(u,v) * --------------
2
|H(u,v)| + k
Variables Passed:
Image *degr - Contains the degraded image.
Image *degr - Contains the degradation function.
float k - constant.
This function performs a wiener filter, (a frequency domain
filter). See any image processing textbook for info on
Wiener Filters. The function does its own memory manage-
ment, freeing everything passed to it, so if you need your
images intact, make a copy of them before calling this func-
tion.
TYPES AND CONSTANTS
None
RETURN VALUES
A pointer to the restored Image
HISTORY
History information recorded:
- function name (SIMPLE_WIENER)
- parameter #1 = the value of k (float).
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 practical wiener filter
on the input image with the gaussian mask and the
constant k equal to 1 */
cvipImage=(Image *)simple_wiener(cvipImage,cvipImage1,1.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 and Arve
Kjoelen.