Abstract
With huge and ever-growing products in the factory, image retrieval can help the worker retrieve the same, or similar, existing products rapidly and accurately to guide production. In this paper, an effective method based on Fourier transform and local binary pattern is proposed to improve the retrieval efficiency of wool fabric. After capturing the fabric image, histogram equalization was implemented on the value of the Hue, Saturation, Value (HSV) mode to enhance the contrast. Subsequently, Fourier transform together with local binary pattern operator were performed to obtain the frequency spectrum and the local binary pattern, respectively. Each frequency spectrum was divided into 22 rings with the same width, and the standard deviation of the frequencies in each ring was calculated as a Fourier feature. Distinct output values of each local binary pattern were counted and normalized as local binary pattern features. Finally, Euclidean distance was adopted to measure the similarity based on the Fourier feature and local binary pattern feature. Twenty thousand wool fabric images were captured to demonstrate the efficacy of the proposed method. Experimental results indicate that the framework is effective and superior for image retrieval of wool fabric, providing referential assistance for the worker in the factory and improving retrieval efficiency.
With the development of modern multimedia technologies, the number of images in databases has been increasing rapidly. Effective retrieval of the image database is the main problem, especially in wool fabric factories. Traditionally, when a factory gets samples from consumers for imitation, the first step is analyzing the samples and manually searching for the same or similar existing fabrics in the warehouse. Then, the process sheet is obtained to guide production. This method is very time consuming, laborious, and with low retrieval accuracy. At present, image retrieval of wool fabric is achieved by text-based image retrieval (TBIR) 1 in the factory. TBIR relies on textual keywords manually annotated on images, which improves the retrieval efficiency. However, the manual annotation of the images is also very time consuming, tedious, and subjective. Thus, content-based image retrieval (CBIR) 2 has been developed to overcome the disadvantages inherent in TBIR.
Recently, CBIR has been successfully implemented in different fields, such as medical diagnosis, 3 geographic information 4 and remote sensing, 5 trademark and intellectual property, 6 and so on. The methods of CBIR include texture-based,7,8 color-based, 9 shape-based, 10 multi features fusion, 11 and deep learning. 12 In the textile and garment industry, research into CBIR mainly focuses on patterned fabric, including fabric patterns,13,14 printed fabric,15,16 Jacquard fabric, 17 and lace fabric. 18 The adopted methods of texture extraction include unsupervised color image segmentation, 13 Gabor filters, 15 singular value decomposition, 17 multi-scale and rotation invariant local binary pattern (MRLBP), 18 speeded up robust features (SURF), 14 and edge histogram. 16 These frameworks all obtain satisfactory results but are only suitable for patterned fabric. For fabric image retrieval, texture extraction methods have been performed by Fourier transform (FT) 19 and Gabor filters,19,20 LBP descriptors, 21 fractal-based texture, 22 scale-invariant feature transform (SIFT), 23 and deep learning. 24
To meet the factory requirements, the image retrieval of wool fabric includes two parts: texture and color. This paper is aimed at the first part, retrieving images based on texture features. Deep learning will not be considered at first due to the large number of training samples required and long training cycle. The adopted woven wool fabrics are divided into plain color, striped, plaid, and patterned fabric in the factory. Wool fabric texture includes the fabric weave at the bottom, and strip, lattice, or pattern on the surface. The fabric weave, which reflects many parameters of the process sheet, has not been considered in previous studies. The fabric weave, strip, and lattice are commonly periodic. FT is suitable for extracting periodic features, but how to reflect the differences is the main problem. The FT feature proposed by Chen et al. 19 only have two values, making different wool fabrics difficult to distinguish. Moreover, some patterns in patterned fabrics are aperiodic and the surfaces of wool fabrics are dark and blurring. A single texture feature cannot characterize complicated wool fabrics.
In this paper, the regional difference of Fourier spectrums was proposed to characterize different periodic fabrics. Different LBP operators were optimized and combined with FT to improve the retrieval precision. This paper proceeds as follows. The second section introduces the proposed methods. The third section describes the experiment implementation. The fourth section presents the experimental results, the results analysis, and discussion of the methods. The paper concludes in the fifth section.
Methods
Image capture and pre-processing
All wool fabrics were collected from the factory. The images were captured in red, green, blue (RGB) mode using a scanner (Canon 9000F Mark II). The light source of the scanner was a white light-emitting diode (LED), which can guarantee a stable capture environment. Image resolution influences the calculation quantity and image quality. From preliminary experiments, the resolution was set to 200 dpi in this experiment. Initially, scale calibration was conducted with a ruler. As shown in Figure 1, there are 396 pixels in a range of 5 cm, i.e. the relationship is 79.2 pixels/cm. Considering the size of the real fabric, all images were captured and cropped to a size of 512 pixels × 512 pixels to remove irrelevant information; the corresponding physical size is 6.46 cm × 6.46 cm. Figure 2 gives four kinds of images after capturing.
Sketch map of scale calibration. The images after cropping.

For further analysis and processing, image enhancement
25
was employed to emphasize the edge, contour, and contrast of the wool fabric images. The image was converted to Hue, Saturation, Value (HSV) mode, where the V component describes the color's lightness. Then, histogram equalization was implemented on the V component, and the image was converted to RGB mode. As shown in Figure 3, the enhanced image is bright, and the edge becomes clear. After enhancing, the histogram of the V component becomes sharper. Lightness enhancement strengthens the contrast of the image, being propitious for the extraction of texture features. Figure 4 exhibits the enhanced images of the different wool fabrics shown in Figure 2.
The comparison of image enhancement. The enhanced images of the different wool fabrics.

Fourier transform
FT
26
converts an image between spatial and frequency domains using numerical analysis. The frequency spectrum obtained after transforming exhibits the periodic texture information of the image in the spatial domain. Discrete Fourier Transform (DFT) converts a finite sequence of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by frequencies. For an image of size M × N, the two-dimensional DFT of discrete signal f(x, y) is defined as
27
Here, x and y are spatial variables in image space, u and v are frequency variables in DFT domain. Let R(u, v) and I(u, v) be the real part and imaginary part of F(u, v), the Fourier spectrum is defined as
The power spectrum is defined by
The Fourier feature is represented using DFT in this paper. After converting the enhanced image to a grayscale image, the image was transformed to obtain the Fourier frequency spectrum using DFT. Figure 5(a1) to (a4) give the frequency spectrums of the images in Figure 4. Different textures were transformed to different frequency spectrums. To distinguish different fabrics, each spectrum was divided into several rings to reflect the regional difference. The standard deviations of frequencies in each ring were calculated as Fourier feature to reflect the regional difference, and without geometric invariance. The number of rings has a great impact on the performance of texture feature, and directly influences the retrieval results. Through experiments, the number of rings was set to 22 in the same width d, as shown in Figure 5(b1) to (b4). Figure 5(c) exhibits the features of different fabrics varied in different rings. It proves that Fourier feature can be selected as one feature for image retrieval of wool fabric.
Different wool fabric images and corresponding Fourier spectrums. (a) Fourier frequency spectrum. (b) Divided areas. (c) Texture features in different rings.
Local binary pattern
LBP
28
labels the pixels of an image by thresholding its neighbors with the center pixel and representing the result as a binary string or a decimal number. Commonly, LBP operators include grayscale invariance LBP ( Calculation of LBP operator.
Circularly symmetric neighboring sets with different P and R.
where ROR(x, i) performs a circular bit-wise right shift on the P-bit number x i times.
In this paper, with different P and R, three LBP operators were performed on the fabric image to obtain corresponding patterns. Then, occurrence frequencies of distinct output values of each pattern were counted and normalized to form the statistical histogram
30
as LBP feature. Through experiments,
Similarity measure
Commonly, similarity measure methods consist of the Minkowsky distance, Chebyshev distance, quadratic form distance, Euclidean distance and correlation coefficient, and so on.
31
In this paper, the Pearson correlation coefficient
32
and Euclidean distance,14,15,19 commonly used in image retrieval systems, were tested for similarity measure. In n-dimensional space, assuming that
where, Cov(
Euclidean distance, which performed better than Pearson correlation coefficient through experiments, was chosen for the similarity measure. As to the two distances based on the Fourier feature and LBP feature do not have the same order of magnitude, weight allocation
33
is not suitable for combination in this experiment. Let ρ1 and ρ2 represent the distances of the Fourier feature and the LBP feature, respectively; the product of ρ1 and ρ2 was used as the integrated distance, as defined in equation (12).
Experiment implementation
For image retrieval of wool fabric, there are no public datasets. Specifically, 20,000 wool fabric images were collected from the factory and captured to build the image database. Experiments are conducted in a MATLAB compiling environment on a desktop computer with Intel 3.40 GHz processor and 4 GB RAM. Figure 8 exhibits the examples in the image database.
Wool fabric samples of different categories.
The procedure of the proposed method is illustrated in Figure 9. The texture features were extracted using FT and LBP operator. The distance between the features of the query image and database image was calculated for similarity measure. The top-K images sorted by the distance from small to large were output as the retrieval results. In this experiment, considering the number of relevant images in the image database, K was set to 8.
Flow chart of the proposed method.
The retrieval interface was built using MATLAB GUI in this experiment. As shown in Figure 10, the items of the interface are retrieval options, methods of similarity measure, comparison methods, retrieval results, and elapsed time. The experiments were conducted using different options.
The retrieval interface.
Precision and recall were used to measure the performance of this retrieval system. Precision refers to the ratio of relevant retrieved images to the total retrieved images. Recall refers to the ratio of the retrieved relevant images to the total relevant images. The retrieval results were evaluated by experts to establish what images are relevant. Recall and precision
2
are represented by equations (13) and (14).
Results and discussion
This section gives the experimental details and results of parameter optimization, the proposed scheme, and methods comparison. A total of 400 query images, 100 of each category, were selected to perform each experiment. Average precision and average recall were calculated to evaluate the performance.
Experiments for parameter optimization
For the number of rings, undersize or oversize rings will cause the features to be difficult to distinguish. With different numbers of rings, the feature databases were built for experiments. The trial test indicated that the number of rings should be more than 16. Therefore, the number of rings was set to d, d = 16, 17, 18, …, n, until the optimal number of rings was found. There are four cases; namely, precision and correlation coefficient (P-C), recall and correlation coefficient (R-C), precision and Euclidean distance (P-D), and recall and Euclidean distance (R-D). Figure 11 represents the average precision and average recall with different numbers of rings. The number of rings was set to 22, and Euclidean distance was selected for similarity measure, because the precision and recall are the highest under this circumstance.
Average precision and average recall with different numbers of rings.
Average precision, recall, and time of different types of LBP operators
LBP: local binary pattern.
Experimental retrieval results
The aforementioned methods were performed for experiments. To give a qualitative analysis of our method, Figure 12 presents the top eight retrieved images of different kinds. As seen from Figure 12, the proposed method can successfully retrieve images which have the same or similar textures. Most images of the same texture rank top, and other retrieved ones also have a similar textural pattern, such as the seventh image of Figure 12(a) and the sixth image of Figure 12(d).
Retrieval results of randomly selected query images.
The average precision and recall of four kinds of wool fabrics are listed in Table 4. From Table 4, the average precision of the four categories is 85% and the average recall is 54%. This average precision means that an average 6.8 images of the eight images were relevant, and the remaining irrelevant 1.2 images were ranked in the last three positions. This system aims at providing references for the worker during fabric retrieval, and the images ranked in the higher positons will be considered first. Therefore, the results were affirmed to be acceptable by the experts in the factory. Moreover, the average retrieval time is 1.4 seconds for 20,000 images, which is faster than the TBIR currently adopted in the factory. The results indicate that the proposed method is effective for image retrieval of wool fabric, which can provide assistance for the worker in the factory and improve the efficiency of fabric retrieval.
Wool fabric classification aims at calculating the precision and recall of different kinds of fabrics, then analyzing the performances of the proposed method. From Table 4, the average precision of striped fabric is the lowest of the four categories, and the results of the other categories are higher than 85%. Through analysis, for plain color, plaid, and patterned fabric, the periodic feature are strong and the boundaries of different regions are evident. Thus, Fourier feature and LBP feature both performed well. Striped fabric indicates that there are strips in the fabric. But when the strips are indistinct, the retrieval results are easily influenced by plain color fabric with the same fabric weave. As exhibited in Figure 13, the strips of (a) and (c) are similar, but the fabric weaves are dissimilar. The fabric weave of (a) and (b) is the same, which is the main texture feature of the fabric. As listed in Table 2, the similarity of (a) and (b) is greater than (a) and (c). The reason is that the period of the fabric weave is a multiple of the period of the strip, thus the Fourier feature performed badly and the precision decreased for the striped fabric. Although the proposed method performed badly in this case, the retrieval results are also satisfactory when the fabric weave is similar.
Similar striped fabrics and plain color fabric. (a) Striped fabric. (b) Plain color fabric. (c) Similar striped fabric to (a). The distances of the images in Figure 13 LBP: local binary pattern.
The analysis was given to explain why the product of two distances was adopted in this experiment. Taking the retrieval result of Figure 12(d) as an example, Figure 14(a) and (b) exhibit the retrieval results separately using the Fourier feature and the LBP feature. In Figure 14(a), the identifiers of eight images are 3064, 3058, 3062, 3071, 3067, 2204, 3987, and 3989. In Figure 14(b), the identifiers of eight images are 3064, 3062, 3058, 3060, 3067, 3071, 3063, and 3485. As shown by the distances listed in Table 3 and the final result shown in Figure 12(d), the images were preserved only when both features performed well. The results indicate that the product of ρ1 and ρ2 combines the advantages of the Fourier feature and LBP feature, improving the precision of the retrieval results. As for weight allocation, the orders of magnitude of the two distances are different, 10−1 or 10−2 for the Fourier feature and 10−2 for the LBP feature. Moreover, the two features perform differently for different fabrics. Thus, it is difficult to set and optimize the weight of weight allocation.
Retrieval results for the two features. (a) Fourier feature. (b) Local binary pattern (LBP) feature. Distances between the query image and the retrieved images Average precision and average recall of different methods P: precision; R: recall; MRLBP: multi-scale and rotation invariant local binary pattern; SURF: speeded up robust features.
Comparison results
To prove the superiority of the proposed method, Gabor filters,15,19 MRLBP, 18 SURF, 14 and wavelet analysis34,35 were performed for comparison. As described in the literature, 15 the dimensions were 512 × 512 × 32, resulting in excessive computing. Thus, the mean value 19 of each grid was calculated as texture features, and the dimension was reduced to 512. Kang et al. (2015) 14 removed the texture information of the fabric before extracting features. But, as the texture information is important in this experiment, this pre-processing was not conducted. For MRLBP, there were three compression scales (scale 2, 3, and 4) and three sampling radiuses (R = 2, 5, and 8), and the sampling number P was 8. For wavelet analysis, each texture image was characterized using the variances of three components obtained by decomposing at I frequency layers, where I ranged from 1 to 5. Different methods were tested using the mentioned database and Euclidean distance. Table 4 lists the retrieval results for different methods. P represents precision and R represents recall. From Table 4, Gabor filters perform badly on striped fabric. The MRLBP is not suitable for patterned fabric. As the texture information cannot be removed in this experiment, SURF performs badly. Wavelet analysis does not reflect the density and the position of the fabric texture, so the results are not satisfactory. The comparison results indicate that the proposed method is superior for image retrieval of wool fabric.
Conclusion
Image retrieval based on FT and LBP is proposed in this paper to improve retrieval efficiency and accuracy for wool fabric. The advantages of the Fourier feature and LBP feature are combined by using the product of two distances. Experimental results show that the average precision is up to 85%, and the average retrieval time is 1.4 seconds. Based on the performance analysis, it is concluded that the proposed scheme is precise and efficient, which performs better than other texture extraction methods. This image retrieval system can help the worker in the factory retrieve the same or similar products precisely and fast, saving lots of labor and material resources.
In future work, improvements will be made to improve the precision for striped fabric. Moreover, color features will be adopted to meet the demands of the factory, retrieving images which have the same or similar color. Meanwhile, color features will be combined with the texture features to develop a more robust and higher precision image retrieval system for wool fabric.
Footnotes
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: Postgraduate Research & Practice Innovation Program of Jiangsu Province (No. KYCX18_1819);the Fundamental Research Funds for the Central Universities (No. JUSRP51631A); the National Natural Science Foundation of China (No. 61802152), the Natural Science Foundation of Jiangsu Province (No. BK20180602), the China Postdoctoral Science Foundation Funded Project (No. 2018M640453), the Jiangsu Province Postdoctoral Science Foundation (No. 2018K037B).
