NAME

     MorphErode_Image - performs morphological erosion

SYNOPSIS

      #include "CVIPimage.h"
      #include "CVIPtoolkit.h"
      #include "CVIPmatrix.h"
      #include "CVIPmorph.h"

     Image *MorphErode_Image(Image *inputImage, Matrix  *kernelP,
     CVIP_BOOLEAN user_org, int row, int col)
      <inputImage> - a pointer to an Image structure
      <kernelP> - a pointer to a Matrix structure
      <user_org> - define center of kernel
      <row> - user-defined row of kernel center
      <col> - user-defined column of kernel center

     Image *MorphErode(Image *inputImage, int k_type, int  ksize,
     int height, int width)

      <inputImage> - pointer to an Input
      <k_type>  -  kernel  type  (1=disk   2=square   3=rectangle
     4=cross)
      <ksize> - size of kernal (height and width of mask)
      <height> - height for square and  rectangle,  thickness  of
     lines of cross
      <width> - width for rectangle, size of cross

PATH

      $CVIPHOME/MORPHOLOGICAL/morphCODE.c

DESCRIPTION

     Morphologic erosion is a process in which an image is shrunk
     by  etching  away its borders. The degree of image reduction
     is controlled through the use of a structuring element  that
     is  convolved  with  the  original  image to yield a desired
     image.

     Erosion is used disconnect loosely-attached objects.

TYPES AND CONSTANTS

     None

RETURN VALUES

     Returns a modified image.

HISTORY

     History information recorded: None

EXAMPLE

           #include <CVIPtoolkit.h>
           #include <CVIPdef.h>
           #include <CVIPimage.h>
           #include <CVIPconvert.h>
           #include <CVIPimage.h>

           #include <CVIPmatrix.h>
           #include <CVIPmorph.h>

           void main()
           {
           Image *cvipImage;
           IMAGE_FORMAT format;
           char *inputfile, *outputfile;
           (void) setDisplay_Image("RamViewer", "Default");

           print_CVIP("\n\t\tEnter the Input File Name:  ");
           inputfile =(char *) getString_CVIP();
           format = getFormat_CVIP(inputfile);
           cvipImage = read_Image(inputfile, 1);

           print_CVIP("\n");
           cvipImage = (Image *)MorphErode(cvipImage,2,5,3,3);
           fflush(stdin);

           print_CVIP("\n\t\tEnter the Output File Name:  ");
           outputfile = getString_CVIP();
           write_Image(cvipImage,
     outputfile,CVIP_NO,CVIP_NO,format, 1);
           display_Image(outputfile,format);
           free(inputfile);
           free(outputfile);
           }

BUGS

     None at this time

SEE ALSO

     MorphClose_Image, MorphDilate_Image, MorphOpen_Image

AUTHOR

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