## 4 Feature Extraction
### Granulometry-Based Descriptors (GBD)  
Mathematical Morphology (MM) is an algebraic theory that studies the decomposition of operators between complete lattices in terms of elementary operators (erosion and dilation) and operations (union, intersection and negation) [4; 12]. It is a field of non-linear digital image processing tools, and it is widely applied to process and analyze topological and geometrical structures. Two basic and important morphological operators are the _openings_ and _closings_[4; 5]. Openings are morphological filters with the following properties:  
* _increasingness_: \(f\leq g=\gamma(f)\leq\gamma(g)\). * _idempotence_: \(\gamma(\gamma(f))=\gamma(f)\). * _anti-extensivity_: \(f\geq\gamma(f)\). Closings operators are also morphological filters which are increasing, idempotent and _extensive_ (\(f\leq\varphi(f)\)). Considering images as a surface, an opening operator filters bright smaller peaks while maintaining the bigger ones. On the other hand, a closing operator sieves smaller darker valleys while preserving the bigger ones. Such removal depends on the type of the filter. For instance, structural openings remove peaks where a structuring element can not be fit [6]. More, the higher the size of the structuring element, the higher the amount of filtered structures. This paper uses three types of openings:  
**Definition 1** (Structural opening). : _Let \(f\) be an image. Let \(B\) be a structuring element [12]. The structural opening [4; 5] is given by_  
\[\gamma_{B}(f)=\delta_{B}(\epsilon_{B}(f)), \tag{7}\]  
_where \(\delta_{B}(f)\) and \(\epsilon_{B}(f)\) are, respectively, the dilation and erosion of \(f\) by a structuring element \(B\)[12]._  
**Definition 2** (Opening by reconstruction). : _Let \(f\) be an image. Let \(B\) be a structuring element. Let \(B_{c}\) be a structuring element that denotes connectivity [13]. The opening by reconstruction is given by_  
\[\gamma_{B,B_{c}}^{\mathtt{rec}}(f)=\delta_{B_{c}}^{\mathtt{rec}}(\epsilon_{B }(f),f), \tag{8}\]  
_where \(\delta_{B_{c}}^{\mathtt{rec}}(f,g)\) is the morphological reconstruction of \(g\) from \(f\)[5]._  
**Definition 3** (Area opening). : _Let \(f\) be an image. Let \(\lambda\geq 0\). The graylevel area opening [14] of parameter \(\lambda\) is given by_  
\[\gamma_{\lambda}^{\mathtt{area}}(f)=\max\{h\leq f(x):\mathtt{area}(\gamma_{ x}(T_{h}(f)))\geq\lambda\}, \tag{9}\]  
_where \(T_{h}(f)\) is the threshold of \(f\) with parameter \(h\)[14]. In this paper, for simplicity, the graylevel area opening will be called area opening._  
This paper also uses three types of closings:  
**Definition 4** (Structural closing). : _Let \(f\) be an image. Let \(B\) be a structuring element. The structural closing [4; 5; 12] is given by_  
\[\varphi_{B}(f)=\epsilon_{B}(\delta_{B}(f)). \tag{10}\]  
**Definition 5** (Closing by reconstruction). : _Let \(f\) be an image. Let \(B\) be a structuring element. Let \(B_{c}\) be a structuring element denoting connectivity. The closing by reconstruction [13] is given by_  
\[\varphi_{B,B_{c}}^{\mathtt{rec}}(f)=\varepsilon_{B_{c}}^{\mathtt{rec}}(\delta _{B}(f),f), \tag{11}\]  
_where \(\varepsilon_{B_{c}}^{\mathtt{rec}}(f,g)\) is the morphological dual reconstruction of \(g\) from \(f\)[13]._  
**Definition 6** (Area closing). : _Let \(f\) be an image. Let \(\lambda\geq 0\). The graylevel area closing [14] of parameter \(\lambda\) is given by_  
\[\varphi_{\lambda}^{\mathtt{area}}(f)=(\gamma_{\lambda}^{\mathtt{area}}(f^{c} ))^{c}, \tag{12}\]  
_where \(f^{c}\) is the negation of \(f\)[4]. Again, for simplicity, the graylevel area closing will be called area closing._Figure 3 shows a detailed view of the pixels affected by application of two morphological filters, an opening by reconstruction and a closing by reconstruction. In each case, the affected pixels are highlighted in green. **Definition 7** (Granulometry).