NAME
unsharp_filter - performs unsharp masking
SYNOPSIS
#include <CVIPtoolkit.h>
#include <CVIPtools.h>
Image* unsharp_filter(Image *inputImage, int lower, int
upper, float low_clip, float high_clip)
<inputImage> - pointer to an Image structure
<lower> - lower limit for histogram shrink (0-254)
<upper> - upper limit for histogram shrink (1-255)
<low_clip> - percentage of low values to clip
during hist_stretch
<high_clip> - percentage of high values to clip
during hist_stretch
PATH
$CVIPHOME/SPATIALFILTER/unsharp.c
DESCRIPTION
Unsharp masking is a technique that combines filtering and
histogram modification. The input image is lowpass filtered;
a histogram shrink is then performed on the filtered image.
The resultant image is subtracted from the original, and a
histogram stretch completes the process.
TYPES AND CONSTANTS
None
RETURN VALUES
A filtered image
HISTORY
History information recorded: None
EXAMPLE
#include <CVIPtoolkit.h>
#include <CVIPimage.h>
#include <CVIPdef.h>
#include <CVIPspfltr.h>
#include <CVIPconvert.h>
#include <CVIPview.h>
#define VIEWER "picture"
#define VIDEO_APP "SunVideo &"
void main()
{
Image *cvipImage;
IMAGE_FORMAT format;
char *inputfile,*outputfile;
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 unsharp masking with
the shrinking range between 0 and 200 and the lower
and higher clipping values equal to .01 for
histogram stretching */
cvipImage = unsharp_filter(cvipImage,0,200,.01,.01);
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
libspatialfilter
AUTHOR
Copyright (C) 1996 SIUE - by Scott E. Umbaugh and Kun Luo.