Mathematica > Data Manipulation > Image Processing & Analysis > Mathematical Morphology >

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:
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]=
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team