Algorithms for Extracting various Local Texture Features

In the machine learning and computer vision domain, images are represented using their features. Color, shape, and texture are some of the prominent types of features. Over time, the local features of an image have gained importance over the global features due to their high discerning ability in localized regions. The texture features are widely used in image indexing and content-based image retrieval. In the last two decades, various local texture features have been formulated. For a complete description of images, effective and efficient features are necessary. In this paper, we provide algorithms for 10 local texture feature extraction. These texture descriptors have been formulated since the year 2015. We have designed algorithms so that they are time efficient and memory space-efficient. We have implemented these algorithms and verified their output correctness.


Introduction
Image indexing and Content-based Image retrieval are solutions to efficient searching of images from large image databases. For efficient indexing and retrieval of images first, the images are described by using their features. Local Binary Pattern introduced by Ojala et al. [1] is one of the earliest and efficient texture feature descriptors. Since then, various types of local texture features have been introduced by various researchers. In this article, we provide 10 algorithms for various recent texture feature descriptors.
This work is part of a research project on content-based medical image retrieval. We plan to use these algorithms in the task of extracting features from medical images. Algorithms will provide detailed steps for tasks. In this paper, the task is extracting various textural features from images. As of date, more than about 20 texture feature descriptors being formulated by various researchers. Out of these, we have chosen recent 10 texture descriptors. We have provided efficient and easy-to-read algorithms.
The outline of this paper is as follows. In Section 2, we cover the literature review. In Section 3, we cover algorithms for various local texture feature extraction. In Section 4, we provide the future scope and conclude.
2 Literature Review One of the earliest local texture descriptors is Local Binary Pattern(LBP) [1]. In this feature computation for each non-border pixel, the neighbors at a radius are compared with the center pixel. Based on the sign of the difference formed from comparison, the pattern is generated. The LBP is simple and has been the basis for devising various other local texture descriptors. Co-occurrence of pixel pairs is a statistical approach towards describing images. In the Center Symmetric Local Binary Co-occurrence pattern(CSLBCoP) [2], first, the center symmetric pattern is computed and then the obtained feature map's co-occurrence pattern is computed in different directions.
A texture feature descriptor that gives importance to diagonal extremas is proposed and is named Local Diagonal Extrema Pattern(LDEP) [3]. In this feature computation, the firstorder local diagonal derivates are computed and then these are compared with the center pixel to form the feature vector. In Local Wavelet Pattern(LWP) [4], the relationship among the neighboring pixels is first wavelet decomposed. Next, the center pixel is transformed to match the range of decomposed neighbors. By establishing the relation between the two, the LWP is derived. The researchers propose this method for CT images retrieval based on their content. Local Tri-directional Pattern(LTriDP) [5] uses the relationship between adjacent neighbors with neighboring pixels and the relationship of the neighboring pixel with the center pixel. A threedirectional relationship is encoded in this pattern.
Local Bit-plane Decoded Pattern(LBDP) [6] is similar to LBP. But instead of comparing pixel intensities of neighbors with center pixel, a transformed neighbors with center pixel is used. The vector formed out of each bit from among neighbors is used instead of the direct neighbor intensity. Local Neighborhood Difference Pattern(LNDP) [7], is a texture feature descriptor that considers the relation between neighbors with its adjacent pixels. The sign of difference of neighbor with its adjacent pixel is used in computing the pattern. A novel texture feature descriptor called Local Neighborhood Intensity difference Pattern(LNIP) is proposed [8]. This descriptor encodes the difference of neighboring pixels with its adjacent neighbors. Along with the difference(sign) pattern, the magnitude pattern is also encoded in this pattern. Two new feature descriptors named Threshold Local Binary AND Pattern(TLBAP) and Local Adjacent Neighborhood Average Difference Pattern(LANADP) are proposed [9]. TLBAP uses a threshold calculated from among neighbors and performs bit-wise AND with LBP feature to compute the feature at a center pixel. This is repeated for all non-border pixels to compute the TLBAP feature for the entire image. The LANADP feature [9] is computed based on the difference of neighboring pixels with its neighbors in vertical, horizontal, and diagonal directions.
3 Algorithms for various Local Texture Features Extraction 3.1 Local Binary Pattern Algorithm 1 shows detailed steps for Local Binary Pattern feature extraction from an image. The image intensity matrix is arr, which is input to the findLBP function as an argument. The arrays dx and dy contain the relative offset in the X and the Y direction required for determining the immediate 8 neighbors around a center pixel. The array multiple2 contains powers of two ranging from 2 0 to 2 7 . If the sign of differences of the neighbor pixel with the center pixel is positive or zero, the corresponding powers of two are added. The for loop in line 12 in the algorithm is used to traverse across the 8 neighbors of a center pixel.

Center Symmetric Local Binary Co-occurrence Pattern
Algorithm 2 shows steps for computation of Center Symmetric Local Binary Co-occurrence Pattern. In line 10 in the algorithm, the center symmetric pattern is computed. The difference of a neighbor with its symmetric neighbor is used in the center symmetric pattern. Then in line 12, using the GRAY COM AT RIX function, the co-occurrence feature of the center symmetric pattern is generated by taking offset in 4 angles(0°,45°,90°, and 135°).
return lnips, lnipm 3.9 Threshold Local Binary AND Pattern Algorithm 9 shows steps for determining Threshold Local Binary AND Pattern(TLBAP). This descriptor uses both Threshold Local Pattern and Local Binary Pattern. An input threshold(a value between 0 and 1) is used in this descriptor. First, the maximum among neighbors is determined and then the maximum is multiplied by the threshold. Based on the sign of difference of this with the neighbors, Threshold Local Binary Pattern is generated. Then, the Local Binary Pattern is computed for the center pixel. These two patterns are ANDed to produce TLBAP.

Results
We have implemented each of the algorithms using MATLAB R2020b. We have tested the output from each of the algorithms for correctness. The obtained output and expected output are shown in the following Table1. The input image matrix of size 5 × 5 is given as