Fabric texture representation plays a vital role in quality control procedures and automatic inspection, like automatic identification of weave density inspection [1], and detection of abnormal regions[2, 3]. A considerable number of approaches have been proposed for fabric texture analysis. These methods can be categorised into three types: spectral, statistical, and model-based [4]. The majority of these approaches focus on extracting useful texture features [5]. However, conducting an exhaustive survey of all texture features and then identifying a general feature that adapts to various types of fabrics are impractical. Moreover, no straightforward way can be used to judge whether the elements are suitable [6]. To avoid the shortcomings of fabric feature extraction, many researchers have adopted dictionary learning based on sparse representation to characterise fabric texture.
Dictionary learning based on sparse representation has been widely used in image compression [7], face feature recognition [8], and so on. Nevertheless, in the textile field, dictionary learning-based sparse representation is only used to detect defects. For example, Zhou et al. [9] presented a learned dictionary algorithm based on sparse representation. Their experimental results showed robust and improved performance with high precision and acceptable recall rates. Zhu et al. [10] used defect-free fabric images to build an overcomplete basis set via sparse coding. Then, the projections of a defect-free fabric patch in the basis set were regarded as original features. The characteristics of the test fabric were compared with the average of the original features, and their experimental results demonstrated that the algorithm proposed could detect defects on twill, plain, gingham, and striped fabrics efficiently. Therefore, fabric surface texture reconstruction is commonly adopted due to its consideration of the measurement characteristics of fabrics and the quality assessment of essential products.
Therefore, a novel method based on sparse representation for fabric texture analysis was designed. The method proposed was applied in two aspects: fabric characterisation and defects detection. For regular fabric texture, woven fabric parameters like the weave repeat were investigated to determine the impact on texture characterisation. In addition, the method proposed was also validated by inspecting fabric defects. The structure is illustrated in Figure 1.
Procedure of fabric characterisation and defect detection
To demonstrate the efficiency of our algorithm, the approach was applied to investigate the effect of the fabric weave repeat on texture reconstruction and detecting fabric defect samples. Firstly, eight weave repeats including plain, twill, honeycomb, warp satin, weft satin, basket, diamond twill, and complicated twill, were woven to explore how the weave pattern affects fabric texture representation. Aside from the weave pattern, other conditions, such as the material, weave density, and yarn count, were the same. Forty fabric samples, 20tex*2 folded yarns (cotton), were used in the warp and weft and then woven on a Sakura rapier loom (a TNY101B-20), which was semiautomatic. Secondly, fabric defects were detected. Among six kinds of samples, four were captured from the production line.
Signal,
For an arbitrary fabric image,
The algorithm proposed included two parts: sparse coding and reconstruction. In the sparse coding part, the sample image was divided into small patches, and then every small patch was decomposed by fixing the dictionary to obtain the sparse coefficient matrix. The Discrete Cosine Transform dictionary (DCT) [12] was highly suitable for period signals because the woven fabric texture exhibited homogeneous subpatterns and a stable cycle. In this work, Orthogonal Matching Pursuit (OMP)[11] was adopted because of its simplicity and efficiency.
When the value
In the reconstruction part, an approximated image could be obtained using the product of the dictionary and coefficient matrix (Equation 4).
In the sparse reconstruction, we represented the small patches instead of the entire image due to the computation burden. An image
Flow chart of a small patch partition
Besides the description above, the influence of weave patterns on fabric texture reconstruction was investigated using a novel method to measure the fabric texture period. For an arbitrary grey level fabric image f(i, j) ∈
In this study, we could measure the likeness between an arbitrary original fabric image
From Equation 6, PSNR is a positive quantity, signifying how similar the original and reconstructed images are. Its trend is similar to that of SSIM.
To avoid the influence of illumination conditions and other uncontrollable factors, the fabric samples were scanned using a Cano Scan 9000F Mark II in the grayscale mode, with auto scan, and at a resolution of 600 dpi. The images were cropped to a size of 256×256 pixels (shown below) with 256 grey levels. All experiments were implemented in MATLAB R2014a on a computer with a 1.8 GHz processor and 6 GB memory. The method proposed was applied to investigate the impact of the fabric weave repeat on texture representation and to detect fabric defects based on a variety of fabric samples (48 fabric samples), including 40 defect-free fabric images of different weave patterns and eight defective samples.
From Equation 1, the coefficient matrix
Visual reconstruction samples with different dictionary sizes: (a) reconstruction of plain fabric image; (b) reconstruction of twill fabric image.
In the quantity aspect, as the dictionary size
Representation result of the fabric samples with different dictionary sizes k: (a) PSNR; (b) SSIM
In the framework, the algorithm was operated on an image patch because of the higher computation cost for the entire image. Woven fabric is made of a cross combination of warp and weft yarns following a weave pattern. In general, partitioning images into small patches is important. Therefore, three different patch sizes, 8×8, 16×16, and 32×32, were explored for fabric texture reconstruction. We also tested two samples of
The test results of the fabric samples are illustrated in Figure 5, where the dictionary size was 256. From Figure 5, the difference is not evident for the two samples, and the trends are remarkably similar. For the same dictionary size, the smaller the patch size was, the more texture details were reconstructed.
Representation results for two fabric samples: (a) and (b) are plain fabric's PSNR and SSIM for different patch sizes with various sparse cardinality T; (c) and (d) are twill fabric's PSNR and SSIM for different patch sizes with various sparse cardinality T
Thus, the quality of the reconstructed one and the similarity to the original sample for 8×8 were better than those for the other patch sizes. Generally, patch size 8×8 presented the best performance in terms of PSNR and SSIM for fabric texture representation; hence, it was selected to characterise fabric texture. Given that the approach proposed was based on sparse representation, the size of the cardinality of the sparse coefficient matrix exhibited an enormous effect on our method. When
In this part, we represented the original fabric texture with a patch size of 8×8 and
Original fabric sample with different weave patterns: (a) plain, (b) twill, (c) weft satin,(d) warp satin, (e) basket weave, (f) honeycomb, (g) compound twill, (h) diamond twill
The reconstructed images for every weave pattern looked the same as the original fabrics. Nonetheless, the reconstructed images looked smoother and clean (Figure 6). This result could be attributed to the fact that the algorithm proposed could efficiently remove noise or blur, which might be caused by some inevitable factors, such as illumination and ash. In the quantity aspect, the values of SSIM for all the test samples were greater than 0.81 (Figure 7). Therefore, the experimental results demonstrated that the reconstructed images were identical to the original ones in visual and quantity aspects.
Reconstructed fabric samples: (a) plain, (b) twill, (c) weft satin, (d) warp satin, (e) basket weave, (f) honeycomb, (g) compound twill, (h) diamond twill.
To explore the relationship between weave pattern and texture presentation, we calculated the representation results of all the fabric samples (every weave pattern with five samples) in terms of PSNR and SSIM (Figure 8).
Texture period for various weave patterns, for every weave pattern, the left is warp period and the right is weft period
1 | 11 | 17 | 14 | 14 | 5 | 19 | 15 | 14 | 11 | 10 | 5 | 5 | 20 | 22 | 25 | 20 |
2 | 6 | 7 | 7 | 10 | 5 | 5 | 13 | 17 | 8 | 7 | 10 | 10 | 11 | 18 | 17 | 9 |
3 | 3 | 3 | 6 | 7 | 14 | 17 | 14 | 10 | 6 | 8 | 9 | 12 | 11 | 13 | 16 | 9 |
4 | 7 | 7 | 8 | 6 | 12 | 13 | 6 | 16 | 7 | 7 | 16 | 14 | 15 | 12 | 12 | 9 |
5 | 11 | 8 | 9 | 9 | 28 | 14 | 17 | 23 | 6 | 6 | 9 | 26 | 13 | 12 | 28 | 28 |
Average | 8 | 8 | 9 | 9 | 13 | 14 | 13 | 16 | 8 | 8 | 10 | 13 | 14 | 15 | 20 | 15 |
Representation results of all test samples; (a) PSNR, (b) SSIM
From Figure 8 it can be seen that every weave pattern might have diverse results; but the plain fabric generally had the best performance in the quality of reconstructed images regarding PSNR. The basket weave had the best similarity to the original fabric sample in terms of SSIM. The average PSNR for the basket weave was next to that for the plain one, and the SSIM for the plain weave was after that for the basket weave. Therefore, the plain and basket weave patterns showed better performance than the other weave patterns, which had a highly similar representation performance. The diamond twill, complicated twill, warp satin, and twill were after the best ones because their PSNR and SSIM had extremely small differences. Although a difference existed between the warp satin and honeycomb, the average result was the worst one.
As stated above, the weave pattern was roughly divided into three groups in terms of PSNR and SSIM. The texture period both in the direction of warp and weft was studied for all the test samples (see Table 1) to investigate their structure. To be more precise, the texture period and representation result were combined to classify the weave pattern. From Table 1, the texture period for plain, basket weave, and diamond were the same, which was the smallest among the weave patterns. In addition, the representation result for plain and basket weave was the best on the basis of PSNR and SSIM, as stated above. Therefore, the plain and basket weave was the first type. Except for the twill, the other weave patterns had a very similar period, it was very hard to classify the weave pattern. Considering the representation result, the warp satin, diamond twill, and compound twill belong to the second type. The warp satin, honeycomb, and twill were of the third kind.
The method proposed could also be applied in fabric defect detection. To evaluate its efficiency, different kinds of fabric defects, eight in total, were detected. Firstly, the approximated image, which could be seen as a ‘standard template’, was obtained by the sparse dictionary with a non-overlapping small patch. Secondly, a subtraction was undertaken between the original image and reconstructed image. Finally, the defects were pointed out by setting an appropriate threshold patch by patch. The results are illustrated in Figure 9, from which different defects could be accurately located.
Fabric defect detection result
In this paper, a novel algorithm is proposed based on sparse representation to address the fabric texture characterisation problem. The method proposed can efficiently approximate columns of regular fabric image samples with a linear combination of their elements. The parameter is flexible, and with different small patch division methods, the reconstructed woven fabric texture image can be applied to regular fabric texture and defective fabrics.
For fabric characterisation, the experimental results showed that different weave patterns have various representation results. The eight different weave patterns were preliminarily classified into three groups regarding the representation result and texture period. The plain and basket weave patterns had the best performance. The defects can be inspected well by the designed algorithm.
In the future, more kinds of fabric types and parameters may be taken into account to improve the representation result. The approach will be extended to detect complex fabric defect samples.