## NAME

         get_default_filter - provides filter kernel

## SYNOPSIS

          #include "CVIPtools.h"
          #include "CVIPimage.h"
          #include "CVIPdef.h"
          #include "CVIPfs.h"
          #include "CVIPmatrix.h"

         Matrix * get_default_filter(PROGRAMS type, int dimension,int
         direction)

          <type> - type of filter needed
          <dimension> - size of blur filter needed
          <direction> - direction for difference filter

## PATH

         $CVIPHOME/SPATIALFILTER/spatial_tools.c

## DESCRIPTION

         Provides a matrix containing the desired  kernel  values  to
         calling    functions.<type>   is   one   of:   BLUR_SPATIAL,
         DIFFERENCE_SPATIAL,   LOWPASS_SPATIAL,    LAPLACIAN_SPATIAL,
         HIGHPASS_SPATIAL.  <dimension>  applies only to BLUR_SPATIAL
         filters, and is 3,5,  or  7.  <direction>  applies  only  to
         DIFFERENCE_SPATIAL, with 0 = horizontal and 1 = vertical.

## TYPES AND CONSTANTS

         None

## RETURN VALUES

         Pointer to the appropriate matrix

## HISTORY

         History information recorded: None

## EXAMPLE

          #include <CVIPtoolkit.h>
          #include <CVIPimage.h>
          #include <CVIPdef.h>
          #include <CVIPspfltr.h>
          #include <CVIPmatrix.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;
          Matrix *mat;
          int i,j;
          unsigned int row=3;
          unsigned int col=3;

          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);
          mat=new_Matrix(row,col,CVIP_FLOAT,REAL);
          if(mat==NULL)
                 printf("NULL");
          /*Provides the filter kernel for lowpass spatial
          filter in the horizontal direction */
          mat=(Matrix *)get_default_filter(LOWPASS_SPATIAL,3,0);
          /*The following call convolves the image with
          the lowpass filter kernel got by the
          get_default_filter */
          cvipImage1 = (Image *)convolve_filter(cvipImage,mat);
          print_CVIP("\n\t\tEnter the Output File Name:  ");
          outputfile = getString_CVIP();
          view_Image(cvipImage1,outputfile);
          write_Image(cvipImage1,outputfile,CVIP_NO,CVIP_NO,format,1);
         free(outputfile);
          }

## SEE ALSO

         libspatialfilter, convolve_Image

## AUTHOR

         Copyright (C) 1996 SIUE - by Scott Umbaugh and Kun Luo.