# 3D Texture Feature Extraction and Classification Using GLCM and LBP-Based Descriptors
## 2 Background
### 2D Gray-Level Co-Occurrence Matrix (2D GLCM)  
The Gray-Level Co-Occurrence Matrix (GLCM) is a classical texture feature extraction technique proposed in 1973 by [PERSON] [27]. To make the article self-contained and for a better understanding, we briefly review below how the 2D GLCM is built.  
GLCM is a statistical method that takes into account the spatial relationship between pixels. This matrix is not the feature vector itself, is rather a tool for obtaining second-order statistics.  
The GLCM expresses the frequency of appearance of pairs of pixels which are situated at a certain distance and orientation to each other and which have certain grey-level intensities. The two elements that characterize the spatial relationship between pixels define the displacement vector:  
\[d\ =\ (d_{x},d_{y}) \tag{7}\]  
Generally, the orientation for 2D GLCM is considered for four independent directions which are given in Figure 2. Table 1 shows the corresponding displacement vectors.  
The GLCM is a square matrix, having \(\rm N_{q}\) rows and \(\rm N_{q}\) columns (\(\rm N_{q}\) is the number of different pixel values in the input image). The input image can be scaled in order to reduce the number of grey-levels. Generally, the GLCM is built on images that have 8, 16, 32 or 64 quantization levels. This is done for providing statistical confidence: the matrix must contain a reasonably non-sparse representation. Additionally, a smaller number of quantization levels implies reducing the computation time.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Direction** & **Displacement Vector** \\ \hline \(0^{\circ}\) & (distance 1, 0) \\ \(45^{\circ}\) & (distance, distance) \\ \(90^{\circ}\) & (0, distance) \\ \(135^{\circ}\) & (\(-\)distance, distance) \\ \hline \hline \end{tabular} \({}^{\dagger}\) the distance between pixels in a pair = number of pixels moved in a certain direction.  
\end{table}
Table 1: Displacement vectors for 2D GLCM.  
Figure 1: The functional block scheme of the BM3 DELBP operator.  
Figure 2: The four independent directions used to compute the 2D GLCM.  
The coefficients of the GLCM are expressed in terms of probabilities rather than in number of appearances by performing normalization: the terms are divided by the total number of possible combinations (the sum of the matrix values). The normalized GLCM is given in (8):  
\[\text{GLCM\_2D}_{\text{n}}(\text{i},\text{j})=\frac{\text{GLCM\_2D}(\text{i}, \text{j})}{\sum_{\text{i}=1}^{\text{Nq}}\sum_{\text{j}=1}^{\text{Nq}}\text{GLCM\_2D}( \text{i},\text{j})} \tag{8}\]  
where GLCM_2D\({}_{\text{n}}\) is the normalized version of GLCM_2D which is given in (9):  
\[\text{GLCM\_2D}_{\text{d}_{\text{x}},\text{d}_{\text{y}}}(\text{i},\text{j})= \sum_{\text{x}=1}^{\text{m}}\sum_{\text{y}=1}^{\text{n}}\left\{\begin{array}{ ll}1,&\text{if }\text{I}(\text{x},\text{y})=\text{ i and }\text{I}\Big{(}\text{x}+\text{d}_{\text{x}} \text{y}+\text{d}_{\text{y}}\Big{)}=\text{ j}\\ &\\ &0,\text{ otherwise}\end{array}\right. \tag{9}\]  
where I is the input image of size m \(\times\) n.  
The feature vector is obtained by computing the Haralick indicators [27] from the obtained normalized GLCM. We refer to [27] for a complete description of these statistical indicators.