## NAME

         single_filter - performs single filter

## SYNOPSIS

          #include "CVIPimage.h"
          #include "CVIPspfltr.h"

         Image *single_filter (Image *orig_image,  float  s_c,  float
         s_r,  int  r_cen,      int c_cen, float rot, float beta, int
         N, float *h, int choice)

          <orig_image> - pointer to an Image
          <s_c> - horizontal sizing factor, 1 for no change
          <s_r> - vertical sizing factor, 1 for no change
          <r_cen> - row coordinate for new center, 0 for no change
          <c_cen> - column coordinate for new center, 0 for no change
          <rot> - angle of rotation, 0 for no change
          <beta> - value for beta, typically 0.3 - 0.8
          <N> - kernel size (3,5,7,...)
          <h> - kernel array (of size N*N)
          <choice> - operation of filter (see DESCRIPTION, below):
                         1 = -,-
                         2 = +,+
                         3 = +,-
                         4 = -,+

## PATH

         $CVIPHOME/SPATIALFILTER/single_filter.c

## DESCRIPTION

         Performs manipulation and enhancement of an image in a  sin-
         gle  filter, after C.B. Chittineni. This implementation of a
         single filter is based on the following equation:

             f(x,y)=[(1+/-alpha)g(x,y)]-/+[(alpha)g(x,y)*h(x,y)]

         The parameter '<choice> - operation of filter' refers to the
         selection  of  arithmetic  signs  for the +/- and -/+ in the
         equation above.

## 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;
          float  h[9]={1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0};
          float *a=h;

          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 a single filter operation.
          The original size  of the image,the center of the image
          is not changed.beta is chosen as 0.5 and the kernel
          size is chosen as 3 */
          cvipImage = single_filter(cvipImage,1,1,0,0,0,0.5,3,a,3);
          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, Joseph  Tsai,
         and Kun Luo.