## NAME

         MorphOpen_Image - performs morphological opening

## SYNOPSIS

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

         Image  *MorphOpen_Image(Image  *imageP,   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 *MorphOpen(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> - kernel size (height and width of mask)
          <height> height for  square  and  rectangle,  thickness  of
         lines for cross
          <width> - width for rectangle, size of cross

## PATH

          $CVIPHOME/MORPHOLOGICAL/morphCODE.c

## DESCRIPTION

         Morphologic opening consists of morphological  erosion  fol-
         lowed  by  morphological  dilation  of an image. It is often
         used to eliminate small objects from an image.

## 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 *)MorphOpen(cvipImage, 1,3,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

         MorphDilate_Image, MorphErode_Image, MorphClose_Image

## AUTHOR

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