Image Processing Toolbox
  Go to function:
    Search    Help Desk 
bweuler    Examples   See Also

Compute the Euler number of a binary image

Syntax

Description

eul = bweuler(BW,n) returns the Euler number for the binary image BW. eul is a scalar whose value is the total number of objects in the image minus the total number of holes in those objects. n can have a value of either 4 or 8, where 4 specifies 4-connected objects and 8 specifies 8-connected objects; if the argument is omitted, it defaults to 8.

Class Support

BW can be of class uint8 or double. eul is of class double.

Example

Algorithm

bweuler computes the Euler number by considering patterns of convexity and concavity in local 2-by-2 neighborhoods. See Pratt, p. 633, for a discussion of the algorithm used.

See Also

bwmorph, bwperim

References

Pratt, William K. Digital Image Processing. New York: John Wiley & Sons, Inc., 1991. p. 633.

Horn, Berthold P. K., Robot Vision. New York: McGraw-Hill, 1986. pp. 73-77.



[ Previous | Help Desk | Next ]