title: Granulometry (morphology)
text: # Granulometry (morphology)
  
  In mathematical morphology, granulometry is an approach to compute a size distribution of grains in binary images, using a series of morphological opening operations. It was introduced by Georges Matheron in the 1960s, and is the basis for the characterization of the concept of size in mathematical morphology.
  
  ## Granulometry generated by a structuring element
  
  Let B be a structuring element in a Euclidean space or grid E, and consider the family $\{B_{k}\}$, $k=0,1,\ldots$, given by:
  
      $B_{k}=\underbrace {B\oplus \ldots \oplus B} _{k{\mbox{ times}}}$,
  
  where $\oplus$ denotes morphological dilation. By convention, $B_{0}$ is the set containing only the origin of E, and $B_{1}=B$.
  
  Let X be a set (i.e., a binary image in mathematical morphology), and consider the series of sets $\{\gamma _{k}(X)\}$, $k=0,1,\ldots$, given by:
  
      $\gamma _{k}(X)=X\circ B_{k}$,
  
  where $\circ$ denotes the morphological opening.
  
  The granulometry function $G_{k}(X)$ is the cardinality (i.e., area or volume, in continuous Euclidean space, or number of elements, in grids) of the image $\gamma _{k}(X)$:
  
      $G_{k}(X)=|\gamma _{k}(X)|$.
  
  The pattern spectrum or size distribution of X is the collection of sets $\{PS_{k}(X)\}$, $k=0,1,\ldots$, given by:
  
      $PS_{k}(X)=G_{k}(X)-G_{k+1}(X)$.
  
  The parameter k is referred to as size, and the component k of the pattern spectrum $PS_{k}(X)$ provides a rough estimate for the amount of grains of size k in the image X. Peaks of $PS_{k}(X)$ indicate relatively large quantities of grains of the corresponding sizes.
  
  ## Sieving axioms
  
  The above common method is a particular case of the more general approach derived by Georges Matheron. The French mathematician was inspired by sieving as a means of characterizing size. In sieving, a granular sample is worked through a series of sieves with decreasing hole sizes. As a consequence, the different grains in the sample are separated according to their sizes.
  
  The operation of passing a sample through a sieve of certain hole size "k" can be mathematically described as an operator $\Psi _{k}(X)$ that returns the subset of elements in X with sizes that are smaller or equal to k. This family of operators satisfies the following properties:
  
  * Anti-extensivity: Each sieve reduces the amount of grains, i.e., $\Psi _{k}(X)\subseteq X$,
  * Increasingness: The result of sieving a subset of a sample is a subset of the sieving of that sample, i.e., $X\subseteq Y\Rightarrow \Psi _{k}(X)\subseteq \Psi _{k}(Y)$,
  * "Stability": The result of passing through two sieves is determined by the sieve with the smallest hole size. I.e., $\Psi _{k}\Psi _{m}(X)=\Psi _{m}\Psi _{k}(X)=\Psi _{\min(k,m)}(X)$.
  
  A granulometry-generating family of operators should satisfy the above three axioms.
  
  In the above case (granulometry generated by a structuring element), $\Psi _{k}(X)=\gamma _{k}(X)=X\circ B_{k}$.
  
  Another example of granulometry-generating family is when $\Psi _{k}(X)=\bigcup _{i=1}^{N}X\circ (B^{(i)})_{k}$, where $\{B^{(i)}\}$ is a set of linear structuring elements with different directions.
  
  