NAME

     Find_euler - calculates the Euler number of a binary object

SYNOPSIS

      #include <CVIPimage.h>
      #include <CVIPmatrix.h>
      #include <CVIPfeatures.h>

     int Find_euler(Image *cvipImage, int gray_level)

      <inputImage> - a pointer to an Image structure
      <gray_level> - the gray value of the labeled object

PATH

      $CVIPHOME/FEATURE/gray_euler.c

DESCRIPTION

     This function finds the Euler number for  a  labeled  binary
     image.  The  Euler number is found by subtracting the number
     of holes (distinct background regions)  from the  number  of
     objects  in  the image. For a single object, it is a measure
     of the number of closed curves the object contains.

TYPES AND CONSTANTS

     None

RETURN VALUES

     Returns an integer value.

HISTORY

     History information recorded: None

EXAMPLE

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

           #include <CVIPmatrix.h>
           #include <CVIPfeatures.h>

           void main()
           {
           Image *cvipImage;
           IMAGE_FORMAT format;
           char *inputfile;
           int euler_no;

           (void) setDisplay_Image("RamViewer", "Default");

           print_CVIP("\nThis program requires a binary image.");
           print_CVIP("0t assumes the object has value 255.\n");
           print_CVIP("\n\t\tEnter the Input File Name:  ");
           inputfile =(char *) getString_CVIP();
           format = getFormat_CVIP(inputfile);
           cvipImage = read_Image(inputfile, 1);

           euler_no = Find_euler(cvipImage,255);
           printf("\nThe  Euler  number   for   this   image   is
     %d.\n\n",euler_no);

           free(inputfile);
           }

BUGS

     None at this time

SEE ALSO

     euler

AUTHOR

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