# MorphologicalEulerNumber

MorphologicalEulerNumber[image]

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

MorphologicalEulerNumber[image,t]

treats values above t as foreground.

# Details and Options

• MorphologicalEulerNumber[image] by default gives the total number of connected white regions in image, minus the number of black holes that occur inside those regions.
• MorphologicalEulerNumber[image] is equivalent to MorphologicalEulerNumber[image,0].
• MorphologicalEulerNumber works with 3D as well as 2D binary, grayscale, and other images.
• The following options can be specified:
•  CornerNeighbors True whether to include corner neighbors Padding 0 padding method to use

# Examples

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:

By default, zero padding is assumed:

## 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:

Wolfram Research (2008), MorphologicalEulerNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/MorphologicalEulerNumber.html (updated 2014).

#### Text

Wolfram Research (2008), MorphologicalEulerNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/MorphologicalEulerNumber.html (updated 2014).

#### CMS

Wolfram Language. 2008. "MorphologicalEulerNumber." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/MorphologicalEulerNumber.html.

#### APA

Wolfram Language. (2008). MorphologicalEulerNumber. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MorphologicalEulerNumber.html

#### BibTeX

@misc{reference.wolfram_2024_morphologicaleulernumber, author="Wolfram Research", title="{MorphologicalEulerNumber}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MorphologicalEulerNumber.html}", note=[Accessed: 15-July-2024 ]}

#### BibLaTeX

@online{reference.wolfram_2024_morphologicaleulernumber, organization={Wolfram Research}, title={MorphologicalEulerNumber}, year={2014}, url={https://reference.wolfram.com/language/ref/MorphologicalEulerNumber.html}, note=[Accessed: 15-July-2024 ]}