NAME
Butterworth_Low - performs Butterworth lowpass filtering
SYNOPSIS
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "CVIPdef.h"
#include "CVIPimage.h"
Image *Butterworth_Low(Image *in_Image, int block_size, int
dc, int cutoff, int order)
<in_Image> - pointer to an Image structure
<block_size> - desired block size
<dc> - drop(0) or retain(1) dc component
<cutoff> - cutoff frequency
<order> - filter order
PATH
$CVIPHOME/XFORMFILTER/filter.c
DESCRIPTION
Butterworth_Low() performs two-dimensional butterworth
lowpass filtering in transform domain on input image. The
parameter cutoff defines the cut-off frequency locus at
points for which the filter transfer function H(u,v) is at
0.7071 of its maximum value. All components inside the the
circle (or 1/4 circle if dc component is on the upper-left-
hand corner of its transform plane) of radius "cutoff" are
passed with no attenuation, while all frequencies outside
the circle (or 1/4 circle) are attenuated by the transition
from passband to stopband which depend on the degree of
filter order f_order. If dc equals 1, the dc component will
be retained, if dc = 0, dc componenet will be dropped.
TYPES AND CONSTANTS
None
RETURN VALUES
A filtered image
HISTORY
History information recorded: None
DIAGNOSTICS
Butterworth_Low() performs two-dimensional butterworth
lowpass filtering in transform domain on input image. The
parameter cutoff defines the cut-off frequency locus at
points for which the filter transfer function H(u,v) is at
0.7071 of its maximum value. All components inside the the
circle (or 1/4 circle if dc component is on the upper-left-
hand corner of its transform plane) of radius "cutoff" are
passed with no attenuation, while all frequencies outside
the circle (or 1/4 circle) are attenuated by the transition
from passband to stopband which depend on the degree of
filter order f_order. If dc equals 1, the dc component will
be retained, if dc = 0, dc componenet will be dropped.
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;
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 performs the fft_transform on the
input image with the block size equal to 256 */
cvipImage=(Image *)fft_transform(cvipImage,256);
/* the following call performs the butterworth low pass
filtering of order 2 on the transformed image with
the cut off frequency equal to 64 */
cvipImage = (Image *)Butterworth_Low(cvipImage,256,1,64,2);
/* the following call performs the inverse fft_transform
in the filtered image with the block size equal to 256 */
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 Simon Low.