NAME
euler - calculates the euler number
SYNOPSIS
#include <math.h>
#include "ObjectContour.h"
int euler(Image * labeledImage, int r, int c)
<labeledImage> - pointer to a labeled image
<r> - row coordinate of a point on the labeled image
<c> - column coordinate of a point on the labeled image
PATH
$CVIPHOME/FEATURE/binary_feature.c
DESCRIPTION
This function calculates the euler number of na object of
interest on a labeled image. The Euler number is equal to
the number of upstream-facing convexities minus the number
of upstream-facing concavities.
TYPES AND CONSTANTS
None
RETURN VALUES
A value of type int: euler number
HISTORY
History information recorded: None
EXAMPLE
#include "CVIPtoolkit.h"
#include "CVIPobject.h"
#include "CVIPconvert.h"
#include <math.h>
#include "ObjectContour.h"
void main() {
Image *inputImage, *labeledImage;
IMAGE_FORMAT format;
char *inputfile, *outputfile;
int rows, cols, r, c;
setDisplay_Image("picture", "Default");
print_CVIP("\nEnter the Input File Name: ");
inputfile = (char *) getString_CVIP();
inputImage = read_Image(inputfile, format, TRUE);
view_Image(inputImage,inputfile);
labeledImage = label(inputImage);
rows = getNoOfRows_Image(labeledImage);
cols = getNoOfCols_Image(labeledImage);
print_CVIP("\nEnter the row coordinate of a point on the
labled image: ");
r = getInt_CVIP(10, 0, rows);
print_CVIP("\nEnter the col coordinate of the point on
the labled image: ");
c = getInt_CVIP(10, 0, cols);
print_CVIP("The Euler number = %d", euler(labeledImage,
r, c));
print_CVIP("\n");
free(inputfile);
}
DIAGNOSTICS
The labeled image can only of data type CVIP_INTEGER
SEE ALSO
libfeature
AUTHOR
Copyright (C) 1996 SIUE - by Scott E. Umbaugh and Wenxing
Li.