Automatic Recognition of Woven Fabric Pattern Based on TILT

In this paper, an effective method based on Transform Invariant Low-rank Textures (TILT) andHOG is proposed to identify woven fabric pattern. Firstly, the method based on TILT is used to solve the deflection phenomenon in the process of woven fabric image acquisition. Secondly, the yarn floats in the fabric image is localized by the yarns segmentation method based on the 2D spatialdomain gray projection, which is used to segment the weft and warp yarns. Thirdly, HOG is applied to extract distinctive invariant features in the process of feature extraction. According to the HOG feature, the texture features of the woven fabric are acquired. Finally, the yarn floats are classified by Fuzzy C-Means (FCM) clustering to recognize the weft and warp cross. Experimental results demonstrate that the proposed method can achieve the recognition of the three woven fabrics, plain, twill, and satin, and obtain accurate classification results.


Introduction
In the traditional textile industry, the recognition of the woven fabric is mostly done manually, which is very tedious and time-consuming.With the rapid development of technology, the application of image processing and machine vision technology is becoming more dominant.Recently, image processing and machine vision technology have been introduced into the area of woven fabric [1].
The analysis of fabric texture [2][3][4][5][6][7] has been studied since the mid-1980s, these methods are mainly based on the properties of the Fourier spectrum.But there are limits to its adaptability for solid fabrics, since these methods recognize patterns by light reflection from the warp and weft, there are limits to their adaptability for solid fabrics.Recently, some relevant researches have been developed for automatic analysis of fabric weave structures.Haralicck et al. [8] proposed a method of gray-level cooccurrence matrix, which is used to calculate the texture characteristics.R.Pan [9] analyzed weft and warp floats to determine the fabric weave patterns.Y. Ben Salem [10] developed a supervised recognition method using support vector machine to classify fabric weave patterns and used the SVM to classify woven fabric structure.Hu [11] used Bayesian statistics to classify fabric weave patterns, a Bayesian model was established for the classification of fabric images, and the morphological parameters of fabric images were extracted as the eigenvector.Other methods [12,13] determine the fabric weave patterns by analyzing warp and weft floats.These methods can successfully classify several woven fabrics.However, the skew correction of fabric images in current woven fabric classification methods is ignored; real-time and integrity of these methods are low.
Hence, this paper introduces an approach for recognition and classification of woven fabrics with real-time and integrity.Firstly, TILT is used to correct the deviation of the fabric images.Histogram equalization is employed to minimize the uneven distribution of gray levels of pixels caused by local illumination.Then 2D spatial-domain gray projection is used to segment the weft and warp yarns.Secondly, we get the texture features of the woven fabric and HOG features are extracted.Finally, the yarn floats are classified by FCM clustering to recognize the weft and warp cross.The preliminary recognition results are obtained and the correct results are obtained through periodic correction.
The rest of this paper is organized as follows: the entire recognition process is described and analyzed in Section 2.Then, the recognition results of our method and comparison with other methods are obtained in Section 3. The conclusions are given in Section 4. The overall framework of the method is shown in Figure 1.

Transform Invariant Low-Rank Textures.
It is inevitable that the fabric images are skewed due to the placement of samples when using scanner or other image devices for image acquisition.The skewness of the image usually causes a large error in the recognition result, so it is necessary to rectify the woven fabric in the process of the recognition and classification of the woven fabric.To solve the deflection phenomenon in the process of fabric image acquisition, we adopt TILT [14] to process woven fabric images.
Generally speaking, the grayscale image on a planar can be described by mathematical expression as a twodimensional function (, ), which is viewed as a matrix.In matrix theory, a 2D texture is considered as a function  0 (, ), defined on  2 .We say that  0 is a low-rank texture if one-dimensional functions { 0 (,  0 ) |  0 ∈ } span a finite low-dimensional linear subspace, i.e., for some small positive integer .If  is finite, then  0 is referred to as a rank- texture.In practice, we typically never see a perfect low-rank texture in a real image, mainly due to two factors.
(1) Camera angle and lens perspective induce a transformation on the domain of the texture function.The image(, ) that we observe from a certain viewpoint is transformed version of the low-rank texture function  0 (, ): where  :  2 →  2 belongs to a certain Lie group . ( The sampled values of the texture function are subject to many types of corruption such as quantization, occlusions, and noise.For some error matrix , such deviations are modeled as follows: For the deflection of woven fabric image, we can view it as the first case and the second case.According to the principle of invariance and solving algorithm of low-rank texture transformation, the correction procedure of fabric image can be summarized as follows. (1) Woven fabric images are represented in matrix form.Firstly, the slant woven fabric image is grayscale.The pixel (, ) coordinates are the data values and a gray woven fabric image can be represented as a matrix  × .
(2) According to TILT, the corresponding model is established and solved.The model is as follows: where ‖‖ 0 denotes the number of nonzero entries in . > 0 is a weighting parameter that trades off the rank of the texture versus the sparsity of the error.Then the optimal inverse transformation  is calculated under constraint conditions and the objective function is solved. 0 and  are optimized by alternating to meet the iterative conditions: The outer loop is to constantly update the inverse transform  until it converges by determining whether the objective function converges.(3) The results are obtained.According to the above solution procedure, the woven fabric images are corrected; the optimal inverse transformation  and the sparse noise  are obtained.
Figures 2(a) and 2(c) are the original woven fabric images; Figures 2(b) and 2(d) are the corrected woven fabric images using TILT.
Using Hough transform [15], the image is corrected by obtaining the optimal angle, which is the rotation transformation of the image.It is shown as follows: However, most of the images captured by the device are often rotary.Furthermore, there is more or less deviation in horizontal or vertical direction, which is the migration transformation.In other words, the images are not only rotated but also shifted.In this paper, the images are corrected at both horizontal and vertical directions by using TILT.
The corrected woven fabric images are obtained in Figures 3(e), 3(f), and 3(g) by using Hough transform, canny transform, and angle analysis, and the rotate angles are -3.0266 and 2.9851, -3.4682 and 3.3665, -2 and 1, respectively.The rotate angles by using TILT algorithm in Figures 3(d) and 3(h) are -3 and 3. Compared with these methods, the algorithm of TILT works effectively and robustly for woven fabric images with symmetric patterns and structures.Moreover, the sparse noise of original image can be obtained.
The results obtained in the recognition of woven fabrics are given in "experimental results and analysis" section.

HOG Feature Extraction.
In order to overcome the interference of a variety of pedestrian posture and clothing color.HOG [16] was proposed in 2005.In this paper, based on the HOG, we get the HOG features for recognition of woven fabrics.
The algorithm of HOG is shown in the following.
(1) For woven fabric images, the spatial representation of the 2D image at different scales can be obtained by convolution of the preprocessed images and Gaussian.Then calculate the region, which is the firstly and the finally segment line, and the HOG features will be extracted from each of these small blocks.
(2) HOG features extraction: the procedure of HOG features extraction is as follows.
(1) Gamma Rectification.Normalize the input images obtained in the segmented region by using gamma rectification.The formula is as follows: where gamma is set as 1/2.
(2) Gradient Image Computation.The gradient value and the gradient orientation of the image pixel in each of the small blocks are calculated: (3) Gradient Histogram Construction.We consider each segment region as the cells, project the gradient direction of each pixel in a cell onto the histogram, and generate the gradient histogram finally.The HOG features are obtained.

FCM Clustering.
Clustering analysis is based on partitioning a collection of data points into a number of subgroups, where the objects inside a subgroup show a certain degree of closeness or similarity.FCM [17] where  is a matrix showing the membership degree of instances to different classes,  is a set of  prototypes of the data set,  is a weighting exponent,  is the number of samples,  , is the membership degree of   in the cluster ,   is the ℎ member of −dimensional measured data,   is the −dimensional center of the ℎ cluster, and ‖ * ‖ is any norm expressing the similarity between any measured data and the center,   is Euclidean distance between the sample and the cluster center, and   is the correlation coefficient of the sample and the cluster center.
(2) Initialize degree of membership matrix  and the number of iteration  = 1.
(3) According to (13), update the cluster centers.According to the above step, the weft and warp crossareas are divided into two groups.Then the preliminary recognition results can be obtained.

Experimental and Results
In this paper, we implemented the proposed method in MATLAB R2012a and Windows 7. All the experimental samples, including plain, twill, and satin, are scanned by Epson Scan V330 under the same external condition.12 different fabric samples of different sizes were scanned and four representative fabrics which were cut into the same size were selected for the experiment.The resolution is 1200dpi.Figure 4 shows some representative samples of experimental woven fabric images.
The captured woven fabric images are corrected by using the TILT algorithm and the results are shown in Figure 5. Figures 5(a), 5(c), 5(e), 5(g) and 5(b), 5(d), 5(f), 5(h) are the corrected images  0 and the noise  of the original woven fabrics, respectively.According to (3), the optimal inverse transformation  is obtained by using the method of TILT, as shown in the following: After the image correction, it is necessary to convert into gray images for improving processing speed.However, Gaussian function for histogram equalization is used to distribute images gray level in lower and higher graylevel so that images contrast can be enhanced.The results are shown in Figure 6.
After image preprocessing, the weft and warp floats of woven fabric images are segmented, which is very important for weft and warp floats recognition.In this paper, 2D spatialdomain gray projection approach is used to segment the weft and warp floats.Due to the fact that the weft and warp yarns are perpendicular to each other, the weft and warp floats can be segmented accurately based on the gray projection curves.The segmentation results are obtained by using 2D spatialdomain gray projection.
The weft floats mean that the weft yarn is floating on the weft yarn and the warp floats reverse.In order to obtain the type of the floats, features should be extracted from the images.HOG feature grad is obtained and the results are shown as Figure 7, respectively.Finally, FCM clustering is used to recognize the type of weft and warp floats preliminarily.The results are shown in Figure 8.
In this paper, in the recognition of woven fabric pattern, the error judgment of the preliminary recognition results cannot be avoided with the woven fabric image itself and scanning.The recognition rate is used to measure the performance of the algorithm, which is defined as follows: where   means the recognition rate of woven fabrics.The greater the recognition rate, the better the recognition effect.  is the number of the overall recognition windows that are created on the image. ℎ denotes the number of the right windows that are recognized of a tested image.Table 1 illustrates the recognition rate for the woven fabrics using different methods.
From the preliminary recognition results, it can be seen that the accuracy of (c) is 100%, (a) is 95.63%,(b) is 95.83%, and (d) is only 94.11%.The error may be caused by a local defect of the fabric surface, a bad segmentation, or the low quality of fabric image.From the results, more than 90% weft and warp floats can be correctly recognized.
From Figure 7, it can be seen that it is necessary to correct the error recognition results.The woven fabric consists of the basic weave pattern.In order to identify the basic weave pattern, the preliminary weave pattern can transform into a matrix in which zero and one replace the black and white squares as shown in Figure 9 [18].
According to the basic weave patterns in Figure 10, in order to obtain the final weave pattern, we can generate their masks, as shown in Figure 11.
In the paper, an effective method based on TILT is proposed to correct the deviation of the fabric images.It is necessary to correct the scanned images for the woven fabric recognition.Taking the example of Figures 2(a After the statistical data of the recognition results were analyzed, the recognition rate and the elapsed time are shown in Table 1. The accuracy of woven fabric recognition is objectively appraised by using the correct rate, as shown in (17).With regard to the recognition accuracy of the five methods, it is observed that the recognition result by using the method of TILT performs best in the correct rate (94.57%).The recognition rate not only illustrates the recognition performance of the algorithm of the fabric image, but also shows recognition capability of the woven fabric.It can be seen that the identification of uncorrected image has a large margin of error.It makes no sense to compute the recognition rate due to the large deviations of the number of  organizations available.Meanwhile, the results obtained by using the method of angle analysis have some error due to the angle deviations.The proposed algorithm is characterized as follows: (1) it has a high recognition correct rate; (2) the noise can be obtained through the correction; (3) it can be applicable to recognition a wide range of plain, twill, and satin fabrics.Finally, the method based on TILT proposed in this paper is effective for the woven fabric images.

Conclusions
In this paper, an automatic and efficient classification method is proposed.In order to correct the captured woven fabric images, we propose a novel algorithm, based on low-rank texture transformation.In the recognition system, the skew angles of the original woven fabric images are corrected based on the algorithm of TILT.For the corrected images and image preprocessing, weft and warp floats are detected by using 2D spatial-domain gray projection in both horizontal and vertical directions; HOG is used to extract the features of the woven fabrics.Preliminary recognition results are obtained by using FCM clustering.To obtain the final recognized results, the black and white squares of the weave pattern are replaced with a matrix of zeroes and ones.The basic weave patterns are obtained by using the relevant statistics.
According to the basic weave patterns, the final recognized results are obtained.
To the authors' knowledge, no automatic method is applicable to identify all kinds of weave fabric up to now.Our method in this paper is proved to be capable of recognizing the plain, twill, and stain woven fabrics and it gains the best classification results (100%) with a faster speed.Also, there are some limits in this recognition system.For example, it cannot recognize the double layer weaves.

Figure 1 :
Figure 1: The overall framework of woven fabric pattern recognition.

Figure 2 :
Figure 2: Original and corrected woven fabric images.

Figure 3 :
Figure 3: The corrected images with different methods.

Figure 5 :
Figure 5: Corrected woven fabric images and the corresponding noise: (a), (c), (e), (g) are the corrected images; (b), (d), (f), (h) are the corresponding sparse noise obtained by using the algorithm of TILT.

Figure 6 :
Figure 6: The gray and the histogram equalization of woven fabric images: (a), (c), (e), (g) are the gray images of the original images; (b), (d), (f), (h) are the preprocessing images obtained by using histogram equalization.

Figure 7 :
Figure 7: The feature grad of the corresponding images.

Figure 8 :
Figure 8: Preliminary recognition results of the original images.

Figure 12 :
Figure 12: Recognition results by using different methods: (a) is the recognition result of the images without correcting; (b) is the recognition result of the corrected image by using the method of TILT; (c), (d), (e) are the recognition results of the corrected images by using Hough transform, Canny transform, and angle analysis.

Table 1 :
The correct rate and the elapsed time of different methods.