You are here : matlabImage Processingbweuler

bweuler() - Image Processing

eul = bweuler(BW,n) returns
the Euler number for the binary image BW. The Euler
number is the total number of objects in the image minus the total
number of holes in those objects. n specifies
the connectivity. Objects are connected sets of on pixels,
that is, pixels having a value of 1.Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

eul = bweuler(BW,n) example


Example

Calculate Euler Number for Binary ImageOpen This Example
Read binary image into workspace, and display it.BW = imread('circles.png');
imshow(BW)

Calculate the Euler number. In this example, all the circles touch so they create one object. The object contains four "holes", which are the black areas created by the touching circles. Thus the Euler number is 1 minus 4, or -3.bweuler(BW)

ans =

    -3


Output / Return Value


Limitations


Alternatives / See Also


Reference