Abstract
A new objective fabric pilling detection method is proposed for monochrome fabric without pattern. Firstly, through wavelet multi-resolution decomposition and reconstruction, remove the high-frequency noise such as fluff which is significantly different from the size of pills and low-frequency noise such as uneven illumination. After wavelet multi-resolution decomposition of fabric image, through analyzing the energy change law between each wavelet decomposition layer, and then the fabric is judged whether it is rough or fine texture. Then, according to the different color characteristics of fine texture and rough texture fabrics, the even symmetry two-dimensional Gabor filter with smoothing effect and the odd symmetry two-dimensional Gabor filter with edge extraction ability in different directions are selected for texture removal. Finally, fabric pilling parameters are extracted to realize fabric pilling grade evaluation. The main contribution of this method is: on the premise of removing the noise such as uneven illumination and fluff, on the basis of considering the different color change laws of fine texture and rough texture, using the directionality of fabric texture and the randomness of pills direction to effectively remove the texture noise, so as to improve the accuracy of fabric pilling grade evaluation.
Introduction
Pilling caused in wear and care procedures is one of the most serious problems for the apparel industry.1,2 Conventionally, fabric pilling grade is evaluated through trained human eyes in accordance to the pilling standards, to determine the grade of pilling on a level ranging from 1 to 5 (from severe pilling to no pilling).3,4 This subjective method is inevitably lack reproducibility and repeatability. 5 All of the above have led to the development of various automated pilling evaluation systems based on image analysis that are more objective.
At present, the mainstream fabric pilling methods mainly include two-dimensional image method and three-dimensional image method. 6 The three-dimensional image method can generally extract the pills height information, so it can process the pills extraction of non unicolor fabrics with complex patterns. However, the three-dimensional image method not only has high requirements for the image acquisition environment, but also often requires additional lighting equipment and complex acquisition equipment. For example, even if the 3D fabric surface reconstruction method claims to use cheap and accessible equipment, four lighting devices are still required, and there are strict requirements on the placement distance and placement angle of lighting devices relative to fabric samples. 7 The two-dimensional image method mainly extracts the pills information based on the difference between the pills and the background in color,8–10 size3–5,11–13, periodicity of texture color change,14–16 and so on. However, due to the small color difference between the pills and the background such as fabric texture, and the randomness of the pills size, so far, even the wavelet transform method with quite good denoising effect still has the problem that some fabric textures are not removed cleanly, which affects the accuracy of pills parameter extraction.
In order to solve this problem, based on the ability of local binary pattern (LBP) algorithm to detect texture, some researchers use the change of texture color change law caused by non texture factors to remove the influence of texture noise on fuzzing and pilling grade evaluation or defect detection in fabric image.4,17
However, compared with defects, the damage degree of pills to texture is weak and the damage range of single pill is small, so the change of texture arrangement law is small. In addition, the change of texture arrangement law caused by the randomness of pills shape and size is random. Therefore, it is not the best choice to remove the influence of fabric texture on pills detection by LBP algorithm.
In this study, the idea of combining wavelet transform algorithm and Gabor algorithm is proposed. The wavelet multi-resolution layered characteristic is used to remove the high-frequency noise such as fabric fluff and low-frequency noise such as uneven illumination, and then the texture noise is removed according to the excellent image smoothing ability or texture extraction ability of Gabor algorithm, so as to realize the robust extraction of fabric wool ball.
Figure 1 shows the flow chart of system framework.

The flow chart of system framework.
Main algorithm analysis
Discrete Haar wavelet transform and Gabor transform are the decisive algorithms in this study. In this section, their working principle is briefly introduced
2DDHWT analysis and application problems
Define two-dimensional scaling function
Where x, y refers to the spatial coordinate index, and the unit is pixel, the same below. The
Given two-dimensional scale and wavelet function, 18 as shown in equations (5) and (6) respectively.
Where index identifies the directional wavelets in equations (2)–(4). Rather than an exponent, is a superscript that assumes the values H,V and D. The discrete wavelet transform of image f(x,y) with the size M×N pixels is then defined as equation (7) and (8).
Where
Among several wavelet transforms, Haar transform has good frequency stratification ability and is the simplest one. 18 Therefore, Haar transform is selected as the denoising algorithm of fabric pilling image.
Equations (9) and (10) show the Haar wavelet scaling function and wavelet function in one dimension respectively. 19
The two-dimensional discrete Haar wavelet transform wavelet (2DDHWT) decomposes an image into one low frequency approximate sub-image and three high frequency detail sub-images at each decomposition scale. 3
Take the three scales 2DDHWT decomposition of Figure 2(a) shown in Figure 2(b) as an example to illustrate some wavelet concepts. In Figure 2(b), and represent the high-frequency detail sub-images corresponding to horizontal, diagonal and vertical orientations at the level decomposition scale respectively, and expresses the low frequency approximate sub-image. Different 2DDHWT decomposition levels reflect different frequency information. The 1-level wavelet decomposition layer contains the highest frequency information in the image, the 2-level wavelet decomposition layer contains the second highest frequency information in the image, and so on.

Haar wavelet decomposition display: (a) original image and (b) the three scales Haar decomposition.
The noise in a pilled fabric image mainly includes fabric texture, surface unevenness, illuminative variation, and high-frequency noise.3–5,11–13
The high-frequency noise in the fabric pilling image mainly appears in the first layer of wavelet decomposition, while the low-frequency noise caused by uneven fabric and uneven illumination mainly appears in the approximate layer after 6-layer wavelet decomposition.3–5 The fabric texture often appears on the two adjacent wavelet decomposition layers. 3 The texture roughness is different, and the adjacent wavelet decomposition layers are different. 3
Wavelet transform can remove noise by setting the coefficients of wavelet decomposition layer containing noise information to zero and then wavelet reconstruction.
However, for some fabrics, the effect of texture removal by this denoising method is not ideal.
In Figure 3, the pilled fabric image was decomposed in six scales by 2DDHWT , and because the fabric texture information mainly exists in two adjacent scales,3,4 the decomposed image was reconstructed at any two adjacent scales by simply retaining the scale

The reconstruction effects at two adjacent Haar wavelet decomposition scales: (a) scale1+scale2, (b) scale2+scale3, (c) scale3+scale4, (d) scale4+scale5, (e) scale5+scale6, and (f) original image.
To solve this problem, Gabor filter is selected to remove the fabric textures based on the roughness of fabric.
Gabor filter analysis
Gabor filter is windowed Fourier transform. Compared with Fourier transform, Gabor filter can well describe local structural information such as spatial frequency, spatial location and direction of processed target, and achieve optimal localization, so it is a good texture expression, description and removal method. Even and odd symmetry two-dimensional Gabor filters used in this study are shown as equations (11) and (12) respectively.20,21
The noise in a pilled fabric image mainly includes fabric texture, surface unevenness, illuminative variation, and high-frequency noise.3–5,11–13
The high-frequency noise in the fabric pilling image mainly appears in the first layer of wavelet decomposition, while the low-frequency noise caused by uneven fabric and uneven illumination mainly appears in the approximate layer after 6-layer wavelet decomposition.3–5 The fabric texture often appears on the two adjacent wavelet decomposition layers. 3 The texture roughness is different, and the adjacent wavelet decomposition layers are different. 3
Wavelet transform can remove noise by setting the coefficients of wavelet decomposition layer containing noise information to zero and then wavelet reconstruction.
However, for some fabrics, the effect of texture removal by this denoising method is not ideal.
In Figure 3, the pilled fabric image was decomposed in six scales by 2DDHWT, and because the fabric texture information mainly exists in two adjacent scales,3,4 the decomposed image was reconstructed at any two adjacent scales by simply retaining the scale
To solve this problem, Gabor filter is selected to remove the fabric textures based on the roughness of fabric.
Gabor filter analysis
Gabor filter is windowed Fourier transform. Compared with Fourier transform, Gabor filter can well describe local structural information such as spatial frequency, spatial location and direction of processed target, and achieve optimal localization, so it is a good texture expression, description and removal method. Even and odd symmetry two-dimensional Gabor filters used in this study are shown as equations (11) and (12) respectively.20,21
Where u, v are frequency variables. Where
Where b represents bandwidth, and must be a positive real number.
The even symmetry two-dimensional Gabor filter shown in Figure 4(a) is a filter formed after the sinusoidal plane wave propagating in frequency f along the direction

Image representation of Gabor filter: (a) the image representation of even symmetry two-dimensional Gabor filter and (b) the image representation of odd symmetry two-dimensional Gabor filter.
In Figure 4, the parameters
Fabric image acquisition and preprocessing
This section mainly introduces the source and preprocessing of fabric image.
Fabric image acquisition
The fabric pilling images used in this study mostly come from professional research institutions in the textile field, mainly including Shanghai wool and linen Research Institute, Tianjin Knitting Technology Research Institute, Suzhou Silk Research Institute and China Textile Research Institute. The fabric pilling images provided by these professional fabric research institutions are provided in the form of paper photos, and the pilling grades have been divided.
And these pilling fabrics are mainly divided into two categories. One is worsted fabric, which is obtained by circular trajectory method based on Chinese GB/T 4802.1-2008 standard. In this study, it is called fine fabric.
The steps of circular track pilling method are as follows: firstly, cut a circular sample with a diameter of 113 mm from the sample; Then foam plastic gaskets, cutting samples and abrasives were installed on the test chuck and grinding table respectively. Finally, according to the fabric type and the standard GB/T 4802.1-2008, the test parameters are selected for the test, and the pilling samples are obtained.
The other kind is coarse combed wool fabric, whose pilling samples are obtained by pilling box method based on Chinese GB/T 4802.3-2008 standard. In this study, it is called rough fabric.
The pilling steps of pilling box method are as follows: firstly, cut a square sample with a size of 125 mm × 125 mm from the sample; Then put the sample on the polyurethane sample carrying tube and fix it with PVC tape; Finally, put the sample loading tube into the box, firmly close the box cover, set the counter to the required rotation times according to GB/T 4802.1-2008 standard, start the pilling box, complete the pilling operation, and obtain the pilling sample.
Fabric image preprocessing
In order to obtain the digital fabric pilling image, this study uses a DCP-7010 laser multi function machine to scan the photos. The size of the scanned image is
Before extracting fabric pilling parameters, the background without fabric in the scanned image should be removed first.
The circular worsted fabric pilling image samples obtained by the circular trajectory method, which are called fine images in this study, are shown in Figure 5(a). Circle detection method based on Hough transform was used to detect the fabric area. First, the image shown in Figure 5(a) was segmented into binary image (as shown in Figure 5(b)) used Otsu method. Second, in order to remove small white block noise and effectively preserve the fabric area edge, the binary image shown in Figure 5(b) was filtered through adaptive median filter that the maximum size is

The pilled image acquisition process: (a) the original pilled image, (b) the binary image, and (c) the cropped image.
The cropped image size is about 500 by 500 pixels.
The rough wool fabric sample is square, which can be realized by scanning the image pixel values from left to right and from top to bottom. Because the background without fabric is close to white and the fabric is darker than the background, the coordinates of the four corners of the positioning square can be suddenly changed by the pixel value in the scanning, so as to realize the clipping. The size of the cropped image is about 400 by 400 pixels to 500 by 500 pixels, as shown in the image in Figure 7(b).
Image noise removal
This section mainly introduces the removal process of various noises in the fabric pilling image.
Fabric roughness judgment and non texture noise removal
In Figure 3(a), the periodic background textures generate similar frequency information, so each wavelet decomposing level energy calculated by equation (15) can distinguish the roughness of fabric.
Where
Experiments show that it is appropriate to decompose the fabric pilling image into six scales. The reconstructed image of the scale 1 is mainly composed of highest frequency information in the original image. Approximate sub-image at scale 6 consists of the fabric surface inequalities and the background illuminative variance. And the other detail sub-images mainly comprise textures and pills information (see Figure 6). Figure 7 shows the variation law of the scale energy of fine and rough background texture fabric respectively. We can judge whether the fabric is rough or fine according to the change law of wavelet energy.

Display of different noise information of fabrics: (a) original pilled fabric image, (b) reconstructed image of detail sub-images at scale 1, (c) reconstructed image of approximate sub-image at scale 6, and (d) reconstructed image of detail sub-images at scale 2 to scale 6.

The variation law of the scale energy of fine and rough background texture fabric: (a) fine fabric and (b) rough fabric.
From Figure 7, we can see that the maximum energy of fine and rough background fabric images present at scale 2 and scale 4 respectively. If the two scales with maximum energy are the scale 1 and scale 2 or scale 2 and scale 3 then the fabric is regarded as fine fabric, otherwise the fabric is regarded as rough fabric.
After judging whether it is rough fabric or fine fabric, only the detail sub-images at scale 2 to scale 6 of wavelet multi-resolution decomposition are reconstructed (the reconstructed image shown in Figure 7), so as to remove high-frequency noise such as fabric fluff and low-frequency noise such as uneven illumination. The size of these noises is obviously different from that of the fabric pills, which can be effectively removed by the above wavelet method.
Removal of fabric texture based on Gabor filter
Based on Gabor filter, fabric texture can be removed in two ways: one method is to smooth fabric texture with even symmetry two-dimensional Gabor filter, so fabric background texture brightness is more similar, and then the color-based segmentation method can be used to remove the texture (Called smoothing method). Another method, we can detect the fabric texture edges with odd symmetry two-dimensional Gabor filter. The fabric texture edges are detected, then in the original grayscale fabric image containing fuzz and pillars, the pixel values at texture edge’s coordinates are set to zero, to achieve the removal of the texture edges (Called sharpening method).
Because the fine fabric’s warp and weft yarns are fine, the brightness difference between yarn junction and yarn surface is small. In other words, compared with coarse fabric the fine fabric texture edges are not so clear and are not so easy to be detected correctly, so smoothing method is used. In equation (1), the parameters

The images got from main steps of Gabor filtering process: (a1) the original pilled image of fine fabrics, (b1) reconstructed images of 2–6 layers of wavelet details in figure a1, (c1) image filtered by even Gabor filter with the angle
In Figure 8(a1) and (a2) are the original pilled image of fine and rough fabrics, then (a1) and (a2) are decomposed into 6 levels by Haar wavelet, and then detail sub-images at scale 2 to scale 6 are reconstructed respectively, the reconstructed images are shown in Figure 8(b1) and (b2). The reconstructed image shown in Figure 8(b1) was filtered by even Gabor filter with the angle
Pilling features extraction
In order to be consistent with the evaluation results of the standard sample comparison method used in manual detection, most researchers take pill number, pill density, parameters related pill size and shape as the parameters of fabric pilling grade evaluation. Therefore, this study attempts to use pill number, pill density, the maximum area of pills and the standard deviation of pill areas as candidate parameters.
In the binary segmentation image of fabric pilling shown in Figure 8, white represents fabric pills and black represents fabric background. Suppose the area of each connected region is pi pixels, then the pill number corresponds to the number of connected areas, which is recorded as N. The total area of these pills is marked as S pixels, then, S = p1 +p2 + . . . pN, and the pill density D is D = S/A, where A is the total area of pilling image. The maximum area of these pills is recorded as Pmax.
The area standard deviation of pills reflect the dispersion of pill size. The area standard deviation is recorded as
Where,
Taking the worsted fabric (the image shown in Figure 8(a1) belongs to worsted fabric) as an example to analyze these parameters. As shown in Figure 9, the corresponding characteristic parameters are extracted from the five level segmented binary images of the fabric pilling standard sample provided by Suzhou Silk Research Institute, and their values are shown in Table 1.

Five level standard sample photos provided by Suzhou Silk Research Institute and their binary image.
Characteristic parameters of five grades of standard sample of fabric pilling.
Then, Pearson coefficient is used to analyze the correlation between the selected four characteristic parameters and the fabric pilling grade. The results are shown in Figure 10.

Correlation between characteristic parameters and pilling grade: (a) standard deviation of pill areas (r = −0.9953), (b) maximum area of pills (r = −0.9649), (c) pill number (r = −0.9932), and (d) pill density (r = −0.9918).
From the correlation coefficient, it can be concluded that there is a negative correlation between the selected four characteristic parameters and the pilling grade. Among them, compared with the other three characteristic parameters, the correlation coefficient of the maximum area of pills is smaller, which is because in the actual pilling experiment, with the increase of pilling friction times, small fabric pills will be wound into larger pills, but when the friction reaches a certain degree, the continuous increase of friction times will lead to the decomposition and falling off of large pills, Therefore, even fabrics with secondary pilling grade may have larger pilling area than those with primary pilling grade. After the experiments and theoretical analysis of the above-mentioned pilling parameters, in order to consider the accuracy of fabric pilling grade evaluation, this study selects three characteristic parameters: the standard deviation of pill areas, pill density and pill number as the parameter index to judge the fabric pilling grade.
Pilling grade evaluation and discussion
The evaluation method of fabric pilling grade used in this study is to extract the relevant parameters of fabric pilling standard samples at all levels for standby, then extract the corresponding pilling parameters of the fabric to be evaluated, and compare them with the pilling parameters of the standard samples to determine the pilling grade of the fabric to be tested. The parameters extracted from the five level standard sample of worsted fabric used in this study have been shown in Table 1
Pilling grade evaluation
After determining these three parameters shown in Table 1 as the characteristic parameters of fabric pilling grade evaluation, the relationship between the characteristic parameter value and fabric pilling grade is established. This study adopts the method of finding the boundary value, which is the most commonly used but simple and effective. In other words, the fabric pilling grade can be determined according to the grade range in which the pilling characteristic parameters fall. The implementation process is as follows: the boundary value between the two fabric pilling grades is set to X, and the interpolation method can be used to figure out X. Take the calculation of the grade 1 and grade 2 rating threshold X as an example, and the specific formula is as follows:
When judging the fabric pilling grade, first obtain standard deviation of pill areas, pill density and pill number through the method introduced before, and then judge which range the value falls into in Table 2, so as to judge the anti-pilling performance of the fabric as several grades, which completes the automatic grade evaluation of fabric pilling.
The rating threshold of fabric pilling parameters.
Discussion
For comparative analysis, 10 groups of 50 fabric pilling images (Grade 1–5 fabric pilling images) as shown in Table 3 are rated by the fabric pilling rating system composed of three denoising methods mentioned in this study, and each grade corresponds to 10 images. Among them, 12 of the 50 images have obvious uneven illumination.
Ten groups of experimental images.
It can be seen from Table 4 that the accuracy of the fabric pilling evaluation based on the combination of wavelet analysis and Gabor filtering proposed in this study is 96%, which is higher than the first two. This is because wavelet analysis can not always effectively separate fabric texture and fabric pilling, and Gabor filtering does not consider fabric non-texture noise.
Comparison of evaluation results of fabric pilling grade.
However, there are still two images misjudged. The reason for the misjudgment is that the fabric contains small white areas (as shown in Figure 11(a)), and small bulges are raised due to the deformation of the fabric structure during use. The characteristics of small white areas and fabric bulges are similar to fabric pilling, which are misjudged as fabric pilling (as shown in Figure 11(b)), resulting in wrong evaluation.

Examples of algorithm failure: (a) the original pilled fabric and (b) the binary image of figure.
Conclusion
This study presented an effective way of removing noise from pilled fabric image based on wavelet transform and Gabor filter. The pilled fabric image is decomposed into different resolution sub images by wavelet transform, and the energy of each layer of wavelet multi-resolution decomposition is calculated. By the variation law of the energy, we can judge whether the fabric is rough or fine. And the reconstructed detail image
The experimental results show that the fabric pilling evaluation process proposed in this study is robust.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by Zhejiang Provincial Natural Science Foundation of China under Grant No. LY17F020034, and Zhejiang Province University Students’ scientific and technological innovation activity plan and new talent plan (2021R406035).
