This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

MorphologicalEulerNumber

MorphologicalEulerNumber[image]
computes the morphological Euler number of regions in a binary image.
MorphologicalEulerNumber[image, t]
treats values above t as foreground.
  • 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.
  • The option setting CornerNeighbors->False treats only the four pixels in the coordinate directions as adjacent.
Count the number of white objects minus the number of holes:
Count the number of bright spots, specifying an explicit thresholding value:
Count the number of white objects minus the number of holes:
In[1]:=
Click for copyable input
Out[1]=
 
Count the number of bright spots, specifying an explicit thresholding value:
In[1]:=
Click for copyable input
Out[1]=
By default, all eight neighbors around a given pixel are treated as being neighbors:
Treat only the four non-corner pixels as neighbors:
New in 7