1 Introduction

Texture is an important feature of the image, and texture classification is one of the important research topics of computer vision. Texture classification plays an important role in target recognition, medical image analysis and understanding, biometrics, content-based image retrieval, remote sensing and industrial detection. Early texture feature extraction algorithms were numerous, but most of them were based on a common assumption that texture images were acquired under ideal conditions. In the mid-1990s, Zhang et al. began to advocate the study of invariant texture classification methods [39]. Texture classification presents a new situation, texton theory [14] was proposed by Julesz et al., Bag of Textons (BoT) texture classification pattern had been onto stage, which is an important word package pattern in the field of computer vision. In 2004, Csurka introduced the concept of the word package into the field of computer vision [3], and began a large amount of research work focused on the word package pattern. Leung et al. studied the identification of texture images acquired under different imaging angles and illumination conditions, and they proposed the LM filter algorithm [16]. Varma et al. improved the LM filter algorithm and proposed a local texture feature extraction algorithm MR8 with rotation invariance [37]. In addition, Varma et al. proposed a simple patch feature to represent texture features in order to prove that the filtering algorithm dominates texture analysis [38].

Ojala et al. proposed a method for classifying texture images with rotation invariance using a local binary pattern (LBP) histogram [28]. On account of the LBP algorithm is simple, easy to implement, certain brightness invariance, it is favored by a wide range of researchers. As one of the most successful feature description operators, LBP algorithm has successfully demonstrated its efficiency in face recognition [1], dynamic texture recognition [40] and shape recognition [12].

The LBP algorithm is simple and effective, but it has its limitations, researchers have done a lot of research on the LBP algorithm, and various LBP variant algorithms have been presented. In order to improve the accuracy of LBP algorithm for texture recognition, many extended and improved algorithms have been proposed, such as Complete Local Binary Pattern (CLBP) proposed by Guo et al. [5], Extended Local Binary Pattern (ELBP) proposed by Liu et al. [24], Dominant Local Binary Pattern (DLBP) proposed by Liao et al. [19], Discriminative Complete Local Binary Pattern (disCLBP) proposed by Y. et al. [7], Pairwise Rotation Invariant Cooccurrence Local Binary Pattern (PRICoLBP) proposed by Qi et al. [31]. And These algorithms increase the dimension of LBP algorithm to improve the texture classification accuracy, but all of them are sensitive to the noise. At the same time, due to the increase in feature dimensions, the computational complexity is increased. In order to improve the robustness of the LBP algorithm to noise, some improved algorithms have been proposed, such as Local Ternary Pattern (LTP) proposed by Tan et al. [34], Median Binary Pattern (MBP) [8] proposed by Hafiane et al., Local Phase Quantization (LPQ) proposed by Ojansivu etc. [29], Robust Local Binary Pattern (RLBP) proposed by Chen et al. [2], Noise Resistant Local Binary Pattern (NRLBP) proposed by Ren et al. [32], Noise Tolerant Local Binary Pattern (NTLBP) proposed by Fathi et al. [4], Fuzzy Local Binary Pattern (FLBP) proposed by Iakovidis et al. [13], Median Robust Extended Local Binary Pattern (MRELBP) proposed by Liu et al. [18].Q Kou propose a new local texture descriptor, the principal curvatures based LBP (PCLBP) [15], Z Pan proposed a new method named scale-adaptive local binary pattern (SALBP) [30], and R Tekin proposed four novel, simple and robust approaches, which are left to right local binary patterns ( LBPL L2R), top to down local binary patterns ( LBP T2D), cube surface local binary pattern ( LBP Surfaces), and cube diagonal local binary pattern ( LBP Diagonal), in order to exact texture features in color images [35]. MH Shakoor fused the LDT features to the features of rotation invariant LBP and local variance (VAR) to provide a rich set of robust-to-noise features [33]. M Hazgui proposed a genetic programming (GP)-based method that combines of the two well-known features: histograms of oriented gradients and local binary patterns [10]. A new local structure descriptor based on just noticeable difference (JND) for texture classification is proposed by exploring the spatial and relative intensity correlations among local neighborhood pixels [25]. Compared with the LBP algorithm, these algorithms are more robust to image noise, but their anti-noise ability is still not satisfactory. In addition, many scholars analyze and improve the LBP algorithm. Guo et al. believe that the LBP algorithm has the disadvantage of losing global spatial information, so they improved the LBP algorithm and put forward the LBPV algorithm, which improved the accuracy of texture classification by 10 percentage points [6]. Hegenbart et al. analyzed the sensitivity of LBP algorithm to affine transformation and proposed a local binary mode based on scale and rotation invariance [11]. Zhou et al. used the principle of LBP algorithm to introduce Huffman coding rules and proposed a Haffman LBP algorithm for face recognition [41]. Moscoso et al. proposed an edgeLBP algorithm to capture geometric patterns on the surface grid [26]. Further, Xin Liao et al. introduced a deep learning framework for image detection in literature [20], which not only obtains significant detection performance but also can distinguish the order in some cases that previous works were unable to identify. Xin Liao et al. also introduced the features of texture image and color image respectively in literature [21] and [22].

In this paper, we improved the CLBP algorithm and proposed an Extended Complete Local Binary Pattern (ECLBP). The proposed ECLBP algorithm further improves and extends on the basis of the CLBP algorithm, inheriting the advantages of CLBP and making texture classification more accurate. In literature [5], Guo et al. found that the texture information contained in the sign component is much larger than the magnitude component and the introduction of the magnitude component allows the feature detection operator to distinguish the change of the brightness level. The proposed algorithm improves and extends CLBP and has all the advantages of the CLBP. Furthermore, ECLBP algorithm adds a filter and replace the single pixel with the filtered grayscale result of the window region, which improves the robustness of the proposed algorithm to image noise. Like CLBP, the local feature vector in the ECLBP algorithm is composed of the ratio of the center pixel and its neighboring pixels to a specific threshold. The ratio of the center pixel to the global threshold represents the gray level of the image, denote as ECLBP_C. In this proposed algorithm, the uniform rotation invariant LBP is adopted as the binary encoding method in the 3 neighboring pixels of the central pixel, and the binary encoding can be divided into sign binary encoding and magnitude binary encoding, denote as ECLBP_S and ECLBP_M respectively. In addition, with reference to the extended characteristics of the Freak [36] feature describe operator, the proposed algorithm adds Extended Sign binary encoding and Extended Magnitude binary encoding. The Extended binary takes the center pixel as the center, r as the radius and ɑ as the filter radius respectively, to generate specified extended sign binary codes and extended magnitude binary codes, denote as ECLBP_ES_r,α and ECLBP_EM_r,α respectively. Finally, combining all ECLBP_C, ECLB_S, ECLBP_M, ECLBP_ES, ECLBP_EM gray-level histograms to generate the final ECLBP feature vector for texture feature analysis or texture classification.

In this paper, we propose a robust, extensible, flexible and effective texture feature extraction algorithm. Experiments demonstrate that the performance of this algorithm is better than the previous variant LBP algorithm, and the accuracy of texture classification reaches more than 99%. Below is a summary of our main contributions.

  • The proposed algorithm improves and extends CLBP and it has expansibility, flexibility, brightness invariance and robustness.

  • Furthermore, the proposed algorithm adds a filter and replace the single pixel with the filtered grayscale result of the window region, which improves the robustness of the proposed algorithm to image noise.

  • In the experiment, the proposed algorithm is analyzed in detail and is compared with LBP and its representative variants: LTP [34], CLBP [5] and MRELBP [18]. On some integrated texture dataset, the experimental results show that the classification accuracy of the proposed algorithm is up to 99%.

  • Different from MRELBP [18] algorithm, the proposed algorithm takes time performance consumption into account in the design, the proposed algorithm is more concise in the feature coding, and greatly reduces the calculation time consumption while ensuring high precision.

This paper is organized as follows. The following section briefly explains the principle of LBP [28] and MRELBP [18], and Section 3 discusses in detail the implementation principle of the proposed algorithm. In Section 4, the results and analysis of experiments are presented. Finally, our conclusions are given in Section 5.

2 Related work

The LBP algorithm can mainly measure and extract texture information of local neighborhoods in grayscale images. In the original LBP operator, a 3 * 3 fixed rectangular region, a total of 9 pixels, are selected and the gray value of the 8 pixels in the edge of the rectangular region are compared with the intermediate pixel, which is greater than or equal to the central pixel, the value is represented by 1, otherwise it is represented by 0. Finally, according to the clockwise serial encoding, an encoding value of the LBP operator can be obtained. In order to make the LBP can encode any size region, Ojala etc. improved the original LBP and proposed the circular LBP(P,R) [28]:

$$\begin{array}{l}{LBP}_{P,R}=\sum\limits_{p=0}^{p-1}s\left({g}_{p}-{g}_{c}\right){2}^{p}\\ \mathrm{s}\left(\mathrm{x}\right)=\left\{\begin{array}{c}1,x\ge 0\\ 0,x<0\end{array}\right.\end{array}$$
(1)

where \({g}_{p}\) represents the gray value of the neighborhood pixel, \({g}_{c}\) represents the gray value of the center pixel, P represents the count of the encoding, R represents the neighborhood radius. At the same time, pixels that are not in the image grid can be obtained using interpolation. Suppose that the coordinates of \({g}_{c}\) is (0,0), the coordinates of \({g}_{p}\) is \((\mathrm{Rcos}\left(2\pi p/P\right),\mathrm{Rsin}\left(2\pi p/P\right))\).

In order to increase the robustness of rotation invariant, Ojala etc. proposed rotation invariant LBP:

$${LBP}_{P,R}^{riu}=\mathrm{min}\left\{ROR\left({LBP}_{P,R},i\right)|i=\mathrm{0,1},\dots ,P-1\right\}$$
(2)

where ROR(x, i) indicates that x is sequentially shifted to right by i bits, and then the minimum value is taken as the unique feature encoding [28].

For LBP(P,R), there are a total of \({2}^{p}\) sequence of 0 and 1 with a high dimension. In order to reduce the dimension, Ojala proposed uniform local binary pattern and pointed out that under natural visible light, 90% of the image texture pattern belong to the uniform pattern [28]. In the actual image, most LBP patterns only contain no more than two transitions from 1 to 0 or from 0 to 1. Therefore, Ojala defines the uniform pattern as follows: when the cyclic binary number corresponding to the LBP only contain no more than two transitions from 0 to 1 or from 1 to 0, the binary encoding corresponding to the LBP is called an equivalent mode.

$$\begin{array}{l}\mathrm{U}\left({LBP}_{P,R}\right)=|\mathrm{s}\left({g}_{p-1}-{g}_{c}\right)-\mathrm{s}({g}_{0}-{g}_{c})|+{\sum }_{p=0}^{P-1}s\left({g}_{p}-{g}_{c}\right)-s\left({g}_{p-1}-{g}_{c}\right)\\ {LBP}_{P,R}^{riu2}=\left\{\begin{array}{c}{\sum }_{p=0}^{P-1}s\left({g}_{p}-{g}_{c}\right) \mathrm{U}\left({LBP}_{P,R}\right)\le 2\\ P+1 else\end{array}\right.\end{array}$$
(3)

where U represents the number of encoding transitions from 0 to 1 or from 1 to 0. For example, 00000000 (0 of the transitions), 00000111 (1 from 0 to 1 of the transitions), 10001111 (from 1 to 0, and then from 0 to 1, there are 2 of the transitions) are uniform pattern. Except uniform pattern, the other patterns are called the mixed pattern. For example, 10010111 (4 of the transitions). The riu2 represents rotation invariant uniform pattern adopted by LBP and there are P + 1 modes. The 9 encoding modes are combined with rotation-invariant LBP and uniform mode LBP are shown in Fig. 1.

Fig. 1
figure 1

\({LBP}_{8,r}^{riu2}\): the hollow circle represents 0, and the solid circle represents 1

For LBP algorithm is simple, easy to implement and has certain brightness invariance, it has been widely favored by researchers. MRELBP designs a new feature classification descriptor for the traditional LBP algorithm, which is sensitive to noise and unable to obtain macroscopic information. Different from other LBP variant algorithms, MRELBP algorithm improves ELBP [23] algorithm and proposes to use the median of regional image instead of single pixel intensity of the original image, which makes the algorithm has stronger anti-noise ability, and has good brightness invariance, rotation invariance and robustness. MRELBP algorithm represents: Images are normalized to zero mean and unit variance; the standard (riu2) encoding scheme can be used; and the joint histogramming of RELBP_CI, \({\mathrm{RELBP}\_\mathrm{NI}}_{r,p}^{riu2}\) and \({\mathrm{RELBP}\_\mathrm{NI}}_{r,p}^{riu2}\) is used to represent a texture image. This new descriptor is referred to as \({\mathrm{RELBP}}_{r,p}^{riu2}\) [18].

In the formula, each component of MRELBP is expressed as RELBP_CI RELBP_NI RELBP_RD:

  1. 1)

    Center pixel representation:

    $${\mathrm{RELBP}}_{\mathrm{CI}\left({\mathrm{x}}_{c}\right)}=\mathrm{s}(\upphi \left({X}_{c,w}\right)-{\mu }_{w})$$
    (4)

    where \({\mathrm{x}}_{c}\) represents the center pixel, the filter \(\upphi ()\) to \({X}_{c,w}\) is applied to the calculation results, w means the size of \(\mathrm{w}\times \mathrm{w}\) sliding window, and \({\mu }_{w}\) represents the mean of \(\upphi \left({X}_{c,w}\right)\) over the whole image.

  2. 2)

    Neighbor representation:

    $$\begin{array}{c}{{\mathrm{RELBP}}_{\mathrm{NI}}}_{r,p}\left({x}_{c}\right)=\frac{1}{p}\sum\limits_{n=0}^{p-1}\mathrm{s}\left(\upphi \left({X}_{r,p,{w}_{r},n}\right)-{\mu }_{r,p,,{w}_{r}}\right){2}^{n}\\ {\mu }_{r,p,,{w}_{r}}=\frac{1}{p}\sum\limits_{n=0}^{p-1}\upphi \left({X}_{r,p,{w}_{r},n}\right)\end{array}$$
    (5)

    where \({X}_{r,p,{w}_{r},n}\) denotes a patch of size \({w}_{r}\times {w}_{r}\) centered on \({x}_{r,p,n}\).

  3. 3)

    Radial difference representation:

    $${{\mathrm{RELBP}}_{RD}}_{r,r-1,p,{w}_{r},{w}_{r-1}}\left({x}_{c}\right)=\frac{1}{p}\sum\nolimits_{n=0}^{p-1}\mathrm{s}\left(\upphi \left({X}_{r,p,{w}_{r},n}\right)-\upphi \left({X}_{r-1,p,{w}_{r-1},n}\right)\right){2}^{n}$$
    (6)

    where \({X}_{r,p,{w}_{r},n}\) and \({X}_{r-1,p,{w}_{r-1},n}\) denote the patches centered the neighboring pixel \({x}_{r,p,n}\) and \({x}_{r-1,p,n}\) respectively.

MRELBP algorithm uses the response value calculated by the filter window to replace the single pixel, which has stronger anti-noise ability. Meanwhile, the introduction of RELBP_NI and RELBP_RD enhances the feature extraction performance of the algorithm, making MRELBP algorithm achieve great success in the application of texture classification. However, MRELBP also has its own defects, mainly as follows.

  1. 1.

    MRELBP calculates RELBP_CI, RELBP_NI and RELBP_RD components for each extension point. The algorithm is acceptable when the number of extension layers is not high, but when the number of extension layers exceeds a certain number, the time consumption of the algorithm increases geometratically.

  2. 2.

    MRELBP calculates the final feature vector for each component according to the same weight. When the number of extended layers is large, more noise will be introduced, which is not conducive to the final classification.

  3. 3.

    As the design of MRELBP algorithm is more complex, it is not flexible enough for simple texture image classification.

In order to overcome these shortcomings, in this paper we refer to CLBP algorithm and design the center gray level, sign component and magnitude component to generate the final texture feature vector. In the proposed algorithm, it is different from MRELBP, in each layer extension the proposed algorithm only need to compute the expansion of the specific component coding, which makes the algorithm have bigger promotion in the expansion flexibility. At the same time, more macro information can be introduced into feature vectors to extract complex texture features on the basis of performance overhead. Since the extended component of the proposed algorithm is generated only for its own features, the introduction of noise is avoided, and the final classification accuracy will not be affected even if the extended component of higher level numbers is introduced. Secondly, the time complexity of the proposed algorithm is O(n), and the algorithm speed is higher than that of MRLBP algorithm. In the third part of this paper, we give a detailed derivation of the proposed algorithm.

3 ECLBP algorithm

The features in ECLBP are divided into three categories: ECLBP_C representing the gray level of the image; ECLBP_S-M representing the sign component and the magnitude component; ECLBP_ES-M representing the extended sign component and the extended magnitude component.

The LBP algorithm and many variant LBP algorithms are sensitive to image noise since all of them use only a single pixel as the sample point for encoding. Referring to the Freak feature description operator [36] and the BRISK feature description operator [17], they all use a Gaussian filter response value of a specific window for feature description, which is much better than using only a single pixel as a sampling point.

The proposed ECLBP algorithm improves the CLBP algorithm and refers to the pattern of the Freak algorithm [36]. ECLPB algorithm inherits the brightness invariance and rotation invariance of CLBP algorithm, and has strong anti-noise ability due to the introduction of filtering window. Secondly, because the design of each component of ECLPB algorithm is simpler than that of MRELBP, it has a great breakthrough in time performance, and the extended component of ECLBP algorithm is generated based on the characteristics of the extension point itself, avoiding the introduction of noise, and the improved pattern is shown in Fig. 2. In Fig. 2, the extended regions of the ECLBP overlap each other, which makes the correlation of the grayscale response values of the neighborhood edges more closely [36]. Filters for overlapping regions can choose Gaussian filter or Median filter. Gaussian filter is one of most common linear smoothing filter, and it is widely applied to eliminate noise in image processing. The median filter is a non-linear digital filter. Because it is non-linear, the median filter is especially useful for anti-noise effects of speckle noise, salt and pepper noise. In Section 4, the experiments of texture classification using Gaussian filtering and median filtering are compared, and the final results are analyzed in detail.

Fig. 2
figure 2

The pattern of the ECLBP algorithm: where \({x}_{c}\) represents the center pixel gray value response, \({x}_{p}\) represents the 3-neighbor pixels gray value response, r represents the distance of the extended feature and the center pixel, ɑ represents the window size of filter in the extended region; it is able to change the value of r and ɑ according to the actual demand for a further expansion

Figure 3 shows the generation process of the sign component (ECLBP_S) and the magnitude component (ECLBP_M) in the ECLBP algorithm. Each edge pixel in the 3-neighbor is respectively performed a difference operation with the central pixel, and the obtained result is combined clockwise to obtain the sequence A[6,15,-18,-21,19,37,48,-7]. Split the sign of the sequence with the value to obtain the sequence B[1,1,-1-,1,1,1,-1] and the sequence C[6,15,18,21,19,37,48,7]. The sequence B and the sequence C are processed again to obtain the binary encoding of the sign component and the magnitude component in the ECLBP. The sign component replaces 1 in sequence C with 0. By processing sequence B, the magnitude component compares the average value of sequence B with each value and codes the one greater than the average value as 1, otherwise it codes as 0.

Fig. 3
figure 3

The generate process of the sign component and magnitude component: (a) represents 3-neighbor pixels gray value; (b) represents the difference between the neighborhood pixels and the center pixel; (b) can be represents as (c) × (d); (c) represents the sign component, Change the value encoded as -1 to 0; (d) represents the magnitude component

Given the central pixel \({x}_{c}\), \(\phi\) represents the filter window response, the extended radius is r, and the extended region filter size is \(\mathrm{\alpha }\), the calculation process for ECLBP_C, ECLBP_S, ECLBP_M, ECLBP_ES_r, and ECLBP_EM_r in ECLBP is as follows.

  1. A.

    Gray level of the center pixel:

    $$\begin{array}{c}{ECLBP\_C}_{P,R}=s({x}_{c}-\mu )\\ \mathrm{s}\left(\mathrm{x}\right)=\left\{\begin{array}{c}1,x\ge 0\\ 0,x<0\end{array}\right.\end{array}$$
    (7)

    where P represents the count of encoding, R is the distance of the 3-neighborhood pixel from the center pixel, \(\upmu\) represents the grayscale average of the image, and s denotes the encoding rules. In this paper, P = 8, R = 1 in the experiment.

  2. B.

    Sign component

    $${ECLBP\_S}_{P,R}=\sum\nolimits_{p=0}^{p-1}s\left({x}_{p}-{x}_{c}\right){2}^{p}$$
    (8)

    where \({x}_{p}\) represents the edge sample pixel of the 3-neighborhood pixel around the center pixel. The ECLBP_S is essentially the original LBP binary code.

  3. C.

    Magnitude component

    $$\begin{array}{l}{ECLB{P}_{M}}_{P,R}={\sum\nolimits }_{p=0}^{P-1}s\left({m}_{p}-\lambda \right){2}^{p}\\ {m}_{p}=|{x}_{p}-{x}_{c}|\\ \lambda =\frac{{\sum }_{p}^{P-1}|{x}_{p}-{x}_{c}|}{P}\end{array}$$
    (9)

    where \({m}_{p}\) represents the absolute difference between the neighborhood pixel and the center pixel, \(\uplambda\) is the average value of the grayscale response magnitude of the neighborhood pixel around the center pixel.

  4. D.

    Extended sign component:

    $$\begin{array}{l}\mathrm{ECLBP}\_\mathrm{ES}\_\mathrm{r},\mathrm{\alpha }={\sum }_{p=0}^{P-1}s\left(\phi \left({x}_{r,p},\alpha \right)-\delta \right){2}^{p}\\\updelta =\frac{{\sum }_{p=0}^{P-1}\phi \left({x}_{r,p},\alpha \right)}{P}\end{array}$$
    (10)

    where \(\left({x}_{r,p},\alpha \right)\) represents the gray response value of \({x}_{r,p}\) with the filter \(\mathrm{\alpha }\times \mathrm{\alpha }\), \({x}_{r,p}\) represents the sample pixel of in extended area, \(\updelta\) represents the average value of the filtering window response at the sampling point.

  5. E.

    Extended magnitude component:

    $$\begin{array}{l}\mathrm{ECLBP}\_\mathrm{EM}\_\mathrm{r},\mathrm{\alpha }={\sum }_{p=0}^{P-1}s\left({em}_{p}-\delta \right){2}^{p}\\ {em}_{p}=|\phi \left({x}_{r,p},\alpha \right)-\delta |\end{array}$$
    (11)

    where \({em}_{p}\) represents the absolute difference between the extended pixel of the filter response and the gray mean value of the extended pixel of the filter response.

After obtaining ECLBP_C, ECLBP_S, ECLBP_M, ECLBP_ES, and ECLBP_EM respectively, and then all components are serially connected to generate a gray histogram for classification. In addition, the number of ECLBP_ES and ECLBP_EM can be expanded according to actual needs. In the experiments in this paper, the classification accuracy can be more than 99% after 4 times of expansion. The flow chart of the proposed algorithm is shown in Fig. 4.

Fig4
figure 4

The flow chart of ECLBP algorithm

4 Experiment

To verify the effectiveness of the algorithm, two integrated texture datasets, Outex [27] and KTHTIPS [9], were used for experiments. The Outex dataset contains 24 types of texture images, each contains 3 different lighting conditions, 9 rotation angles, and no effects of viewpoint changes and scale changes. The KTHTIPS dataset contains 10 types of material texture images, each contains 3 different lighting conditions, 3 different poses and 9 different scales. The detail of the experimental dataset is shown in Table 1. Figure 5 shows some texture images in the KTHTIPS database and Fig. 6 shows some texture images in the Outex_TC12 database. The source code of the proposed algorithm can be downloaded from https://github.com/zenqiang/ECLBP.git.

Table 1 Summary Texture Dataset Used In Our Experiments. θ1(00,05,10,15,30,45,60,75,90)
Fig. 5
figure 5

Texture images in KTHTIPS dataset

Fig. 6
figure 6

Texture images in Outex_TC12 dataset

The ECLBP algorithm is an improvement and extension of the CLBP algorithm and belongs to a variant LBP algorithm. Therefore, we use Outex_TC10 and Outex_TC12 in the Outex dataset to experiment. We compared the LBP algorithm [28], LTP algorithm [34], CLBP algorithm [5], MRELBP algorithm [18] by using Outex_TC10 and Outex_TC12 data set under the same experimental conditions. In this paper, the classification accuracy is calculated by the following formula.

$$\mathrm{accuracy}=\frac{correct\_classification}{number of all images}$$
(12)

The LBP algorithm [28] is the most primitive local binary mode and is the theoretical basis of all variant LBP algorithms. In the LBP algorithm, a neighborhood sample pixel of a specific radius is compared with a central pixel to obtain a binary code, and the final binary code is calculated according to the rotation invariant and equalization mode.

The LTP algorithm [34] divides the local difference into a ternary pattern using a threshold to improve the LBP algorithm, and divides the ternary mode into two LBPs: positive LBP and negative LBP.

The CLBP algorithm [5] is a complete local binary mode. On the basis of the original LBP algorithm, the gray level of the central pixel and the neighborhood pixel magnitude component are added, which makes the CLBP algorithm have better performance in texture classification.

MRELBP algorithm [18] is a novel algorithm for texture image classification. The MRELBP algorithm extends MRELBP_CI, MRELBP_NI, and MRELBP_RD referring to the Freak algorithm, and the MRELBP algorithm uses median filter to improve the robustness to image noise.

In order to verify the scalability of the ECLBP algorithm, in the same experimental environment, we designed the experiment to use ECLBP_C | ECLBP_S-M | ECLBP_ES-M_4,3, ECLBP_C | ECLBP_S-M | ECLBP_ES-M_6,5, ECLBP_C | ECLBP_S-M | ECLBP_ES-M_8,7 ECLBP_S | ECLBP_S-M | ECLBP_ES-M_10,9, ECLBP_C | ECLBP_S-M | ECLBP_ES-M_12,11 separately classify the texture image, and then classify the texture image again by concatenating the various extension components.

Figure 7 shows the ECLBP feature gray-level histogram, in which the gray histogram extracted from the image using the extended ECLBP algorithm. When extracting features using the ECLBP algorithm, each sub-area of size 16 × 16 is encoded once for each image, and finally these encodings are combined in series to form a final ECLBP feature histogram.

Fig. 7
figure 7

ECLBP gray histogram of 5 extension: (a) represents the original texture image; (b) represents the histogram of (a), where the gray-level histogram of different color represents the different component; the black represents ECLBP_C, only 2 positions in the gray-level histogram; the blue represents ECLBP_S-M component, 18 positions in the gray-level histogram; the green represents ECLBP_ES-EM_4,3 component, what represents the first extension, 18 positions in the gray-level histogram; the red represents ECLBP_ES-EM_6,5 component, what represents the second extension,18 positions in the gray-level histogram; the sapphire represents ECLBP_ES-EM_8,7 component, what represents the third extension, 18 positions in the gray-level histogram; the yellow represents ECLBP_ES-EM_10,9 component, what represents the fourth extension, 18 positions in the gray-level histogram; the purple represents ECLBP_ES-EM_12,11 component, what represents the fifth extension, 18 positions in the gray-level histogram

Table 2 shows the classification result of the current main LBP-based texture classification algorithms and the proposed algorithm in Outex_TC10 and Outex_TC12 dataset. From Table 2, it can be found that after three extensions, the classification accuracy of the proposed algorithm has reached more than 99% for the Outex_TC10 data set, and after five extensions, the classification accuracy reaches the highest 99.67%. For the Outex_TC12 data set, tl84 and horizontal represent texture images acquired under different light sources. In the Outex_TC12 dataset under the tl84 light source, the proposed algorithm is accurate to 99.20% after 5 extensions, and the Outex_TC12 dataset under the horizontal source the proposes algorithm achieves the highest classification accuracy 99.56% after 4 expansions. However after the fifth expansion, the classification accuracy decreased by 0.11%.

Table 2 Classification rate (%) on Outex_TC10 and Outext_TC12 using different extended S-M

In Section 3, we introduced that the ECLBP algorithm add a filter and replace the single pixel with the filtered grayscale result of the window region. There are two alternative filters: Gaussian filter and Median filter. Gaussian filter can be used as a representative of linear filter, and median filter can be used as a representative of nonlinear filter. For the Outex_TC11 data set, we designed an experiment to verify the extended components in the ECLBP algorithm using Gaussian filter and Median filter, respectively.

Table 3 shows the experimental results of the proposed algorithm for verifying the extended components using Gaussian filter and Median filter, respectively. From Table 3, it can be found that for the ECLBP algorithm, after each extension the classification result of the median filter is several percentage points higher than the classification result of the Gaussian filter. For the proposed algorithm, after using the Gaussian filter and the Median filter and completing 2 extensions, the classification accuracy both are over 97%. After 3 extensions, the ECLBP algorithm using the median filter achieves the highest classification accuracy of 98.65%, while the classification accuracy of the ECLBP algorithm using Gaussian filter is 97.40%. When the ECLBP algorithm performing 4 extensions, the classification accuracy of the ECLBP algorithm using the Median filter is reduced by 0.11 percentage points, but still higher than the 98.13% of the ECLBP algorithm using Gaussian filter. After 5 expansions, the classification accuracy of the ECLBP algorithm using the median filter again reached 98.65%.

Table 3 Classification rate (%) on Outex_TC11 using different filter. Gaussian noise, σ = 5, none blur

We also designed an experiment to verify the classification effect of the proposed algorithm with different numbers of training samples in the KTHTIPS data set. With the KTHTIPS dataset, we separately verified the classification results when the number of training samples for each texture image type was 10, 20, 30 and 40, and the experimental results are shown in Table 4. As seen from Table 4, when the number of training samples for each texture image type is 10, the highest accuracy of classification is only 76.36%. When the training sample is increased to 20, it can be found that after the proposed algorithm is only extended once, the highest classification accuracy has reached 82.22%. Once again, the training sample is increased to 30, and after 1 extension the highest classification accuracy of the proposed algorithm is up to 88.89%, which is 5.47 percentage points higher than the highest classification accuracy of the training sample at 20. When the training sample was increased to 40, the highest classification accuracy of the proposed algorithm was up to 95.06% and the lowest was 91.36%. When the extension was performed 5 times, the highest classification accuracy reached 99.10%.

Table 4 Classification rate (%) on KTHTIPS using different number of train image

Figure 7 shows part of the case images of wrong classification. The texture correlation of these misclassified images is not strong, while the ECLBP algorithm has strong robustness to the macro information of the image and has high classification accuracy for the complex texture images with strong texture correlation. Since the feature vector of the proposed algorithm can contain a large amount of macro information, the algorithm has a good effect on the image classification with strong texture correlation, and the texture classification accuracy of such images can reach more than 99% (Table 2). However, for images with weak texture correlation, the proposed algorithm in this paper is not able to accurately classify them. For the extended component of the ECLBP algorithm, the extended radius f and filter window size α can be obtained through optimization or grid search. In this paper, parameter 4,3|6,5|8,7|10,9 is recommended to be used for extension, which can achieve classification accuracy of more than 99% and the calculation speed of 0.1 s per image. In the experimental results of ECLBP_12,11, the texture classification was carried out by feature coding with an extended radius of 12 and a filtering window of 11*11. Due to the large extended radius, the information of neighboring center pixels was not included, resulting in the decrease of classification accuracy. The purpose of this experiment is to verify the distance relationship between the center pixel and the extension point, and the experimental results show that when the extension radius is too large, the feature coding will be instability.

5 Conclusion

In this paper, we draw on the theoretical basis of the symbol component and magnitude component of CLBP algorithm, and proposed an extended complete local binary pattern (ECLBP). In the ECLBP algorithm, we also refer to the idea of the Freak algorithm, using region overlap to enhance the correlation between adjacent regions. In order to improve the robustness of the algorithm to image noise, the window grayscale response value of the Gaussian filter and the median filter is used to process individual components instead of a single pixel in the ECLBP algorithm. In the process of classification, the feature information of each “extension circle” of ECLBP algorithm is linked together to form the final feature information. The proposed algorithm ECLBP improved and extended CLBP algorithm, and a completely new concept is introduced. It ensures that the ECLBP algorithm inherits the advantages of the CLBP algorithm and gets further improvement. Because of the introduction of the Freak algorithm model and the concept of median filtering, the ECLBP algorithm can extract more complete feature information than other LBP variant algorithms and has stronger robustness on the impact of noise. Furthermore, the ECLBP algorithm is different from MRELBP, in each layer extension the ECLBP algorithm only need to compute the expansion of the specific component coding, which makes the algorithm have bigger promotion in the expansion flexibility. At the same time, more macro information can be introduced into feature vectors to extract complex texture features on the basis of performance overhead. Since the extended component of the ECLBP algorithm is generated only for its own features, the introduction of noise is avoided, and the final classification accuracy will not be affected even if the extended component of higher level numbers is introduced. Secondly, the time complexity of the ECLBP algorithm is O(n), and the algorithm speed is higher than that of MRLBP algorithm. Finally we designed an experiment to compare the proposed algorithm with LBP, LTP, CLBP and MRELBP in the same experimental condition, and the experimental results show that the proposed algorithm in this paper achieves the best classification effect, and the classification accuracy in the Outex_TC10 and OutexTC_12 data sets has reached more than 99%. In addition, the influence of different filter types and different training sample numbers on the proposed algorithm is also analyzed through experiments. The experimental results show that the median filter is more suitable for the proposed algorithm, but it is not much different from the Gaussian filter. As the training samples increase, the classification accuracy of the proposed algorithm is also greatly improved. ECLBP algorithm also has some shortcomings. ECLBP algorithm expands the traditional model and improves the accuracy of the algorithm, but at the same time, due to the introduction of the expansion model, the dimension of feature coding also increases, which limits the high-speed and real-time performance of LBP algorithm. The next step of this paper will focus on the speed improvement of ECLBP algorithm. PCA and other algorithms can be introduced to reduce the dimension of ECLBP coding, so that ECLBP algorithm can play a role in more scenarios.