Three-Dimensional Reconstruction of Fleece Fabric Surface for Thickness Evaluation

Aiming at solving the problem of manually measuring the fabric surface thickness, this paper proposes a three-dimensional (3D) reconstruction method based on the tangential two-dimensional (2D) sequence images. Firstly, the characteristic region of the fabric surface is extracted. Secondly, the image is splitting based on the maximum between-class variance method. Thirdly, the splitting image is processed by the morphological method. Fourthly, the canny operator is used to obtain the edge detection for calculating the edge contour coordinate. Finally, the surf function is used to reconstruct the 3D model of the fabric surface. To evaluate the performance of the proposed 3D model, the thickness and relief degree of the fabric surface are used, and the comparison between the proposed method and the manual measurement is carried out. The results demonstrate that, under a reasonable relief degree condition, the proposed method is more effective to evaluate the thickness of the fabric surface and the estimated thickness is more accurate than the manually measured one.


Introduction
After the fabric is scratched, brushed, and brushed, it will produce soft and dense fleece on the surface. The fleece fabric has the advantages of keeping warm and blocking the sun, so the fleece fabric is widely used in textiles, such as clothing, blankets, toys and so on. However, the fleece covered on the fabric will affect the thickness of the fabric and limit the quality of the products made by the fabric. At present, the method for detecting the surface quality of fleece fabrics relies on experts to judge by naked eyes and touch [1][2][3]. Because this method is very time consuming and requires a lot of work pressure, and the physical condition of the testing experts will affect the test results, it is extremely necessary for the automatic detection of the surface quality of the fleece fabric [4].
Textile surface quality testing can be divided into 2D and 3D testing of fleece fabric surface quality. In two dimensions, Jasinska [5] has used a grating method to analyze the two-dimensional image of the fleece surface of the knitted fleece pilling fabric on a computer, and calculated the surface pilling status of the fleece fabric. Jin [6,7] has used the seed segmentation method and the Mean shift method to segment the fabric fleece balls on the fleece fabric image. Sarraft [8] has researched the fabric defect detection system on the loom and he has used wavelet decomposition on the image to identify the fabric surface defects. Chi [9] has used Fourier to detect defects on the fabric surface. Uster's Fabriscan automatic cloth inspection system has used neural network methods to detect defects on the fabric surface [10]. It can be seen that the two-dimensional detection technology is relatively mature. Many devices for detecting defects on the fabric surface have entered the market. However, the fleece fabric is actually a 3D structure, and the two-dimensional detection method will lose part of the fleece information, especially the lack of depth information [11]. At present, it has become a research central issue to realize the quality inspection of fabric surface in three dimensions.
In three dimensions, Kang [12] has used laser line scanning technology to obtain a 3D image of the fabric surface and has successfully obtained useful information, such as the number and area of hair balls on the fabric surface. Yu [13] has used the method of micro-section to obtain the depth sequence images of the fabric surface under different focus and has completed the 3D reconstruction of the fabric surface to get the depth information of the hair balls on the fabric surface. Kim [14] has applied 3D point cloud processing technology to 3D images and used this technology to evaluate the fabric pilling performance. Tilocca [15] has used a laser sensor to obtain the surface image of the fleece fabric, and then input the transformed 3D contour data of the fabric into the neuron, and has used the BP neural network to identify the defects on the surface of the fabric. Ouyang [16] has studied the 3D surface of the fabric and successfully detected the pilling and wrinkling properties of the fabric. Saharkniz has used a contactless laser triangulation scanner to separate the hair balls from the fabric surface and texture [17]. In addition, many other fields with dissimilar features have also studied a large number of 3D reconstruction techniques and applications. For example, Taylor [18], Ems-Mcclung [19] and Deng [20] used 3D reconstruction technology in the medical field. Donnelly [21] used 3D reconstruction technology in the field of physics. He [22], Udayan [23] and others used 3D reconstruction technology in the engineering field. In summary, the 3D shape reconstruction can effectively obtain the depth information of the fabric surface, and it can also describe the information such as fleecing and pilling on the fabric surface. However, some defects on the surface of the pile fabric will affect the thickness of the fabric, and 3D topography scanning requires equipment such as an electron microscope. They are not only expensive, but this is an offline measurement. At present, the online thickness measurement is rarely reported in literature.
For the online measurement of the thickness of fleece fabrics, we used a tangential scanning two-dimensional imaging method and realized a 3D reconstruction of the fabric surface. First of all, this experiment relies on the principle of light-cut imaging. Through these principles, you can get the tangent graph of the fleece fabric, which is processed to obtain the contour curve of the upper edge of the fleece fabric. We obtain the 3D contour of the upper surface of the fleece by constructing a multi-dimensional array and using MATLAB software. In the vertical direction, the tangential image of the roller is used as a reference to establish the thickness parameter model of the fleece fabric; in the horizontal direction, the least squares of the upper surface of the fleece are used as the reference and the parameter model of the fleece undulation is constructed. Finally, we obtain the thickness, undulation and other information through the 3D reconstruction of the fleece, and compare it with the manual measurement results.

Bench Tester
The experimental platform used in this experiment is shown in Figure 1a. The used fleece fabric is wrapped on the transmission belt, and its size is 310 mm × 180 mm (L × H). Its movement is based on 57 stepper motors, and its speed is adjusted by the controller. Its speed range is between 0 and 1000 r/min; the visual acquisition system of this experiment uses Daheng Mercury MER-502-79U3M POL, this industrial camera is produced by Beijing Daheng Image Vision Co., Ltd., China. The rate is 79 fps; the lens of this experiment uses a Computar lens, and its focal length is 25 mm; the light source of this system is a strip-shaped LED light source, which can ensure the uniformity of brightness and illumination direction; the resolution of the image is 2048 * 2048; the experiment uses the camera's own image acquisition software, which has an object resolution of K = 0.0329 mm/pixel, and the image processing system is completed by Matlab2016. During the experiment, the acquisition frequency of the camera was 10 Hz, and the picture was stored in the PC; the translation speed of the fleece fabric to be tested was 3.263 m/s. Electronics 2020, 9, x FOR PEER REVIEW 3 of 12 and the image processing system is completed by Matlab2016. During the experiment, the acquisition frequency of the camera was 10 Hz, and the picture was stored in the PC; the translation speed of the fleece fabric to be tested was 3.263 m/s. The working principle diagram of this experiment is shown in Figure 1b. The tested fabric is laid flat on the conveying device. The light source is placed under the roller. The industrial camera and the light source are installed on both sides of the tested fabric. They form a backlight image. Avoid interference by the surface texture and color characteristics of the tested fabric, and highlight the edge contour characteristics.
In Figure 1c, the background and base fabric area in it takes up a large area; however, the fleece area occupies a small part. We select the middle part of the white dashed line in the figure as the feature area. In order to ensure the integrity of the fleece area, and to intercept the rectangular image with the fleece area as the symmetry axis and the pixel size of 2048 * 300 as the feature area, in order to reduce the calculation amount. In this area, the thickness of the fleece is displayed in the vertical direction, and the distribution state is displayed in the horizontal direction.

2D Image Processing
In order to realize the 3D reconstruction of the surface of the fleece fabric, the surface outline of a single frame of fleece fabric needs to be extracted and the feature regions are pre-processed to improve the contrast of the image, as shown in Figure 2a. Based on the gray histogram features of the fleece region, the image is segmented using the maximum inter-category variance method [24] to separate the fluff region from the background, as shown in Figure 2b. Then, Figure 2b is opened and closed through the morphological method [25]. By constructing linear structural elements to compensate for defects such as holes and surface stray hairs in the fleece region in Figure 2b, a complete fleece region will be obtained, as shown in Figure 2c. Through the above image processing, a fluff image with clear edge contour can be obtained. Subsequently, in order to better extract the edge curve of the fluff image, the Canny operator [26] is used to detect the edge contour of the fleece fabric and obtain the edge contour boundary of the fleece fabric, as shown in Figure 2d. Finally, the chain contour principle [27] is used to extract the edge contour coordinate points in the image to obtain the edge contour curve on the fleece fabric, as shown in Figure 2e. Since the default matrix is in the origin of the coordinate system in MATLAB, the resulting curve is a mirror image of the actual curve. The working principle diagram of this experiment is shown in Figure 1b. The tested fabric is laid flat on the conveying device. The light source is placed under the roller. The industrial camera and the light source are installed on both sides of the tested fabric. They form a backlight image. Avoid interference by the surface texture and color characteristics of the tested fabric, and highlight the edge contour characteristics.
In Figure 1c, the background and base fabric area in it takes up a large area; however, the fleece area occupies a small part. We select the middle part of the white dashed line in the figure as the feature area. In order to ensure the integrity of the fleece area, and to intercept the rectangular image with the fleece area as the symmetry axis and the pixel size of 2048 * 300 as the feature area, in order to reduce the calculation amount. In this area, the thickness of the fleece is displayed in the vertical direction, and the distribution state is displayed in the horizontal direction.

2D Image Processing
In order to realize the 3D reconstruction of the surface of the fleece fabric, the surface outline of a single frame of fleece fabric needs to be extracted and the feature regions are pre-processed to improve the contrast of the image, as shown in Figure 2a. Based on the gray histogram features of the fleece region, the image is segmented using the maximum inter-category variance method [24] to separate the fluff region from the background, as shown in Figure 2b. Then, Figure 2b is opened and closed through the morphological method [25]. By constructing linear structural elements to compensate for defects such as holes and surface stray hairs in the fleece region in Figure 2b, a complete fleece region will be obtained, as shown in Figure 2c. Through the above image processing, a fluff image with clear edge contour can be obtained. Subsequently, in order to better extract the edge curve of the fluff image, the Canny operator [26] is used to detect the edge contour of the fleece fabric and obtain the edge contour boundary of the fleece fabric, as shown in Figure 2d. Finally, the chain contour principle [27] is used to extract the edge contour coordinate points in the image to obtain the edge contour curve on the fleece fabric, as shown in Figure 2e. Since the default matrix is in the origin of the coordinate system in MATLAB, the resulting curve is a mirror image of the actual curve.

3D Image Reconstruction
Traditional 3D reconstruction methods usually use laser scanning equipment to scan the surface of the object or to fit the cross-sectional images of many object surfaces and use these to restore the 3D shape of the object surface [28][29][30]. This experiment fits many continuous fleece fabric tangential graphs from the perspective of slitting. The acquisition time of the experiment is 10 s, and the acquisition distance is 32.63 mm/s. The method used in this article is this. First, we construct a multidimensional array, which is called a 3D voxel matrix M, and then use the surf function in MATLAB software to build model. As shown, Figure 3 is a 3D reconstruction of fabric surface. As can be seen from Figure 3, the figure reflects the thickness deviation of the fleece area in the z-axis direction and reflects the difference in the tangential graphs of the fleece fabrics collected at different frame numbers in the x and y-axis directions. To evaluate the thickness of the fleece fabric, the thickness parameter needs to be constructed in the z-axis direction. In addition, in order to reflect

3D Image Reconstruction
Traditional 3D reconstruction methods usually use laser scanning equipment to scan the surface of the object or to fit the cross-sectional images of many object surfaces and use these to restore the 3D shape of the object surface [28][29][30]. This experiment fits many continuous fleece fabric tangential graphs from the perspective of slitting. The acquisition time of the experiment is 10 s, and the acquisition distance is 32.63 mm/s. The method used in this article is this. First, we construct a multi-dimensional array, which is called a 3D voxel matrix M, and then use the surf function in MATLAB software to build model. As shown, Figure 3 is a 3D reconstruction of fabric surface.

3D Image Reconstruction
Traditional 3D reconstruction methods usually use laser scanning equipment to scan the surface of the object or to fit the cross-sectional images of many object surfaces and use these to restore the 3D shape of the object surface [28][29][30]. This experiment fits many continuous fleece fabric tangential graphs from the perspective of slitting. The acquisition time of the experiment is 10 s, and the acquisition distance is 32.63 mm/s. The method used in this article is this. First, we construct a multidimensional array, which is called a 3D voxel matrix M, and then use the surf function in MATLAB software to build model. As shown, Figure 3 is a 3D reconstruction of fabric surface. As can be seen from Figure 3, the figure reflects the thickness deviation of the fleece area in the z-axis direction and reflects the difference in the tangential graphs of the fleece fabrics collected at different frame numbers in the x and y-axis directions. To evaluate the thickness of the fleece fabric, the thickness parameter needs to be constructed in the z-axis direction. In addition, in order to reflect As can be seen from Figure 3, the figure reflects the thickness deviation of the fleece area in the z-axis direction and reflects the difference in the tangential graphs of the fleece fabrics collected at different frame numbers in the x and y-axis directions. To evaluate the thickness of the fleece fabric, the thickness parameter needs to be constructed in the z-axis direction. In addition, in order to reflect the difference of different fleece fabrics, the construction of the undulation parameter is in the x and y-axis directions.

Surface Quality Estimation
First of all, this experiment needs to set the datum. When calculating the thickness of the fleece fabric, the plane where the axial tangent of the roller is located is used as the reference plane, as shown in Figure 4. In order to obtain the thickness of the fleece fabric, the experiment uses the cut surface l2 of the roller as the thickness reference line of the fleece fabric. Then, the difference between the upper edge profile curve l1 of the fleece and the reference line is calculated, and the calculation result is the thickness curve L of the fleece fabric. As shown in Figure 2e, the green dotted line in the figure is the thickness reference line of the fleece fabric.
Electronics 2020, 9, x FOR PEER REVIEW 5 of 12 the difference of different fleece fabrics, the construction of the undulation parameter is in the x and y-axis directions.

Surface Quality Estimation
First of all, this experiment needs to set the datum. When calculating the thickness of the fleece fabric, the plane where the axial tangent of the roller is located is used as the reference plane, as shown in Figure 4. In order to obtain the thickness of the fleece fabric, the experiment uses the cut surface l2 of the roller as the thickness reference line of the fleece fabric. Then, the difference between the upper edge profile curve l1 of the fleece and the reference line is calculated, and the calculation result is the thickness curve L of the fleece fabric. As shown in Figure 2e, the green dotted line in the figure is the thickness reference line of the fleece fabric. ( , ) f x y a bx cy = + + , Calculate the model coefficients a, b, and c according to the principle of least squares and substitute them into Equation (1) to obtain the least squares plane equation of a certain point.

Modelling of Fabric Thickness
According to the principle of measuring the thickness of a fleece fabric, it can be known that the difference between the distance from each point of the upper edge contour of the fleece to the reference line and the thickness of the fabric is the thickness of the fleece. Let us assume the upper edge curve of the fleece to be g(x, y) and the reference line to be t(x, y), then the change curve of the fleece thickness L(x, y) is: The average thickness of fleece fabric ( ) , h x y is: where n is the number of edge points and K is the object surface resolution.
The thickness of the fleece area ( ) , h x y is characterized by the average thickness. The larger the value is, the thicker the fleece area is and the thinner the fleece fabric is. The obtained graph of the thickness variation of the fleece fabric is shown in Figure 5. f (x, y) = a + bx + cy, Calculate the model coefficients a, b, and c according to the principle of least squares and substitute them into Equation (1) to obtain the least squares plane equation of a certain point.

Modelling of Fabric Thickness
According to the principle of measuring the thickness of a fleece fabric, it can be known that the difference between the distance from each point of the upper edge contour of the fleece to the reference line and the thickness of the fabric is the thickness of the fleece. Let us assume the upper edge curve of the fleece to be g(x, y) and the reference line to be t(x, y), then the change curve of the fleece thickness L(x, y) is: The average thickness of fleece fabric h(x, y) is: where n is the number of edge points and K is the object surface resolution. The thickness of the fleece area h(x, y) is characterized by the average thickness. The larger the value is, the thicker the fleece area is and the thinner the fleece fabric is. The obtained graph of the thickness variation of the fleece fabric is shown in Figure 5.

Parametric Model of Undulation Degree of Fabric Surface
The undulating surface l(x, y, z) of the fleece fabric can be expressed as: The expression of Equation (5) is: In this formula, S is the orthographic projection of the sampling area on the reference plane, and Gq is the standard deviation of the points on the surface profile of the fleece. Gq can indicate the degree of the contour of the upper edge of the fleece deviating from the reference plane, that is the degree of fluctuation of the surface contour of the fleece. The smaller the profile fluctuation of the fleece surface, the flatter the fleece surface, and the better the fleece coverage.  The details of the 2D results are shown in Appendix A, and the 3D reconstruction results about the fabric thickness estimation with five samples are shown in Figure 7. In these figures, the red plane represents horizontal reference plane, and the actual surface thickness curve is below the red plane due to the mirror reconstruction.

Parametric Model of Undulation Degree of Fabric Surface
The undulating surface l(x, y, z) of the fleece fabric can be expressed as: The expression of Equation (5) is: In this formula, S is the orthographic projection of the sampling area on the reference plane, and G q is the standard deviation of the points on the surface profile of the fleece. G q can indicate the degree of the contour of the upper edge of the fleece deviating from the reference plane, that is the degree of fluctuation of the surface contour of the fleece. The smaller the profile fluctuation of the fleece surface, the flatter the fleece surface, and the better the fleece coverage.

Parametric Model of Undulation Degree of Fabric Surface
The undulating surface l(x, y, z) of the fleece fabric can be expressed as: The expression of Equation (5) is: In this formula, S is the orthographic projection of the sampling area on the reference plane, and Gq is the standard deviation of the points on the surface profile of the fleece. Gq can indicate the degree of the contour of the upper edge of the fleece deviating from the reference plane, that is the degree of fluctuation of the surface contour of the fleece. The smaller the profile fluctuation of the fleece surface, the flatter the fleece surface, and the better the fleece coverage.  The details of the 2D results are shown in Appendix A, and the 3D reconstruction results about the fabric thickness estimation with five samples are shown in Figure 7. In these figures, the red plane represents horizontal reference plane, and the actual surface thickness curve is below the red plane due to the mirror reconstruction. The details of the 2D results are shown in Appendix A, and the 3D reconstruction results about the fabric thickness estimation with five samples are shown in Figure 7. In these figures, the red plane represents horizontal reference plane, and the actual surface thickness curve is below the red plane due to the mirror reconstruction.   According to the two-dimensional data table as shown in Table A1, the fabric thickness estimation table is obtained as shown in Figure 8. From Figure 8, the thickness of the fabric surface of the samples is 4.36, 3.49, 3.08, 4.52 and 4.27 mm, respectively. The order of thickness about the variance is a > e > c > d > b.

Discussions
The thickness of the five samples is measured by the manual micrometer. The results are compared with the 3D reconstruction thickness of the fleece fabric. The relief degree is used to explain the impact of the measurement and estimation. The comparison results are shown in Table 1. As can be seen in Table 1, the estimated thickness of the fabric surfaces is larger than the measured values. This is caused by the characteristics of different evaluation methods. The manually measured method adopts the micrometer to obtain the thickness, in which process each fabric surface is pressed to lead the villi clinging to the surface. The proposed estimation method adopts the 3D reconstruction technology to obtain the thickness based on the tangential 2D images, and, in this process, the villi of the fabric surface will be extended. The extended status may be more realistic than the pressed status. In addition, the error between the estimated and measured thickness is 28.9%, 15.2%, 10.4%, 28.1% and 15.5%, respectively. As can be seen, the error increases with the increasing of the relief degree. This means that the villi status significantly affects the evaluation of the thickness.
The relationship between the error and relief degree is shown in Figure 9. One can note that, with a reasonable relief degree, the error between the estimated and measured thickness is acceptable. However, in mass production, it is difficult/impossible to measure the fabric surfaces manually using labors, while the proposed estimation method is able to perform real-time monitoring of the fabric surfaces. As a result, the proposed 3D reconstruction method can solve the labor problem in fabric surface measurement and has significant practical importance. According to the two-dimensional data table as shown in Table A1, the fabric thickness estimation table is obtained as shown in Figure 8. From Figure 8, the thickness of the fabric surface of the samples is 4.36, 3.49, 3.08, 4.52 and 4.27 mm, respectively. The order of thickness about the variance is a > e > c > d > b.

Discussion
The thickness of the five samples is measured by the manual micrometer. The results are compared with the 3D reconstruction thickness of the fleece fabric. The relief degree is used to explain the impact of the measurement and estimation. The comparison results are shown in Table 1. As can be seen in Table 1, the estimated thickness of the fabric surfaces is larger than the measured values. This is caused by the characteristics of different evaluation methods. The manually measured method adopts the micrometer to obtain the thickness, in which process each fabric surface is pressed to lead the villi clinging to the surface. The proposed estimation method adopts the 3D reconstruction technology to obtain the thickness based on the tangential 2D images, and, in this process, the villi of the fabric surface will be extended. The extended status may be more realistic than the pressed status. In addition, the error between the estimated and measured thickness is 28.9%, 15.2%, 10.4%, 28.1% and 15.5%, respectively. As can be seen, the error increases with the increasing of the relief degree. This means that the villi status significantly affects the evaluation of the thickness.
The relationship between the error and relief degree is shown in Figure 9. One can note that, with a reasonable relief degree, the error between the estimated and measured thickness is acceptable. However, in mass production, it is difficult/impossible to measure the fabric surfaces manually using labors, while the proposed estimation method is able to perform real-time monitoring of the fabric surfaces. As a result, the proposed 3D reconstruction method can solve the labor problem in fabric surface measurement and has significant practical importance. As can be seen, the proposed method is very practical for many real-world applications where 3D reconstruction is required, such as the 3D scaffold construction and 3D printer. A camera is simply used in these applications to provide an online measurement of the 3D images. As a result, the proposed method can offer a more effective and efficient alternative for real-world applications of 3D scaffold construction and 3D printer.

Conclusions
A 3D reconstruction method is proposed in this paper to estimate the fabric surface thickness. The proposed 3D reconstruction is based on the 2D image processing; with the aid of Canny operator, the edge contour coordinate of the 2D image can be obtained to reconstruct the 3D image of the fabric surface. Because the proposed method does not require expensive 3D image sensors and costly 3D reconstruction software, it is very efficient and practical for real-world applications. Experimental validation has been performed to evaluate the performance of the proposed method. The analysis result demonstrates that the proposed 3D reconstruction method is able to produce comparable estimation accuracy of the fabric surface thickness as the traditional manual measurement method. Hence, the proposed method can realize the automation of the manufacturing of fabric surface production. The future plan will apply the proposed method in field test and practical application.   As can be seen, the proposed method is very practical for many real-world applications where 3D reconstruction is required, such as the 3D scaffold construction and 3D printer. A camera is simply used in these applications to provide an online measurement of the 3D images. As a result, the proposed method can offer a more effective and efficient alternative for real-world applications of 3D scaffold construction and 3D printer.

Conclusions
A 3D reconstruction method is proposed in this paper to estimate the fabric surface thickness. The proposed 3D reconstruction is based on the 2D image processing; with the aid of Canny operator, the edge contour coordinate of the 2D image can be obtained to reconstruct the 3D image of the fabric surface. Because the proposed method does not require expensive 3D image sensors and costly 3D reconstruction software, it is very efficient and practical for real-world applications. Experimental validation has been performed to evaluate the performance of the proposed method. The analysis result demonstrates that the proposed 3D reconstruction method is able to produce comparable estimation accuracy of the fabric surface thickness as the traditional manual measurement method. Hence, the proposed method can realize the automation of the manufacturing of fabric surface production. The future plan will apply the proposed method in field test and practical application.