EULER_CVIP
euler_cvip() - finds the Euler number of a binary object.
Contents
SYNTAX
e = euler_cvip(labeledImage,[r,c])
Input Parameters include :
- labeledImage - Label image of MxN size with single object or multiple objects. Each object has unique gray value.
- r - The row number of a pixel on the object. positive integer.
- c - The column number of a pixel on the object. positive integer.
Output Parameter Include :
- e - The Euler number of the object.
DESCRIPTION
Euler Number of a binary Image can be defined as the number of objects minus the number of holes in the image. The functions take the advantage of the connectivity of the image and calculates the Euler number as the difference between the number of convexities in the image and the number of concavities in the binary object specified by the user.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read image input_img = imread('Shapes.bmp'); % Label image lab_image = label_cvip(input_img); % Calling function e = euler_cvip(lab_image, [115,359]); e1 = euler_cvip(lab_image, [422,418]); % Display input image figure;imshow(input_img,[]); fprintf('Euler Number: %d', e); fprintf ('\nEuler Number: %d', e1);
Euler Number: 0 Euler Number: 1
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website