| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Image Processing Toolbox |
| Contents | Index |
| Learn more about Image Processing Toolbox |
eul = bweuler(BW,n)
eul = bweuler(BW,n) returns the Euler number for the binary image BW. The return value eul is a scalar whose value is the total number of objects in the image minus the total number of holes in those objects. The argument 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.
BW can be numeric or logical and it must be real, nonsparse, and two-dimensional. The return value eul is of class double.
BW = imread('circles.png');
imshow(BW);

bweuler(BW)
ans =
-3bweuler computes the Euler number by considering patterns of convexity and concavity in local 2-by-2 neighborhoods. See [2] for a discussion of the algorithm used.
[1] Horn, Berthold P. K., Robot Vision, New York, McGraw-Hill, 1986, pp. 73-77.
[2] Pratt, William K., Digital Image Processing, New York, John Wiley & Sons, Inc., 1991, p. 633.
![]() | bwdist | bwhitmiss | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |