With the development of society, small-batch and multi-item have gradually become the production mode of the textile industry, which means that the textile companies are in desperate need of a rapid, automatic, and accurate method for analyzing the structural parameters and weave patterns of the fabric. In the traditional manual method, these parameters are identified by the inspectors with a textile magnifying glass, which is time-consuming and labor-intensive. Along with this trend, the recognition of fabric parameters, such as density and weave pattern, has become a research hotspot. Many feasible algorithms [1,2,3,4,5,6] based on image analysis have been proposed to recognize the fabric density and pattern. Generally, these methods can be classified into two categories: hand-crafted feature-based methods and deep learning-based methods.
The low-level features, such as the frequency and time domain features of the image, are often used to represent the texture information of the fabric. In the frequency domain, the peaks in the Fourier transform results of the fabric image represent the periodic structure formed by warp and weft yarns. Automatic detection [7,8,9,10] of fabric density can be achieved by locating the peaks in the fabric image and counting the number of located yarns. In the time domain, the pixels in the yarn have higher gray levels, while the pixels in the gap between the yarn reflect fewer lights, showing a lower gray level. In ref. [11], gray projection was proposed to locate the nodes and yarns. Then, pixel-level features, such as geometrical features [9,12,13] and statistical features [14,15], are extracted to classify the nodes. However, these methods pay more attention to white or homochromatic fabrics.
Recently, a significant breakthrough has been achieved on image analysis by moving from the low-level feature-based algorithms to deep learning-based end-to-end framework. Convolutional neural networks (CNNs) are widely applied to solve pattern recognition tasks. In the textile field, many researchers also adopted CNN methods to address some visual tasks, such as fabric image retrieval [16,17,18], weave pattern recognition [1,19,20,21], and defect detection [22,23,24]. For fabric weave pattern recognition, some researchers [20,25] converted the task to a classification task. However, Meng et al. [1] regarded the pattern recognition task as a multi-task problem that needs to locate and classify the nodes. Technologically speaking, fabric density and pattern recognition are carried out by many tasks, such as regression, classification, object detection, and color measurement. The complexity of this task makes it difficult to train and learn from the end-to-end CNN model. Moreover, the CNN methods require a lot of labeled data to drive learning, but it is difficult to obtain many ground-truth. This is the main reason why there are still few studies based on deep learning to address the weave pattern problem.
With the high demands for the appearance of clothes, yarn-dyed fabrics play a more important role in the textile market. Due to the mutual influence of various colors in the image of yarn-dyed fabric, it is difficult to achieve good performance by the current methods. Pan et al. [26] proposed a method for automatic detection of structural parameters of yarn-dyed fabric based on Hough transform and fuzzy C-means (FCM) algorithm. Xin et al. [27] used the active grid model to recognize the color pattern of yarn-dyed fabric. However, if yarn-dyed fabric has weft skew, these methods may not work well. Based on the work of previous researchers, in this article, an efficient method is proposed to recognize the structural parameters of yarn-dyed fabric, including density, weave pattern, and colored yarn arrangement. The proposed method can help companies analyze fabric parameters more quickly, resulting in efficient production. The following section introduces the proposed method in detail.
Woven fabrics are produced by interlacing two perpendicular sets of yarns: vertically passing warps and horizontally wefts. The cross states of warps and wefts are called interlacing nodes, which are classified into two types as follows: the warp interlacing node denotes a node with a warp residing on the top of a weft, and the weft interlacing node refers to a node with a weft passing above a warp. Generally, the weave pattern consists of the recurrence of the basic weave repeat. Yarn-dyed fabric, as a common type of woven fabric, is woven by two or more different colors of yarn.
The stability of the acquisition environment, including lighting conditions, scale, resolution, etc., is essential for fabric pattern recognition. For this requirement, the scanner is a good choice, which is not only cheap but also convenient. In this study, Canon 9000F Mark II Scanner is used to capture the yarn-dyed fabric image in the RGB (red, green, blue) model. The light source of this scanner is a white light-emitting diode, which can guarantee a stable capture environment. When obtaining fabric images, the resolution is an important parameter. A too high resolution will increase the amount of calculation in the recognition process, thereby affecting the recognition speed; whereas a too low resolution will cause inaccurate recognition. According to the warp density (weft density) of the fabric of 800 pieces/10 cm and the maximum tightness of 80%, the gap between the yarns is 0.025 mm. To ensure the accuracy of recognition, the gap should occupy at least two pixels in the scanned image. Under this condition, the corresponding resolution is not less than 2,032 dpi. So, in this study, the yarn-dyed fabric images are captured with a resolution of 2,400 dpi.
As shown in Figure 1, the image captured in 2,400 dpi contains 946 pixels and 26.5 warp threads per 1 cm. The wrap density of the fabric in the image is 67.3 threads/inch. Then, we can obtain that each warp yarn occupies about 35.7 pixels, which can ensure recognition accuracy. This calibration will serve as the benchmark for our subsequent recognition of fabric structural parameters. When acquiring fabric images, we should try to avoid the edge of the fabric. Moreover, the surface of the fabric should be clean and flat.
Figure 1
Calibration of pixels corresponding to 1 cm of fabric.

When capturing fabric images, it is difficult to ensure that the warp and weft yarns of the fabric remain completely horizontal and vertical. However, the inclination of the yarns in the fabric image will generally cause a large error in the recognition of fabric parameters. To improve the performance of the recognition, skew correction is required.
In this study, the process of skew correction is shown in Figure 2. We first enhance the fabric image, specifically, (1) convert the acquired RGB image to HSV (hue, saturation, value) space; (2) extract the brightness component
Figure 2
The process of skew correction.

Figure 3
Brightness enhancement of fabric image. (a) The brightness component

Figure 4
A sample of captured fabric images.

Then, the OTSU (named after the founder’s name) method is applied to segment interlacing nodes of the fabric. Due to the complex colors in the yarn dyed-fabric, directly using this method for threshold segmentation of the entire image will cause many interlacing nodes to be unrecognized, as shown in Figure 5(a). This study first divides the image into multiple blocks, as shown in Figure 5(b), and then uses the OTSU method to threshold each block. It is stated here that the number of grids is not fixed, but depends on the image size. In this study, each block contains at least 250 pixels (50 px × 50 px). Figure 5(c) presents the segmentation results using the proposed strategy. Compared to Figure 5(a), many missing interlacing nodes are recognized. After obtaining the binary image, the Canny operator is used to detect the edge, and the detection result is shown in Figure 5(d). The promising result demonstrates the effectiveness of the proposed method for interlacing node recognition.
Figure 5
Interlacing node extraction of fabric images. (a) The result of global threshold segmentation, (b) blocked result, (c) result of local threshold segmentation, and (d) the result of edge detection.

The aforementioned method can detect most of the interlacing nodes of fabric images. Then, two morphological methods, including erosion and dilation, are used to enhance the features of interlacing nodes. When detecting the warp inclination, the kernel of erosion and dilation is (4,1), and when detecting weft inclination, the kernel of erosion and dilation is (1,4). We apply Hough transformation to detect the lines in the binary image. The Hough transformation can detect thousands of straight lines in the image. We filter the straight lines that pass through more interlacing nodes by limiting the angle range and the length of the straight line. The detection results are shown in Figure 6. Finally, we regard the mean value of the inclination angle of the filtered straight line as the inclination angle of the yarns in the image. The proposed method detects that the warp inclination angle of the sample fabric is 2.16° (90 −
Figure 6
Hough transformation of the fabric image. (a) Spectrogram of Hough space and (b) straight lines detected in the fabric image.

Figure 7
Results of warp and weft correction. (a) Result of warp correction and (b) result of weft correction.

When the warp yarns are in a vertical state, we use affine transformation to correct the weft-inclination. The warp-corrected image undergoes the aforementioned steps, including threshold segmentation, edge detection, morphological processing (kernel: (1,4)), and Hough transform to obtain the tilt angle. Using the tilt angle, we perform the affine transformation to correct the weft. The weft correction result of the sample fabric is shown in Figure 7(b).
In the yarn image, the yarn axis part reflects more light, showing higher brightness; whereas the reflected light on both sides of the yarn is less, showing lower brightness [28]. The yarns in the yarn-dyed fabric image show a similar rule, from the axis to the gap between the yarns, the gray level gradually decreases. This rule can be used to detect the yarns in the fabric image.
For accurate recognition, we adopt an efficient method to strengthen the gap between the yarns. First, we use a relative total variation (RTV)-based smooth method [29] to eliminate the details of the image. The smooth method can be expressed by:
Figure 8
Detection results of the warp and weft yarns. (a) Smoothed fabric image, (b) gap-enhanced fabric image, (c) brightness projection in the weft, (d) brightness projection in the warp, and (e) the detection result of yarn layout.

The automatic interlacing node recognition of fabric images can be achieved by using the brightness characteristic information of the images. In this study, all the yarns can be regarded lying as straight stripes in the vertical and the horizontal directions after the skew correction and gridding model are constructed to separate the warp yarns as well as the weft yarns. As mentioned at the beginning of this section, the brightness distribution of the fabric image has an obvious gradient change. The gradient of fabric image intensity arranged in descending order is the axial line of yarns, the marginal zone of yarns, and the transition region between the yarns; in addition, an intensity mutation can be observed in the transition region, so the minimum intensity value can be found by using the projection algorithm in the vertical and the horizontal directions. With this method, the yarns can be detected and the interlacing nodes can be successfully located. Assume that
It is clearly shown that the valleys of the curve are corresponding to the weft gap position in the fabric image, whereas the peaks represent the axes of the yarns. The case of the warp yarns is similar to that of the weft described above, but the warp yarns lay in the vertical direction. Generally speaking, if
The density of yarn-dyed fabric can be computed with the resolution of the image when the yarns are recognized successfully by using the following equation:
The node type depends on the relative position of the weft and warp where they interlace. The node is defined as a warp node when the warp is at the top; otherwise, it is defined as a weft node. In this article, the node types are determined by a quadrilateral boundary of interlacing nodes, which is proposed in ref. [30]. The matrix representation of node type is shown in Figure 9(a).
Figure 9
The recognition results of the node type and color pattern of the sample fabric. (a) The matrix representation of node type and (b) color pattern of the yarn-dyed fabric image.

In the yarn-dyed fabric, color information is an important feature. The color feature of each interlacing node is represented by the following equation:
The FCM clustering method is proposed to classify the nodes with the color features extracted from the nodes. And it is an unsupervised method, which attempts to minimize the objective function by organizing the data into different clusters. We follow the method proposed in ref. [26] for node classification. However, the number of yarn colors in the yarn-dyed fabric should be known first. For automatic detection, Pan et al. [26] introduced the cluster validity criterion
| 2 | 3 | 4 |
| 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|
| 0.657 | 0.696 | 0.769 |
| 0.713 | 0.642 | 0.616 | 0.609 | 0.596 |
Note: The best result in the table is marked in bold.
FCM (
For a yarn-dyed sample, first the scanner is used to obtain its image. The inclination of the yarns in the fabric image will generally cause errors in the recognition of fabric parameters. Therefore, the method introduced in Section 3 is proposed to correct the warp and weft yarns. For accurate detection of the yarns in the image, a brightness-projection method is used to locate the gaps between the yarns, and thus recognize the layout of yarns. The results can be applied to measure the density of the yarn-dyed fabric. The types of interweaving nodes are recognized by using the method proposed in ref. [30]. FCM is proposed to classify the nodes with the color features extracted from the nodes. Combining the clustering result and weave pattern, we can obtain the color pattern of the yarn-dyed fabric.
Table 2 and Figure 10 present the actual parameters and detection results of three yarn-dyed fabric samples. The promising results demonstrate the effectiveness of the proposed method for the recognition of yarn-dyed fabric.
Actual parameters and detection parameters of the three samples
Name | Size (px) | Actual threads | Actual density | Re. threads | Re. density | Color | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
Warp | Weft | Warp | Weft | Warp | Weft | Warp | Weft | Warp | Weft | ||
a | 2,228 | 1,580 | 74 | 39 | 80 | 59 | 74 | 39 | 79.9 | 59.2 | 5 |
b | 2,494 | 1,684 | 101 | 45 | 97 | 64 | 101 | 45 | 97.2 | 64.1 | 6 |
c | 1,940 | 1,332 | 60 | 39 | 74 | 70 | 60 | 39 | 74.2 | 70.3 | 6 |
Figure 10
Recognition results of two other samples. (a) Original images, (b) corrected images, (c) weave pattern, and (d) color pattern.

To demonstrate the superiority of the proposed method, we compare some current methods on this topic including those of Pan et al. [26], Guo [5], Xin et al. [27], Iqbal Hussain et al. [2], and Meng et al. [1]. In this experiment, we implemented the aforementioned method following the authors’ paper and then tested it on 100 samples of yarn-dyed fabrics. Here, error rate [1] is employed to evaluate the recognition performance of contrasting methods. The experimental results are presented in Table 3. The proposed method achieves superior performance of 2.1%, 1.2%, 1.4%, and 0.6% on various metrics, outperforming other comparative methods. The method of Iqbal Hussain et al. [2] is the best performing method among the compared methods, however, our method reduces the error rate by about 2%. The experimental results show that the proposed method has a certain improvement in the identification of yarn-dyed fabrics, which demonstrates the superiority of the proposed method.
Comparison of experimental results with other methods
Methods | Threads (%) | Density (%) | ||
---|---|---|---|---|
Warp | Weft | Warp | Weft | |
Pan et al. [26] | 7.4 | 5.2 | 3.9 | 4.2 |
Guo [5] | 8.3 | 6.5 | 5.1 | 4.9 |
Xin et al. [27] | 6.8 | 6.3 | 4.3 | 3.9 |
Iqbal Hussain et al. [2] | 4.5 | 3.4 | 3.5 | 3.1 |
Meng et al. [1] | 23.5 | 43.3 | 34.9 | 43.8 |
Proposed | 2.1 | 1.2 | 1.4 | 0.6 |
We also use the method proposed in ref. [1] to recognize the yarn layout of the yarn-dyed fabrics, and the results are presented in Figure 11. The poor results are mainly caused by two reasons: (1) The model was trained from a small dataset, which leads to its low generalization; (2) the image resolution is different from the original. These results prove that in the case of limited data, low-level feature-based methods are more effective than learning-based methods.
Figure 11
The recognition results of yarn-dyed using the method proposed in ref. [1]. (a) Original image, (b) warp location, (c) weft location, and (d) warp node location.

Aiming at the recognition of the structural parameters of yarn-dyed fabric, an effective method is proposed based on the previous work, especially refs [1,26,30]. In the recognition system, the fabric images are captured by a scanner with a resolution of 2,400 dpi. The inclination angles of the warps and wefts of the fabric are detected by Hough transform. Then we use rotation transformation and affine transformation to correct the fabric image, respectively. A smoothing method is used to enhance the yarns and the gaps between the yarns to improve the accuracy of the yarn location. Using the detection results, the density of yarn-dyed fabric can be calculated by equation (5). The edge information of the four directions of the interweaving node is the main basis for judging whether it is a warp node or a weft node. The number of yarn colors obtained from cluster validity analysis and the extracted color features are used to classify the nodes with FCM algorithm. Based on the clustering results, the color pattern of yarn-dyed fabric can be obtained.
The proposed method has some limitations. For jacquard fabrics or multi-layer fabrics, our method may not work. However, it still can be used to measure the density of the fabric.
Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11
![The recognition results of yarn-dyed using the method proposed in ref. [1]. (a) Original image, (b) warp location, (c) weft location, and (d) warp node location.](https://sciendo-parsed-data-feed.s3.eu-central-1.amazonaws.com/6062bb8f9547524ed31646ed/j_aut-2022-0025_fig_011.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230402T024654Z&X-Amz-SignedHeaders=host&X-Amz-Expires=18000&X-Amz-Credential=AKIA6AP2G7AKP25APDM2%2F20230402%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Signature=960a74dc909fb312f93249897a406c6af54038aad76e4ff7bc27a6db265efe2d)
Comparison of experimental results with other methods
Methods | Threads (%) | Density (%) | ||
---|---|---|---|---|
Warp | Weft | Warp | Weft | |
Pan et al. [ |
7.4 | 5.2 | 3.9 | 4.2 |
Guo [ |
8.3 | 6.5 | 5.1 | 4.9 |
Xin et al. [ |
6.8 | 6.3 | 4.3 | 3.9 |
Iqbal Hussain et al. [ |
4.5 | 3.4 | 3.5 | 3.1 |
Meng et al. [ |
23.5 | 43.3 | 34.9 | 43.8 |
Proposed | 2.1 | 1.2 | 1.4 | 0.6 |
V MPC indices for yarn-dyed fabric image
|
2 | 3 | 4 |
|
6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|
|
0.657 | 0.696 | 0.769 |
|
0.713 | 0.642 | 0.616 | 0.609 | 0.596 |
Actual parameters and detection parameters of the three samples
Name | Size (px) | Actual threads | Actual density | Re. threads | Re. density | Color | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
Warp | Weft | Warp | Weft | Warp | Weft | Warp | Weft | Warp | Weft | ||
a | 2,228 | 1,580 | 74 | 39 | 80 | 59 | 74 | 39 | 79.9 | 59.2 | 5 |
b | 2,494 | 1,684 | 101 | 45 | 97 | 64 | 101 | 45 | 97.2 | 64.1 | 6 |
c | 1,940 | 1,332 | 60 | 39 | 74 | 70 | 60 | 39 | 74.2 | 70.3 | 6 |
Automatic Identification Of Wrist Position In A Virtual Environment For Garment Design Pressure Evaluation Of Seamless Yoga Leggings Designed With Partition Structure Tensile Properties Analysis Of 3D Flat-Knitted Inlay Fabric Reinforced Composites Using Acoustic Emission From Raw To Finished Cotton—Characterization By Interface Phenomena A Study on the Woven Construction of Fabric Dyed With Natural Indigo Dye and Finishing for Applying to Product Design for Home Textile Products A Calculation Method for the Deformation Behavior of Warp-Knitted Fabric Nondestructive Test Technology Research for Yarn Linear Density Unevenness Blend Electrospinning of Poly(Ɛ-Caprolactone) and Poly(Ethylene Glycol-400) Nanofibers Loaded with Ibuprofen as a Potential Drug Delivery System for Wound Dressings Study On Structure And Anti-Uv Properties Of Sericin Cocoons Fit And Pressure Comfort Evaluation On A Virtual Prototype Of A Tight-Fit Cycling Shirt Developing Real Avatars for the Apparel Industry and Analysing Fabric Draping in the Virtual Domain Review on Fabrication and Application of Regenerated Bombyx Mori Silk Fibroin MaterialsThe Effects of Sensory Marketing on Clothing-Buying Behavior Transport of Moisture in Car Seat Covers Review on 3D Fabrication at Nanoscale Investigation of the Performance of Cotton/Polyester Blend in Different Yarn Structures Design of Clothing with Encrypted Information of Lost Children Information Based on Chaotic System and DNA Theory Application of Spectral Analysis in Spinning Measurements Polyaniline Electrospun Composite Nanofibers Reinforced with Carbon Nanotubes Current Development and Future Prospects of Designing Sustainable Fashion Effect of Surface Modification of Himalayan Nettle Fiber and Characterization of the Morphology, Physical and Mechanical Properties Investigation of Actual Phenomena and Auxiliary Ultrasonic Welding Parameters on Seam Strength of PVC-Coated Hybrid Textiles Modeling Lean and Six Sigma Integration using Deep Learning: Applied to a Clothing Company Comparative Analysis of Structure and Properties of Stereoscopic Cocoon and Flat Cocoon Effect of Different Yarn Combinations on Auxetic Properties of Plied Yarns Analysis of Heat Transfer through a Protective Clothing Package Study on the Thermal and Impact Resistance Properties of Micro PA66/PU Synergistically Reinforced Multi-Layered Biaxial Weft Knitted Fabric Composites Fea-Based Structural Heat Transfer Characteristic of 3-D Orthogonal Woven Composite Subjected to the Non-Uniform Heat Load Comfort-Related Properies of Cotton Seersucker Fabrics Investigating textile-based electrodes for ECG monitoring in veterinary clinical practice Identification of metal threads from Croatian fabrics Automatic recognition of density and weave pattern of yarn-dyed fabric Non-planar 3D printed elements on textile substrate using a fused filament fabrication 3D printer Wearable design for occupational safety of Pb2+ water pollution monitoring based on fluorescent CDs Investigating the Effect of Recycled Cotton Included Fabrics on the Thermal Behaviour by Using a Female Thermal Manikin Investigation of surface geometry of seersucker woven fabrics Liquid moisture transport in stretched knitted fabrics Study on Process Optimization and Wetting Performance of Ultrasonic-Oxidized Wool Fiber Thermal Resistance of Gray Modal and Micromodal Socks Textronic Solutions Used for Premature Babies: A Review State of the art of presentation of clothing textiles in E-commerce with size matching issues Animal fiber recognition based on feature fusion of the maximum inter-class variance Tie-dyeing pattern fast-generation method based on deep-learning and digital-image-processing technology A review of textiles reflecting FIR produced by the human body Computer geometric modeling approach with filament assembly model for 2 × 1 and 3 × 1 twill woven fabric structures Single-sided Jacquard knit fabric development and seamless ski underwear zoning design based on body mapping sportswear Development of the Smart T-Shirt for Monitoring Thermal Status of Athletes Assessment and Semantic Categorization of Fabric Visual Texture Preferences Application of Coating Mixture Based on Silica Aerogel to Improve Thermal Protective Performance of Fabrics A Biomimetic Approach to Protective Glove Design: Inspirations from Nature and the Structural Limitations of Living Organisms Washing Characterization of Compression Socks Development of a Small, Covered Yarn Prototype Numerical Prediction of the Heat Transfer in Air Gap of Different Garment Models Archaeology and Virtual Simulation Restoration of Costumes in the Han Xizai Banquet Painting Modeling of Material Characteristics of Conventional Synthetic Fabrics