A Method for the Assessment of Textile Pilling Tendency Using Optical Coherence Tomography

Pilling is caused by friction pulling and fuzzing the fibers of a material. Pilling is normally evaluated by visually counting the pills on a flat fabric surface. Here, we propose an objective method of pilling assessment, based on the textural characteristics of the fabric shown in optical coherence tomography (OCT) images. The pilling layer is first identified above the fabric surface. The percentage of protruding fiber pixels and Haralick’s textural features are then used as pilling descriptors. Principal component analysis (PCA) is employed to select strongly correlated features and then reduce the feature space dimensionality. The first principal component is used to quantify the intensity of fabric pilling. The results of experimental studies confirm that this method can determine the intensity of pilling. Unlike traditional methods of pilling assessment, it can also detect pilling in its early stages. The approach could help to prevent overestimation of the degree of pilling, thereby avoiding unnecessary procedures, such as mechanical removal of entangled fibers. However, the research covered a narrow group of fabrics and wider conclusions about the usefulness and limitations of this method can be drawn after examining fabrics of different thickness and chemical composition of fibers.


Introduction
Pilling arises as a result of mechanical factors during the day-to-day use of fabrics, mainly friction that occurs when the fabric rubs against another surface. Resistance to pilling is desirable from the points of view of both fabric durability and aesthetics. The main characteristic of pilling is the formation of small knots at the ends of protruding fibers, which negatively affect the appearance of fabrics. Pilling is generally considered to be a self-limiting process that occurs in several stages. Studies by Gintis and Mead [1] have demonstrated that pilling involves three distinct phases, the first two of which are connected with pill formation. First, the fibers are drawn to the fabric surface as a result of mechanical action, resulting in the formation of fuzz. The fuzz then becomes entangled into pills. The final stage is the loss of pills under continued mechanical action, such as rubbing, laundering, or drying. Cooke [2] supplements the description of the pilling process with more detailed intermediate steps.
After the establishment of a localized area of high fuzz density, he distinguishes a phase of developing entanglement within that area. The tangle is then compressed into a roughly spherical mass of fiber, anchored to the fabric by a few unbroken fibers. When the pills form, they are connected to the fabric. However, the anchoring fibers are subsequently pulled out due to abrasive forces. As a result, discrete mobile pills are formed. During further use of the fabric, some of the anchors may become fractured. This process proceeds until all the pills are shed.
In practice, the level of pilling should be specified according to the rates of the parallel processes, i.e., fiber entanglement leading to pill formation, the development of more surface fiber, and fiber and pill wear-off. The rates of these processes depend on the properties of the fiber, yarn, and fabric [1,3]. Extreme cases concern fabrics containing strong fibers and fabric containing weak fibers. In the case of fabrics with strong fibers, the rate of pill formation exceeds the rate of wear-off. This results in increased pilling, and an increase of wear. In the case of fabrics with weak fibers, the rate of pill formation competes with the rate of wear-off. This may result in variable pilling symptoms, and an increase of abrasion. There are other constructions in which surface fiber wear-off occurs before pill formation. Each of these examples demonstrates the complexity of evaluating surface changes on different types of fabric. Moreover, due to the action of the pilling motion, fabric surfaces contain pills of different size and fuzziness. Hence, to better understand the pilling process fabric surface variations need to be evaluated as a whole.
The assessment of pilling resistance carried out in textile laboratories relies on intensive, standardized abrasion of specimen surfaces with a brush, followed by a subjective quantitative assessment of the amount of abrasion or pilling, according to a five-grade rating scale (ASTM D 3511-08). Grade 5 corresponds to pilling-resistant material, while grade 1 indicates very severe pilling. Grade 3 indicates moderate surface pilling. According to PN-EN ISO 12945-2:2002, grade 3 is an acceptable rating for both woven fabrics and knitted fabrics after 2000 rubs. The same rating is acceptable according to PN-EN ISO 12945-1:2002 after 7200/14,400 revolutions. According to these standards, the tested samples should also be assessed in terms of the distribution of pills on the surface and the occurrence of other changes affecting the aesthetic values of the material (e.g., color change). Grading is usually performed in pilling assessment chambers, under an appropriate fluorescent light source. The sample is compared to a standard photograph or a reference sample to estimate the number of pills.
The disadvantages of this method include the approximate nature of the results and the risk of incorrect measurement due to the nature of the fabric. Pilling tests using standard abrasion methods do not take into account artifacts in the construction of the fabric, nor falsification of the results by pills detached due to prolonged rubbing.
To improve the quality and durability of textiles, many studies have attempted to identify pilling patterns automatically, by means of image processing technology. Some non-intrusive methods use 3D techniques, such as a laser profilometer [4] or high-resolution camera scanning system [5]. These techniques provide data on the roughness of the scanned surface, which may also be assessed in terms of pilling intensity. A three-dimensional fabric image obtained with a laser beam can also be analyzed to determine the number, area, and distribution of pills [4,6]. Recently, pilling assessment methods using thresholding algorithms [7,8], Fourier's analysis [9,10], and artificial intelligence [11,12] have become more popular both for two-and three-dimensional images.
This paper describes a new approach to assessing the pilling tendency of textiles, based on short-term abrasion tests. These abrasion tests do not tend to cause pills, but only lead to the early stage of fiber detachment. Using 3D images of the near-surface area of the textile after the test, the fibers protruding from knitwear are observed and analyzed. To detect the pixels of fiber objects, we apply the methods of image analysis to evaluate quantitative and textural indicators of pilling intensity. The surface of the knitwear is mapped by means of infrared light, which is emitted, penetrates the material, and is recorded after reflection from the surface based on the principles of optical coherence tomography (OCT) [13]. This technology is a powerful tool, which enables sensitive inspection of surfaces and fiber arrangements with ≈5 µm resolution. OCT is one of the most innovative and rapidly emerging optical imaging techniques in the last decades. Potential fields for OCT applications are steadily increasing through both numerous functional and contrast-enhanced [14] extensions of OCT and combining OCT into multi-modal optical systems [15]. For example, the combination of OCT, Raman spectroscopy and optoacoustic provides both morphological and molecular information from a target biological tissue [16]. All three modalities combined have the potential to provide a kind of non-invasive optical biopsy for skin cancer screenings in deeper lesions. OCT has recorded the most applications so far in medicine, especially in ophthalmology. Although ophthalmology is currently almost mainstream of OCT application, this technique is still being developed in this field [17] .
Chu et al. developed the ultrahigh-speed SS-OCT handheld system with a 2D micro-electromechanical system (MEMS) scanning mirror for ophthalmic retinal imaging [18]. Applications of 2D MEMS and OCT in real-time medical imaging were also investigated by Cogliati et al. [19].
Already highly established in medical applications, this non-destructive and contactless technique is being extensively investigated, at the moment, in material sciences for determining the microscopic properties, such as thickness, roughness, and surface profile of steel materials [20][21][22], laser-processed plastics [23] and composites [24,25]. Recently, OCT was implemented for recognition of weave patterns of fabrics [26,27].
Analysis of texture content in digital images plays an important role in the automated visual inspection of textile images. Such approaches are used mainly to assess the properties and quality of fabrics, including flaw detection [28] and surface structure [29]. The most popular method for quantitative assessment of texture is the use of Haralick features [30,31] . These features are calculated from a Gray Level Co-occurrence Matrix (GLCM), which counts the co-occurrence of neighboring gray levels in the image. Haralick texture features were originally defined for 2D images, but in this study we use spatial images of the pilling layer over the fabric surface, formed by pills and single, protruding fibers.

Fabric Material and Laser Processing
Three types of left-right weave knitted fabrics were tested to determine their pilling propensity. The first sample (F1) was a polyester textile of the single jersey type. The second fabric (F2) was a polyester-polyacrylonitrile knitwear known as Lacosta blue. The third textile was cotton-poliamid knitwear (F3). All the fabrics had a surface density of 240 g/m 2 .
The analyzed fabrics were characterized by high susceptibility to pilling. This tendency was observable as large amounts of entangled fibers clinging to the cloth surface, which appeared when the fabrics were worn as clothing. However, despite their common high pilling tendency, the fabrics were rated differently according to the ISO-12945-2-200 standard (Table 1). Some of the samples were subjected to laser modification, to reduce their tendency for pilling. Laser modification leads to the deposition of nanoparticles and nanocrystallinity, which bonds the fibers on the fabric surface [4]. The surfaces of the samples were modified by laser ablation at different laser powers, taking into account features of the fabric such as structure and color (Table 1). A 20 W single-mode optical fiber laser was used with a wavelength of 1.064 µm, manufactured by SPI (Southampton Photonics Inc.) Lasers company. Unmodified and modified knitwear was subjected to the same set of abrasion tests. The purpose was to determine the suitability of the proposed pilling indicators for various fabric cases. A laser pulse with a frequency 80 kHz was applied with a duration of 55 ns. The laser beam scanned the surface of the textile material at a speed of 400 mm/s with hatching 0.01 mm [32].

Abrasion Tests
We used a Martindale device ( Figure 1) [33] and the principles of forced pilling described in PN-EN ISO 12945-2:2002 and PN-EN 12947-1:2002. Samples with a diameter of 14 cm were mounted on a felt disk on the head of the device. A felt disc with the tested material placed on it was also mounted on an instrument table. The disc was moving at a constant speed. Tests were carried out under a load of 415 g (typical for fabric testing). The head moved relative to the stationary table along a Lissajous curve track. The samples were evaluated after 5000 head movements. Due to the subjective nature of the assessment, the samples were evaluated independently by three people according to ASTM D 3511-08. The presented results are the arithmetic averages of the partial grades given by the evaluators. To cause fiber protrusion, which precedes other typical symptoms of pilling in knitted and woven fabrics, each type of fabric material was manually rubbed using a rough surface for 15 s while maintaining a constant pressure. Two types of surfaces were used for fabric friction testing-a brush with hard fibers (Test 1) and an unglazed ceramic plate (Test 2). The pressure force of the friction surface on the material, controlled by a strain gauge, was set at 2 N Test 1 and 1 N for Test 2.
Immediately after the abrasion tests, the surface of the fabric was scanned in places subjected to abrasion using OCT, and the three-dimensional OCT images were archived for further numerical analysis of the pilling symptoms. After each test, five volumetric OCT images were made for each of 3 types of fabric without (F1, F2, F3) and for 3 types of fabric after laser treatment (F1 a , F2 a , F3 a ). Every fabric case (F1, F2, F3, F1 a , F2 a , F3 a ) was considered to be the untreated fabric (control one) and after 3 abrasion tests. The data set contained a total of 120 OCT images of the control and abrasion-tested fabrics.

Textile Image Acquisition and Pre-Processing
A Spark OCT-1300 image acquisition system by Wasatch Photonics Inc. [34] was used to register infrared spatial images of the measured fabric layer. A block diagram of the system is shown in Figure 2. The device consists of three main modules: an OCT Engine, an OCT Imaging Probe, and a Computational Engine. The OCT Engine contains a Michelson interferometer, electronics, a spectrometer, a reference arm, and polarization and path length controllers. The interferometer uses a low coherence broadband laser source and a spectrometer transmitting an image from diffraction grating typically for spectral domain OCT (SD-OCT). The engine emits an infrared laser beam centered at a wavelength of 1300 nm. The scanning depth can be calculated directly from the acquired Fourier transform spectra, without movement of the reference arm. The OCT Imaging Probe contains a light source, scanning mirror, optics, and a color camera for creating en-face images of the scanned region. The computational engine is a PC including a Camera Link card for acquiring data from the spectrometer and receiving synchronization triggers from the engine. Once the infrared laser light has penetrated the region of the textile fabric, the intensity of the signal reflected in the location (x, y, z) is stored in the form of a three-dimensional image array in the PC memory. Each image (volumetric data) covers a maximum volume 0.5 × 0.5 × 0.4 cm containing both the fabric layer and the pilling layer above it. This space corresponds to a raster of 512 × 512 × 640 voxels in the Cartesian coordinate system OXYZ. Any image voxel illustrated in Figure 2b has the dimensions equal to dx = 5.1 µm, dy = 4.8 µm and dz = 5.4 µm. In the experiments carried out, to limit the amount of data processed, low resolution images were acquired, where lateral resolutions are 2dx and 2dy. The scanning process provides B-scan frames (OXZ-planes) in real time and creates a full 3D image from these frames in off-line mode. The operation takes around 20 s. To simplify and accelerate the proposed algorithm, it is assumed that the scanning head is positioned so as to maintain the fabric layer in a horizontal orientation inside each B-scan.

Fabric and Pilling Layer Detection
The goal of the image processing algorithm is to extract the pilling fiber layer located above the fabric surface as a separated image. The pilling image is then subjected to textural analyses, providing quantitative indicators of the degree of pilling ( Figure 3). The algorithm is designed for the Python 3.6 environment working in a Windows 10 operational system [35,36].
Block 1 of the algorithm flowchart in Figure 3 shows the pre-processing step. The core fabric layer is extracted from the OCT image. Visible pilling fibers are suppressed using the concatenation of image opening and mean filtering operations. Pre-processing starts with the morphological opening presented in Equation (1) [35,37], where I is the processed OCT image, • is the symbol of the opening operation, S C denotes a cube-shaped structuring element with an edge length of 3 pixels. It is used for morphological noise removal and eliminates small objects to facilitate detection of the fabric layer L F . The opening is a concatenation of minimum and maximum low pass image filtering. The partial operations replace each image value I(x, y, z) by the minimum or maximum value found in the S C neighborhood of (x, y, z). As a result of the opening, small bright areas of the OCT image on a dark background are removed so as not to interfere with the detection of the fabric layer visible as a large horizontally located bright area. In the Python implementation, the opening was performed using the function skimage.morphology.opening(I, S C ), where S C = skimage.morphology.cube (3). Next, an averaging filter was applied to each B-scan, according to Equation (2): where W A is the local filtering window [5 × 5 × 1] pixels in X, Y, Z directions with the unit weights of each pixel. The convolution I * W A is executed in the Python script as scipy.ndimage.uni f orm_ f ilter(I, W A ). The OCT image filtering sequence given above exposes the core fabric layer, the location of which can be detected easily after thresholding to the binary image I B .
The proposed thresholding is performed globally with a threshold value of T 1 , obtained by the Otsu method [38] described in Equation (3): where I B denotes the resulting binary image, and T 1 is evaluated by the Python function skimage. f ilters.threshold_otsu(I). In each B-scan of the binary image I B , the searched fabric layer is represented by a single horizontal object with a different width or by the set of disjoint binary objects inside the horizontal band ∆z F , as illustrated in Figure 4.  To detect the middle line of the fabric layer L F in a B-scan, rare pilling fiber objects outside that layer should be omitted, while binary objects in the scope ∆z F that form the layer core should be included. The Hough transform [39] fulfills this requirement, when limited to the detection of a horizontal line in every XZ-plane. In the considered case, the Hough transform can be simplified to the form given in Equation (4).
The transform H(z) is smoothed by the averaging window W z to eliminate unwanted high frequency fluctuations over z. This facilitates detection of the fabric layer limit.
The filter in Equation (5) is implemented as a Python function scipy.ndimage.uni f orm_ f ilter() with a W z window 13 pixels wide. This pixel width was adjusted experimentally. Next, the fabric layer middle line position z 0 is determined as the average value H(z) according to Equation (6).
The upper limit of the fabric layer is determined in relation to H(z 0 ), as shown in Equation (7): where k = 0.3 is the ratio of H(z) reduction outside the fabric middle line, which was selected experimentally, z 2 is the maximum value in the set of z values that are less than z 0 and for which H(z) < kH(z 0 ). The z 2 horizontal line represents the upper limit of the fabric layer equal to the lower limit of the searched pilling layer. In all B-scans, the pilling layer has the same height ∆z P = z 2 − z 1 , selected experimentally for all tested fabrics. Therefore z 1 = z 2 − ∆z P is the value computed form z 2 and ∆z P . The set of regions ∆z P (y) in each B-scan y = 0, . . . , Y − 1 defines the cuboid of the pilling layer L P .
where z = z − z 1 . The above operations for separating layers correspond to block 2 of the algorithm in Figure 3. Figure 5 presents exemplary results of the processing stages discussed above. Figure 5b includes binarized B-scan obtained from the block 1 of the algorithm flowchart in Figure 3 with the detected knitwear surface line evaluated in the block 2, corresponding to the value z 2 in Equation (7). Figure 5c is the plot of H(z) for the binarized B-scan. Figure 5d contains the final result of the algorithm block 1 and 2-the limits z 1 and z 2 of the L P layer visible as dotted and continuous line respectively The next step of the algorithm is independent of pre-processing in the blocks 1 and 2 of the algorithm shown in Figure 3. It contains median filtering [40] of the input image I, expressed in Equation (9): where W M (p) denotes the cuboid window of dimensions [W X × W Y × W Z ] around each voxel p = (x, y, z) of the image I. This is a necessary step before pilling analysis, to reduce the speckle noise inherent in the content of OCT images. Filtering can be performed by a Python script with the function scipy.ndimage.median_ f ilter(), applying the local window [5 × 5 × 5] voxels.

Assessment of Pilling Layer Textural Features
The median filtered image I P of the layer L P above the fabric surface without pilling is composed almost exclusively of dark voxels, corresponding to a homogeneous air layer of constant and low density. In the presence of pilling, fibers projecting above the fabric surface are damp and dissipate the OCT infrared radiation, resulting in many areas of bright pixels in the image I P . The surfaces and numbers of these areas increase with the amount of migrating material, in the form of individual fibers or bundles of fibers. Therefore, a possible measure of the degree of pilling is the increase in the number of bright pixels in the image I P and the appearance of large changes in the brightness of adjacent pixels, which will imply changes in the image I P texture. The speckle noise errors are reduced by median filtering expressed in Equation (9).
The full OCT image J (with fabric and pilling layers), denoised by the local median in Equation (9), is binarized with a global brightness threshold in Equation (10), similarly to Equation (3): The computed Otsu threshold T 2 defines the fraction of pixels with brightness similar to the fabric layer. This corresponds to the outlying fibers of pilling in the L P layer. The fraction f P is evaluated as where z ∈ [z 1 (y), z 2 (y)] belongs to the layer L P and V P is the volume of the layer measured in voxels. The content of the pilling layer image L P is characterized by Haralick textural features [30,31]. The features are computed based on the gray level spatial dependence matrix (GLCM) at a distance of d image voxels. The features are averaged for 13 directions in an image space determined by side and diagonal neighborhood. Five features were selected to characterize pilling in the image I P : H 1 (Energy), H 2 (Contrast), H 4 (variance), H 5 (Homogeneity), and H 9 (Entropy).
where N g = 256 is the number of gray levels, and p(i, j) is (i, j) entry in a normalized GLCM defined for each pair of related voxels at a distance d = 2. According to the Haralick original paper [30] p(i, j) means the relative frequency with which two pixels separated by a pixel distance d in one of the space directions occur, one with intensity i and the other with intensity j. The energy feature H 1 of the GLCM is related to the brightness repeatability of associated pairs of voxels. The high value of H 1 in a uniformly dark image with no pilling fibers will decrease as the layer L P fills with the bright pixels of protruding fibers.
The feature H 2 defined in Equation (13) provides a measure of contrast or local intensity variation. It prefers contributions of p(i, j) located away from the GLCM diagonal, i.e., i = j. The H 2 contrast feature sums voxel pairs with constant differences in brightness levels, which are additionally weighted by the size of the differences. Its value increases in the presence of many white and black neighboring voxels around individual material fibers. The variance of voxel brightness co-occurrence is expressed by the H 4 feature, defined by Equation (14): where µ represents the average value of GLCM. The feature H 5 in Equation (15) provides a measure of the homogeneity in an intensity image. It returns a value that corresponds to the closeness of the distribution of elements in the GLC matrix to its diagonal.
Homogeneity H 5 is equal to 1 for a diagonal GLC matrix. The H 4 feature value increases and H 5 decreases with the variety of gray levels above the fabric surface accompanying the phenomenon of pilling. Another Haralick feature known as the sum average H 6 , used later in the article as an auxiliary property is described by the following relation: In Equation (16) p x+y (k) denotes the cumulative frequency of image pixel pairs with constant sum of intensities equal to k. H 6 is the average value of these cumulants for all possible intensity sums k = 2, 3, . . . , 2N g . Image entropy H 9 presented in Equation (17) takes small values for homogeneous scenes and greater values when the heterogeneity of the image brightness increases.
In the proposed algorithm, the function mahotas. f eatures.haralick(J P , distance = 2) computes the Haralick texture features in the three-dimensional image J P of the pilling layer L P . Because the values of some features may appear on a very different scale, they have been normalized for better comparison. The normalization transforms the feature components into random variables with zero mean and unit variance, using the formula given in Equation (18) [41]: where µ(H x ) and σ(H x ) are the sample mean and the sample standard deviation of the feature H x .
The H x sample set, for which the statistics µ and σ are computed, includes values either before or after any type of abrasion test is carried out. This emphasizes the feature changes resulting from fabric treatment. Principal component analysis (PCA) was applied to all textural data obtained from the samples, to reduce the high dimensionality of feature space while preserving the quantitative differentiation of the results for different levels of pilling [42]. Figure 6 provides a visual comparison of the textile samples subjected to abrasion using a Martindale instrument. The tests revealed varying degrees of textile pilling, depending on the types of fabric and surface pretreatment. As can be seen, the flock fibers of sample F1 were almost completely removed from the substrate fabric during the test cycle. Based on visual inspection, specialists assigned this fabric pilling grade 5. In the case of the other two example fabrics (F2 and F3), standardized friction tests resulted in the entanglement of fibers into balls over the fabric, along with residual free fibers. The cardinality of these phenomena corresponded to grade 2 and grade 2-3 of pilling, for fabrics F2 and F3 respectively. Modification of the fabric surface by laser ablation revealed fuzzing due to abrasion in fabric F1 and it caused a slight reduction in pill number in fabrics F2 and F3. Information on the pilling grades of these fabrics, including after laser ablation, is given in Table 1 (Section 2.1). Figure 7 shows example OCT images corresponding to cross-sections through the fabrics after the Martindale test and manual tests. The pilling symptoms in the OCT images usually appear in the form of white pixels, belonging to protruding fibers and pills.  As can be seen, the standard long-term pilling test did not result in pilling symptoms in the case of the knitwear sample F1, but manual short-term tests resulted in fiber detachment, i.e., the initial pilling phase, including an area of high fuzz density. In the cases of the other two fabrics (F2 and F3), the number of fiber pixels increased compared to the original fabric after both manual and machine abrasion tests. In the OCT images of these fabrics, after the Martindale test both pixels in formations (pills) and loose pixels forming fiber fuzz can be observed. Manual tests pulled the fibers above the fabric plane. Test 1, using a rough friction surface, caused both fuzz formation and the development of entanglement, while the less invasive Test 2 led only to the formation of fuzz. Tables 2 and 3 include the values of the voxel fraction f P and selected Haralick features for the pilling layer L P obtained as a result in step 4 and step 6 of the algorithm illustrated in Figure 3. In each abrasion test conducted in the experiment a fabric sample was imaged five times in various places under the same condition. Tables display the mean values of pilling measurements of the sample in the repeated tests.  In Table 3 only H 1 , H 2 , H 4 , H 5 , H 6 , H 9 textural features were cited from the set of all 13 calculated Haralick features. These features were chosen by the authors because their changes after abrasion tests can be predicted looking at the OCT images of the pilling layer as in Figure 7, or changes in their value have no significant relationship to the density of fibers in the pilling layer (H 6 ). According to the meaning of those features described by Equations (12)-(17), the contrast (H 2 ), variance (H 4 ) and entropy (H 9 ) should grow with the number of regions including neighboring bright and dark pixels. This takes place when many fibers pulled from the fabric layer by abrasion tests migrate to the L P layer. On the contrary, energy (H 9 ) or homogeneity (H 5 ) should then decrease because the L P layer brightness becomes uneven as can be seen in Figure 7.

Pilling Feature Analysis in OCT Images
The texture Haralick feature values were normalized according to Equation (18) to obtain comparable ranges for various features and prepare them for further processing. Figure 8 visualizes the changes of the selected features under different tests for a given fabric type (F1, F2 or F3). Considering a specific fabric type it is easy to see that the features H 2 , H 4 and H 9 change similarly under the influence of all proposed tests (T1, T2, AT). The same can be said about the behavior of H 1 and H 5 although they change in the opposite direction than the first group of features. Only the feature H 6 varies without any relation to the other. This suggests that all selected features except H 6 are correlated and can be approximately represented by one common pilling indicator. To reduce space dimensionality of the measured parameters and to verify correlation degree among original features PCA transform is applied. This operation reveals the internal structure of the data and best explains the variance in the data. It maps the features to a new coordinate system such that the greatest data variance lies on the first coordinate called the first principal component PC1, the second greatest variance on the second coordinate PC2, and so on.
The results of the PCA transformation projected on the plane of the first two components (PC1 − PC2) are shown in Figure 9 for a complete set Haralick features and f P feature, including also these not included in Tables 2 and 3. Sample data are presented there as the cloud of points, the vectors beginning at the origin of the coordinate system are factor loadings which represent original feature variables.
Most factor loadings of selected features are at a small angle to the PC1 axis, which confirms their high correlation and allows the representation of them using this component.  Figure 10. PC1 increases similarly to H 2 , H 4 , H 9 and f P when filling the layer L P with protruding fibers due to the partial detachment and pulling them out of the fabric layer after abrasion. The behavior of PC1 during tests carried out by the authors (T2, T1 and AT) is presented in Figure 11. The contribution of PC1 component in the textural feature vectors are reported in Table 4.   According to the description given in Section 2.2 of the article the manual test T1 is carried out using a higher pressure force and a rubbing surface with greater roughness than that used in T2, so the PC1 component after the test T1 achieves a higher value than in the case of the test T2 for the fabrics F1 and F2. The lowest PC1 value corresponds to the fabrics before test, which are not rubbed. The standard apparatus test AT gives lower PC1 values than T1. These results are confirmed by the observation of the relevant B-scans in Figure 7. The unexpectedly low values of PC1 for F1 fabric after the test AT are also confirmed by the lack of pills and protruding fibers inside of B-scan in the lowest row of Figure 7. All fiber formations in the L P layer formed during the test AT are finally detached, so this test is not reliable for pilling assessment.
The tested fabrics known as F1 a , F2 a and F3 a were subjected to laser ablation to change their surface properties and to reduce the pilling tendency. PC1 components of these ablated fabric types are shown in the bottom line of Figure 11. Laser modification can be seen to reduce PC1 compared to factory prepared surfaces, except for the fabric F3 with factory anti-pilling protection. PC1 values for fabric F1 a become very low because F1 is an easily ablated fabric that completely loses its pilling tendency after laser treatment. The F2 a fabric after surface laser ablation has mostly lower PC1 values than the corresponding values of F2 for the same types of pilling tests. However, only short-term tests, especially the T1 test, showed a change in the pilling tendency of these two fabrics. The PC1 values after apparatus test showed no significant changes in pilling compared to the state before laser modification, although experts have previously assessed that the quality of fabrics F2 a and F3 a has improved. The first component PC1 obtained after PCA transform of considered texture features in the fabric pilling layer can be used as a pilling measure for all types of tested fabrics.

Conclusions
This article has demonstrated, to the best of our knowledge, a new method for evaluating fabric pilling using the OCT imaging technique. Our approach allows improved observation and quantification of pilling in three dimensions, enabling pilling to be captured in the initial stage, even after a short period of low friction.
The most important feature of the proposed method is that the fuzzy mass of fiber is quantified objectively in three-dimensional OCT images, which will eliminate all errors related to subjective assessment by a man or uneven lighting of a fabric sample. The objective data can be obtained in the form of the proportion of protruding fibers or by using the texture parameters of the pilling layer. We have demonstrated that the texture variation accompanies different levels of pilling, and in addition, it can be expressed by means of one indicator. Thanks to the PCA transformation of selected Haralick features, together with fiber pixel fractions, a synthetic pilling index was obtained as the first principal component. This index can be used to objectively evaluate the degree of fabric pilling, although it requires comparative tests on a larger group of fabric samples as well as capture wide variation of pilling levels. Furthermore, the PC values could be similar, but not the same, for different groups of tests (various types of fabric, stitch construction, composition etc.). The proposed method may fail in the case of strongly reflecting material whose OCT image contains artifacts in the form of bright vertical streaks that prevent correct detection of pilling fibers. The algorithm of the method requires a much lower density of fibers (at least ten times) in the pilling layer than in the material layer so that the material layer can be detected correctly. The width of the pilling layer is determined arbitrarily by visual assessment of the upper limit of this layer in OCT images. Only protruding fibers forming structures wider than the OCT lateral resolutions 2dx and 2dy can be encountered as bright pilling voxels.
Current methods of fabric pilling assessment using expert knowledge or computer image analysis generally require intensive friction, using a pilling box, Martindale device, or the random tumble method to obtain pills on the tested fabric surface. The existing methods of pilling evaluation use mainly a flat material image, include no spatial information and require careful ambient lighting to obtain proper visibility of the pills by human or computer algorithms. It has been demonstrated that polyester fabrics may give a different picture of pilling trends as a result of different types of tests. It is due to the results of standardized tests do not always correlate well with end-use performance. These fabrics may lose pills under the influence of strong friction in the Martindale test and in this way the test result may be falsified. In this case, qualifying fabric as good quality is not allowed. In tests that detect and quantify pilling in the early stages, as proposed by us, it can be shown whether the fabric is more or less resistant to fiber detachment. Since these tests are short-term, they do not lead to mass detachment of fibers and pills. Therefore, these tests can be considered more reliable. Three-dimensional imaging of fabric surfaces using OCT offers a highly effective method for assessing pilling, due to the high resolution of the scans and the possibility of imaging individual fabric fibers, with the thickness above the device resolution limits. This technique may lead to a better understanding of the behavior of different textiles during normal use. As demonstrated, this OCT method is characterized by high sensitivity to the presence of fibers above the surface of the fabric, even when they do not appear after abrasion test, but naturally, as a result of habitual contact with other surfaces.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Abbreviations
The following abbreviations are used in this manuscript: