computes the morphological Euler number of regions in a binary image.


treats values above t as foreground.

Details and Options


open allclose all

Basic Examples  (1)

Count the number of white objects minus the number of holes:

Scope  (5)

2D Images  (1)

Euler number of a single object with no holes:

Single object with one hole:

Single object with two holes:

Two objects with no holes:

3D Images  (4)

Euler number of a single 3D solid:

Euler number of a single 3D solid with one hole:

Euler number of a tunnel:

Morphological Euler number of a torus:

Options  (4)

CornerNeighbors  (2)

By default, all eight neighbors around a given pixel are treated as being neighbors:

Treat only the four non-corner pixels as neighbors:

Padding  (2)

By default, zero padding is assumed:

Specify the padding value:

Properties & Relations  (1)

Euler number is computed as the number of connected components minus the number of holes:

The number of connected components:

The number of holes:

Introduced in 2008
Updated in 2010