Fabric defect visual inspection method and system for weaving apparatus

By acquiring the process parameters of the weaving equipment to calculate the normal vector and texture feature distribution of the fabric, and combining it with multi-scale detection methods, the adaptability problem of visual inspection of fabric defects when switching fabric varieties is solved, realizing high-precision real-time detection and low-cost defect identification.

CN123175952APending Publication Date: 2026-11-27ZHEJIANG QIHUI ELECTRONIC JACQUARD CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611636815.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-22
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing visual inspection technologies for fabric defects require the re-collection of standard sample photos when switching fabric types, which is time-consuming and costly. Furthermore, machine learning-based methods are not effective in detecting rare defect types and are difficult to adapt to frequently changing production scenarios.

Method used

By acquiring the process parameters of the weaving equipment, calculating the normal vector distribution and expected texture feature distribution of the fabric surface, and combining lighting and imaging parameters, multi-scale abnormal area detection is achieved. Defect areas are determined by integrating local statistical features, reducing the bottleneck of adaptability to physical objects and improving detection accuracy.

Benefits of technology

It enables real-time detection during fabric variety switching, reducing downtime and labor costs, improving the accuracy and reliability of defect detection, and effectively suppressing false detections due to random noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123175952A_ABST
    Figure CN123175952A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of visual detection, and discloses a fabric defect visual detection method and system for a weaving device. The application obtains process parameters of corresponding fabric from the weaving device, determines the sink-and-float relationship of warp and weft yarns and calculates the normal vector distribution of the fabric surface, calculates the expected texture feature distribution of the fabric according to illumination parameters and imaging parameters, and determines the prediction uncertainty distribution according to the fluctuation range of the process parameters. During the operation of the weaving device, the actual image of the fabric surface is obtained, the actual texture feature distribution is extracted, the feature deviation is calculated position by position with the expected texture feature distribution, the deviation significance map is determined according to the prediction uncertainty distribution, and the significance degree of the actual deviation relative to the prediction accuracy of the position is reflected. The multiscale abnormal area detection is used to determine the defect area, effectively suppresses single-scale false detection, and retains the detection capability for defects of different scales.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual inspection technology, specifically to a method and system for visual inspection of fabric defects in weaving equipment. Background Technology

[0002] Existing visual inspection technologies for fabric defects are based on comparison with standard samples. Before switching fabric types, a batch of defect-free fabric images are manually identified and collected as standard samples. During the inspection process, the actual collected fabric images are compared with the standard samples pixel by pixel or region by region, and the defect area is identified by calculating the degree of difference between the two. However, whenever the weaving equipment changes fabric types, the original standard samples are no longer applicable, and it is necessary to collect new standard samples for the new type. In production scenarios with frequent fabric type changes, repeatedly collecting standard samples not only consumes a lot of downtime and labor costs, but also the quality of the collected standard samples is greatly affected by the operator's experience, which directly affects the reliability of subsequent inspections.

[0003] There is also data-driven machine learning detection, which collects a large number of fabric image samples containing various defects and uses algorithms such as deep learning to train defect classification and detection models. During the detection process, the actual image is input into the trained model, and the model outputs the category and location of the defect. This method has achieved a significant improvement in defect classification accuracy. However, the generation of fabric defects is random and accidental. Some rare defect types occur very infrequently in actual production, making it difficult to collect enough training samples, resulting in insufficient detection ability of the model for these types of defects. When the fabric variety changes, the detection performance of the original model will drop significantly because the texture features of the new variety are different from those in the training data. Usually, it is necessary to collect samples again for the new variety and retrain the model, which is time-consuming and uncontrollable.

[0004] Based on the analysis and shortcomings of the existing technology, the technical problem to be solved in this application is how to achieve real-time visual detection of fabric defects with different structural complexities and improve the detection accuracy. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, the purpose of this application is to provide a method and system for visual inspection of fabric defects in weaving equipment, so as to achieve high-precision visual inspection of fabric defects.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] In a first aspect, this application provides a method for visual inspection of fabric defects in weaving equipment, including:

[0008] The process parameters of the fabric corresponding to the weaving equipment are obtained to determine the relationship between the warp and weft yarns and calculate the normal vector distribution of the fabric surface. The expected texture feature distribution of the fabric is calculated based on the lighting parameters and imaging parameters. The prediction uncertainty distribution is determined based on the fluctuation range of the process parameters.

[0009] During the operation of the weaving equipment, the actual image of the fabric surface is acquired and the corresponding actual texture feature distribution is extracted;

[0010] The feature deviation between the actual texture feature distribution and the expected texture feature distribution is calculated position by position, and the deviation significance map is determined after normalization based on the prediction uncertainty distribution.

[0011] Multi-scale anomaly detection is performed on the deviation significance map. Defects are determined based on the local statistical features of each scale, and the determination results of different scales are fused to output the defect area.

[0012] Furthermore, the process parameters include weave diagram, warp density, weft density, and yarn parameters, and the calculation of the expected texture feature distribution of the fabric includes:

[0013] The lifting height of the upper yarn relative to the lower yarn at each interlacing point is determined based on the sinking and floating relationship of the warp and weft yarns, and the spacing between adjacent interlacing points is determined by combining the warp density and weft density. The buckling waveform of the warp and weft yarns in the fabric is then calculated.

[0014] The three-dimensional geometry of the fabric surface is constructed by sweeping along the buckling waveform with the cross-sectional shape of the yarn. The three-dimensional geometry is then discretized and sampled to obtain the normal vector distribution of the fabric surface.

[0015] Based on the normal vector distribution, the incident angle and reflection angle at each sampling point on the fabric surface are calculated by combining the lighting parameters and imaging parameters. The light intensity reflected to the camera direction at each sampling point is calculated by combining the reflection characteristics of the yarn material in the yarn parameters, so as to obtain the reflected light intensity distribution on the fabric surface.

[0016] By combining imaging parameters to perform imaging degradation processing on the reflected light intensity distribution, the expected fabric image is obtained, and the expected texture feature distribution is obtained after extracting texture features.

[0017] Furthermore, the relationship between the sinking and floating of the warp and weft yarns is obtained by determining the positional relationship of the warp and weft yarns at each interlacing point based on the weave diagram, and the lifting height is determined based on the cross-sectional shape of the lower yarn at the corresponding interlacing point;

[0018] The sweeping along the buckling waveform with the cross-sectional shape of the yarn involves sweeping through the natural cross-sectional shape of the yarn in the non-interlacing area, and determining the compressed cross-sectional shape in the interlacing area based on the compression relationship between the warp and weft yarns, and then using the compressed cross-sectional shape to replace the natural cross-sectional shape for sweeping.

[0019] Furthermore, the determination of the prediction uncertainty distribution is obtained by determining the variation range of the expected texture features at each sampling point due to the fluctuation range of process parameters.

[0020] Furthermore, the extraction of the corresponding actual texture feature distribution includes:

[0021] Based on the weave diagram, the repeating units of the fabric weave structure are determined, and the warp and weft dimensions of the repeating units, as well as the actual directions of the warp and weft, are determined in combination with the warp density and weft density.

[0022] The dimensions of the extraction window are determined by the warp and weft dimensions, and the actual directions of the warp and weft are determined by the direction of the extraction window.

[0023] Within each extraction window, the window area is divided into a warp tissue point area, a weft tissue point area, and a cross transition area according to the tissue diagram;

[0024] The actual image is divided into windows according to the extraction window, and the corresponding local texture features are extracted in each window area. The actual texture feature distribution is obtained by combining them according to their spatial location.

[0025] Furthermore, the determination of the deviation significance map includes:

[0026] The deviation value of each feature component between the actual texture feature distribution and the expected texture feature distribution is calculated position by position to obtain the feature deviation;

[0027] Divide the feature bias by the prediction uncertainty at the corresponding position to obtain the significance of the bias of each feature component after normalization;

[0028] The deviation significance of each feature component at each location is synthesized to obtain the deviation significance at the corresponding location. The deviation significance of each location is arranged according to spatial position to obtain the deviation significance map.

[0029] Furthermore, the step of calculating the deviation value of each feature component position by position is to calculate the absolute value of the difference between the actual texture feature and the expected texture feature at the same position and the same feature component.

[0030] The process of synthesizing the deviation significance of each feature component at each position involves taking the maximum value of the deviation significance among the normalized feature components as the deviation significance at the corresponding position.

[0031] Furthermore, the output defect region includes:

[0032] The scale is determined based on the process parameters. At each scale, the deviation significance map is traversed by a sliding window of the corresponding scale size. The local statistical characteristics of the deviation significance within the sliding window are calculated to determine the significance threshold.

[0033] When the deviation within the sliding window is greater than the significance threshold, the corresponding position is identified as a candidate defect at the corresponding scale.

[0034] Check the detection results of each candidate defect at different scales. When a candidate defect is detected at both different scales, the corresponding location is confirmed as a defect area; otherwise, it is removed.

[0035] Furthermore, the determination of scale based on process parameters is to determine the fine scale by the cross-sectional dimensions in the yarn parameters, the medium scale by the dimensions of the repeating units in the weave diagram, and the coarse scale by the combined dimensions of multiple repeating units.

[0036] The local statistical features include the local mean and the local standard deviation. The significance threshold is the product of the sensitivity coefficient corresponding to the scale and the local standard deviation, plus the local mean. The sensitivity coefficient corresponding to the scale increases linearly with the scale.

[0037] Secondly, this application provides a visual inspection system for fabric defects in weaving equipment, including: a priori module, an acquisition module, a comparison module, and an inspection module;

[0038] The prior module is used to obtain the process parameters of the fabric corresponding to the weaving equipment, in order to determine the sinking and floating relationship of the warp and weft yarns and calculate the normal vector distribution of the fabric surface. Based on the lighting parameters and imaging parameters, the expected texture feature distribution of the fabric is calculated, and the prediction uncertainty of each position is determined based on the fluctuation range of the process parameters.

[0039] The acquisition module is used to acquire actual images of the fabric surface and extract the corresponding actual texture feature distribution during the operation of the weaving equipment.

[0040] The comparison module is used to calculate the feature deviation between the actual texture feature distribution and the expected texture feature distribution position by position, and determine the deviation significance map after normalization based on the predicted uncertainty distribution;

[0041] The detection module is used to perform multi-scale anomaly region detection on the deviation significance map, determine defects based on the local statistical features of each scale, and output the defect region by fusing the determination results of different scales.

[0042] Compared with the prior art, the beneficial effects achieved by this application are as follows:

[0043] The process parameters of the corresponding fabric are obtained from the weaving equipment, the relationship between the warp and weft yarns is determined and the normal vector distribution of the fabric surface is calculated. The expected texture feature distribution of the fabric is calculated based on the lighting and imaging parameters. The distribution of prediction uncertainty is determined based on the fluctuation range of the process parameters. This allows the fabric to enter the detection state immediately when the product is switched, simply by receiving the new process parameters, thus eliminating the adaptability bottleneck caused by relying on physical objects.

[0044] During the operation of the weaving equipment, the actual image of the fabric surface is acquired and the actual texture feature distribution is extracted. The feature deviation is calculated position by position with the expected texture feature distribution. The deviation significance map is determined according to the prediction uncertainty distribution, so that the value at each position in the deviation significance map reflects the significance of the actual deviation relative to the prediction accuracy at that position. Based on multi-scale anomaly region detection, defect regions are determined, effectively suppressing single-scale false detections caused by random noise, while retaining the ability to detect defects at different spatial scales. Attached Figure Description

[0045] Figure 1 A flowchart of a visual inspection method for fabric defects used in weaving equipment;

[0046] Figure 2 A flowchart for calculating the expected distribution of texture features of a fabric;

[0047] Figure 3 This is a schematic diagram of a visual inspection system for fabric defects used in weaving equipment. Detailed Implementation

[0048] The technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of this application, rather than limitations thereof.

[0049] Example 1

[0050] like Figure 1 As shown, this embodiment provides a visual inspection method for fabric defects in weaving equipment, including:

[0051] S1. Obtain the process parameters of the fabric corresponding to the weaving equipment to determine the relationship between the warp and weft yarns and calculate the normal vector distribution of the fabric surface. Based on the lighting parameters and imaging parameters, calculate the expected texture feature distribution of the fabric and determine the prediction uncertainty distribution based on the fluctuation range of the process parameters.

[0052] Process parameters include weave diagram, warp density, weft density, and yarn parameters; furthermore, such as... Figure 2 As shown, the expected distribution of texture features of the fabric is estimated to include:

[0053] The lifting height of the upper yarn relative to the lower yarn at each interlacing point is determined based on the sinking and floating relationship of the warp and weft yarns, and the spacing between adjacent interlacing points is determined by combining the warp density and weft density. The buckling waveform of the warp and weft yarns in the fabric is then calculated.

[0054] The three-dimensional geometry of the fabric surface is constructed by sweeping along the buckling waveform with the cross-sectional shape of the yarn. The three-dimensional geometry is then discretized and sampled to obtain the normal vector distribution of the fabric surface.

[0055] Based on the normal vector distribution, the incident angle and reflection angle at each sampling point on the fabric surface are calculated by combining the lighting parameters and imaging parameters. The light intensity reflected to the camera direction at each sampling point is calculated by combining the reflection characteristics of the yarn material in the yarn parameters, so as to obtain the reflected light intensity distribution on the fabric surface.

[0056] By combining imaging parameters to perform imaging degradation processing on the reflected light intensity distribution, the expected fabric image is obtained, and the expected texture feature distribution is obtained after extracting texture features.

[0057] Among them, the relationship between the sinking and floating of the warp and weft yarns is obtained by determining the positional relationship of the warp and weft yarns at each interlacing point according to the weave diagram, and the lifting height is determined according to the cross-sectional shape of the lower yarn at the corresponding interlacing point.

[0058] Sweeping along the buckled waveform with the cross-sectional shape of the yarn involves sweeping through the natural cross-sectional shape of the yarn in the non-interlacing area, and determining the compressed cross-sectional shape in the interlacing area based on the compression relationship between the warp and weft yarns, and then using the compressed cross-sectional shape to replace the natural cross-sectional shape for sweeping.

[0059] Specifically, the distribution of prediction uncertainty is determined by identifying the range of variation of the expected texture features at each sampling point due to fluctuations in process parameters.

[0060] Process parameters refer to the design and setting parameters that weaving equipment uses during production. These parameters include weave diagrams, warp density, weft density, and yarn parameters. A weave diagram is a two-dimensional matrix representation of the fabric's structure. Each element in the matrix corresponds to an interlacing point in the fabric, i.e., the physical position where warp and weft yarns intersect. Based on the vertical relationship between the warp and weft yarns at this position, interlacing points are divided into two types: warp interlacing points (warp yarns above weft yarns) and weft interlacing points (warp yarns below weft yarns). The value of each element indicates the type of interlacing point. Warp density is the number of warp yarns per unit length in the warp direction of the fabric, and weft density is the number of weft yarns per unit length in the weft direction. Both determine the spatial arrangement of interlacing points on the fabric surface. Yarn parameters include the cross-sectional shape, cross-sectional dimensions, and reflective properties of the yarn material. Cross-sectional shapes include circular, elliptical, or racetrack shapes, and cross-sectional dimensions are the diameter or the length of the major and minor axes. Reflective properties describe the distribution of light intensity reflected in different directions after light strikes the yarn surface. The set fluctuation range of each process parameter is the possible deviation of each parameter from its nominal value during actual weaving.

[0061] This embodiment uses a 2 / 1 twill fabric as an example for illustration, and the weave diagram matrix M is: The element value "1" indicates that the warp yarn is above the weft yarn at the interlacing point (warp weave point), and "0" indicates that the warp yarn is below the weft yarn (weft weave point). The rows of the matrix correspond to the weft yarn numbers, and the columns correspond to the warp yarn numbers. For example, a value of "1" in the first row and first column indicates that the warp yarn is above the weft yarn at the interlacing point of the first weft yarn and the first warp yarn; a value of "0" in the first row and third column indicates that the warp yarn is below the weft yarn at the interlacing point of the first weft yarn and the third warp yarn. This weave diagram records the floating relationship of the warp and weft yarns at all interlacing points and is the direct input for subsequent buckling waveform calculation.

[0062] The warp density is 60 yarns / cm, and the weft density is 40 yarns / cm. The warp yarns are cotton fiber yarns with an approximately circular cross-section and a diameter of 0.3mm. The weft yarns are polyester yarns with an approximately elliptical cross-section, a major axis of 0.35mm, and a minor axis of 0.25mm. The set fluctuation range for warp density is ±1 yarn / cm, and the set fluctuation range for weft density is ±0.5 yarns / cm. The set fluctuation range for cross-sectional dimensions is ±5% of the nominal value. The warp and weft yarn floating relationship is directly read from the weave diagram matrix. For the above 2 / 1 twill weave diagram, the floating relationship is as follows: on the first weft yarn, warp yarn 1 is on top, warp yarn 2 is on top, and warp yarn 3 is on the bottom; on the second weft yarn, warp yarn 1 is on the bottom, warp yarn 2 is on top, and warp yarn 3 is on top; on the third weft yarn, warp yarn 1 is on top, warp yarn 2 is on the bottom, and warp yarn 3 is on top. This floating relationship cycles once every three weft yarns.

[0063] The flex waveform refers to the up-and-down bending path formed by the interlacing of warp and weft yarns in a fabric. This path describes the undulation of the yarn in the fabric thickness direction from one interlacing point to the next. The lift height is determined based on the cross-sectional shape of the lower yarn at the corresponding interlacing point. That is, at each interlacing point, the upper yarn needs to cross over the surface of the lower yarn. Therefore, the lowest position of the upper yarn at that interlacing point should not be lower than the highest position of the lower yarn at that position. Specifically, the lift height is equal to the height of the lower yarn cross-section at that interlacing point. For a circular cross-section, this height is equal to the cross-sectional diameter. For an elliptical cross-section, this height depends on the cross-sectional orientation and is usually taken as the projected height of the cross-section in the fabric thickness direction.

[0064] Taking the interlacing point of the first warp and the first weft as an example, according to the weave diagram, the warp is above the weft at this interlacing point; the yarn below is the weft (polyester), with an elliptical cross-section, a major axis of 0.35mm, and a minor axis of 0.25mm. The weft cross-section is oriented along its major axis in the fabric thickness direction, meaning the major axis of the weft cross-section is perpendicular to the fabric surface. Therefore, the lifting height of the yarn above (warp) at this interlacing point is 0.35mm. Taking the interlacing point of the first warp and the second weft as another example, according to the weave diagram, the warp is below the weft at this interlacing point. Therefore, the warp does not need to be lifted at this point; instead, the weft needs to be lifted relative to the warp. At this time, the yarn below is the warp (cotton), with a circular cross-section and a diameter of 0.3mm, and the lifting height of the weft is 0.3mm.

[0065] The interlacing point spacing is determined by the reciprocal of the warp density and weft density. A warp density of 60 yarns / cm corresponds to a warp spacing of 1 / 60 cm, approximately 0.167 mm; a weft density of 40 yarns / cm corresponds to a weft spacing of 1 / 40 cm, or 0.25 mm. This means that the center distance between two adjacent warp yarns is 0.167 mm, and the center distance between two adjacent weft yarns is 0.25 mm. After determining the lifting height and interlacing point spacing, the buckling waveform of the yarn in the fabric is calculated using adjacent interlacing points as boundary nodes. A smooth transition curve that satisfies geometric continuity constraints means that the yarn path is continuously differentiable at the interlacing point, that is, the tangent direction when the yarn enters the interlacing point is smoothly transitioned to the tangent direction when it leaves the interlacing point, without any bends or breaks. This is because the yarn, as a flexible continuum, is subject to the combined constraints of warp and weft tensions in the fabric, naturally forming a smooth curved path.

[0066] The shape of the flexed waveform depends on the change in the floating state of the yarn at adjacent interlacing points. Taking the first warp yarn as an example, at the first weft yarn, the warp yarn is on top and raised by 0.35mm; at the second weft yarn, the warp yarn is on the bottom and does not rise; and at the third weft yarn, the warp yarn is on top and raised by 0.3mm. Then, between the first and second weft yarns, the first warp yarn needs to descend from the 0.35mm raised point to the bottom of the fabric, forming a downward-curving waveform; between the second and third weft yarns, it needs to rise from the bottom of the fabric to the 0.3mm raised point, forming an upward-curving waveform. These two waveforms are smoothly connected at the second weft yarn. The mathematical expression of the waveform is a piecewise cosine function or a fifth-order polynomial curve to satisfy the continuity conditions of displacement and tangential direction at the interlacing points.

[0067] Cross-section sweeping refers to the geometric operation of moving a two-dimensional cross-section along a three-dimensional path curve while maintaining the normal direction of the cross-section perpendicular to the tangent direction of the path curve, thereby generating a three-dimensional surface. This is achieved by sweeping the cross-section of a yarn along a bent waveform to construct the three-dimensional geometry. In other words, the yarn cross-section acts as a blade, the bent waveform as a track, and the surface swept by the blade along the track becomes the three-dimensional surface of the yarn. Sweeping involves using different cross-section shapes in different areas. In non-interlacing areas, where there is no direct contact between warp and weft yarns, the yarn is in a free state, so the natural cross-section shape of the yarn is used for sweeping. The natural cross-section shape is the cross-sectional shape of the yarn without external force. In interlacing areas, the warp and weft yarns are compressed at the intersection, causing cross-section deformation. The compressed cross-section shape needs to be determined based on the compression relationship between the warp and weft yarns, and this compressed cross-section shape is used instead of the natural cross-section shape for sweeping. The compression relationship refers to the contact between the warp and weft yarns at the interlacing point, generating normal pressure on the contact surface, flattening the cross-section of the contact area. After compression, the cross-section shape is flattened in the direction of the contact surface and widened in the direction perpendicular to the contact surface.

[0068] Taking the first warp yarn as an example, i.e., cotton fiber, with a circular cross-section and a diameter of 0.3 mm, in the non-interlacing area, the cross-section is swept to generate a cylindrical surface with a diameter of 0.3 mm. At the interlacing point where the warp yarn is above the weft yarn, such as at the first weft yarn, the bottom of the warp yarn contacts the top of the weft yarn. Due to the low compression stiffness of cotton fiber yarn, assuming that the cross-section changes from circular to elliptical after compression, with a major axis of 0.36 mm (widening along the weft surface direction) and a minor axis of 0.24 mm (flattened along the fabric thickness direction), this compressed cross-section, after being swept along the buckling waveform, generates a cylindrical surface with an elliptical cross-section; the area of ​​the compressed cross-section (π×0.18×0.12≈0.0679 mm²) 2 ) and natural cross-sectional area (π×0.15) 2 ≈0.0707mm 2 The value is close to but slightly reduced, reflecting the slight loss of cross-sectional area of ​​the yarn during compression.

[0069] After the cross-section sweep is completed, the generated three-dimensional geometry is discretized and sampled. Discretization sampling refers to selecting sampling points on the three-dimensional surface according to a fixed spacing rule. The sampling spacing should be smaller than the interlacing point spacing to capture the details of the normal vector change between interlacing points. In this embodiment, the sampling spacing is 0.02 mm. In a repeating unit of 0.167 mm in the warp direction and 0.25 mm in the weft direction, there are approximately 8 sampling points in the warp direction and approximately 12 sampling points in the weft direction. At each sampling point, the normal vector direction is calculated based on the local geometry of the surface where the point is located. The normal vector is a unit vector perpendicular to the surface and pointing outward. On the cylindrical yarn surface in the non-interlacing area, the normal vector direction is jointly determined by the normal direction of the cross-sectional arc and the tangent direction of the buckling waveform. On the elliptical cross-section cylindrical surface in the interlacing area, since the cross-section is flattened in the contact direction, the inclination angle of the normal vector near the contact surface is different from that in the non-interlacing area. The normal vector near the contact surface is closer to the horizontal direction, reflecting the surface direction change caused by compression deformation.

[0070] Calculating the reflected light intensity distribution refers to calculating the light intensity reflected from the light source to the camera direction at each sampling point on the fabric surface based on the normal vector distribution, combined with the spatial direction of the light source in the illumination parameters and the position of the camera in the imaging parameters. The incident angle is the angle between the light source direction vector and the sampling point normal vector, and the reflection angle is the angle between the camera direction vector and the sampling point normal vector. The yarn material reflection characteristics in the yarn parameters describe the reflection law of the material surface on light, that is, for a given incident angle and reflection angle, the proportion of the light intensity reflected from the material surface to the camera direction to the incident light intensity. This proportion is the reflection coefficient, and the reflection characteristics are the functional relationship between the reflection coefficient and the incident angle and the reflection angle.

[0071] For example, the light source is located at an angle of 45 degrees off the normal direction of the fabric surface, i.e., the light source direction vector is (sin45°, 0, cos45°) ≈ (0.707, 0, 0.707), and the camera is located directly above the fabric surface, i.e., the camera direction vector is (0, 0, 1). For a sampling point where the normal vector is exactly directly above (0, 0, 1), such as the highest point of the yarn, the angle of incidence is 45 degrees, and the angle of reflection is 0 degrees. For cotton fiber, its reflection characteristic is approximately diffuse reflection, i.e., light... The reflection intensity is relatively uniform in all directions. If the material has a reflection coefficient of approximately 0.35 under the conditions of an incident angle of 45 degrees and a reflection angle of 0 degrees, then the reflected light intensity at the sampling point is the incident light intensity multiplied by 0.35. For a sampling point where the normal vector deviates from directly above by 30 degrees, such as the side of the yarn, both the incident angle and the reflection angle need to be recalculated based on the actual direction of the normal vector. The incident angle may become approximately 60 degrees, the reflection angle may become 30 degrees, and the reflection coefficient may decrease to approximately 0.22. The reflected light intensity at the sampling point will decrease accordingly.

[0072] Arranging the reflected light intensity at all sampling points according to spatial location yields the reflected light intensity distribution on the fabric surface. In this distribution, the area at the top of the yarn (normal vector upward, incident angle smaller) exhibits higher brightness, while the area on the sides of the yarn (normal vector deflected, incident angle larger) exhibits lower brightness. Local brightness differences occur at interlacing points due to changes in the normal vector caused by cross-sectional compression. Image degradation processing refers to the process of simulating the reflected light intensity distribution using the characteristics of the imaging system to obtain the desired fabric image. Imaging parameters include the lens's modulation transfer function and the sensor's pixel size. The modulation transfer function describes the lens's ability to transmit signals at different spatial frequencies; higher frequencies transmit more signals. The lower the capability, the more blurred the high-frequency details in the image are attenuated. The pixel size determines the spatial sampling interval; the smaller the pixel size, the higher the resolution. In this embodiment, the modulation transfer function of the lens is 0.6 at a spatial frequency of 20 line pairs / mm, which means that the modulation contrast transfer ratio at this frequency is 0.6. This indicates that the lens attenuates the contrast of the input signal to 60% of its original value at this spatial frequency. The sensor pixel size is 0.005mm. After the reflected light intensity distribution is convolved by the lens transfer function, the high-frequency components are attenuated. Then, the sensor performs discrete sampling at a spacing of 0.005mm and 8-bit quantization, resulting in 256 gray levels, to obtain the desired fabric image.

[0073] Texture feature extraction refers to calculating the feature quantities that can describe the texture information of the fabric from the expected fabric image. Specifically, local gray-level statistical features are used, that is, the gray-level mean, gray-level standard deviation, gray-level gradient direction histogram and other statistical quantities are calculated in the neighborhood window of each location as the texture feature of that location. The dimension of the feature depends on the types of statistical quantities selected and the number of bins in the histogram. The prediction uncertainty distribution refers to the range of variation that the expected texture feature calculation result may produce at each location due to the fluctuation of process parameters. The set fluctuation range of each process parameter is substituted into the above calculation link of the expected texture feature, and the variation of the expected texture feature at each location due to the fluctuation of the parameter is observed.

[0074] Taking the warp density fluctuation as an example, the nominal warp density is 60 threads / cm, and the fluctuation range is set to ±1 thread / cm. We take warp densities of 59 threads / cm and 61 threads / cm respectively, and substitute them into the calculation of the expected texture features. When the warp density is 59 threads / cm, the distance between the warp interlacing points becomes 1 / 59 cm, about 0.1695 mm, which is about 1.7% higher than the nominal value. The increase in distance leads to an increase in the wavelength of the buckled waveform, a decrease in the degree of bending of the yarn between the interlacing points, and a change in the undulation of the three-dimensional shape in the interlacing area. The deflection angle of the normal vector at the edge of the interlacing point is slightly reduced, and the contrast between light and dark in the distribution of reflected light intensity is slightly reduced. Finally, the expected texture features produce an offset relative to the nominal value at each position.

[0075] When the warp density is 61 threads / cm, the warp interlacing point spacing becomes 1 / 61 cm, approximately 0.1639 mm, which is about 1.6% less than the nominal value. The reduced spacing leads to a decrease in the wavelength of the buckling waveform, an increase in the degree of curvature, an increase in the undulation of the three-dimensional shape in the interlacing area, an increase in the normal vector deflection angle, and an enhancement in the contrast between light and dark. The expected texture features are shifted in opposite directions. The difference between the two shift values ​​is the range of variation of the expected texture features at that position caused by the warp density fluctuation.

[0076] For example, at a specific location, such as along the edge of a tissue point, the expected texture feature value (mean grayscale) when the warp density is the nominal value of 60 fibers / cm is 180, which is the grayscale value under 8-bit quantization. When the warp density is 59 fibers / cm, it is 184, and when it is 61 fibers / cm, it is 176. Therefore, the range of variation caused by warp density fluctuation at this location is 176 to 184, a variation of 8 grayscale levels. The same calculation is performed for the fluctuations in weft density and cross-sectional morphology. If the variation caused by weft density fluctuation at this location is 5 grayscale levels, and the variation caused by cross-sectional morphology fluctuation is 3 grayscale levels, then the overall prediction uncertainty at this location can be taken as the root mean square value of each variation amplitude, i.e. ≈9.9 gray levels; at another location, such as the middle of a flat yarn area, the variation caused by warp density fluctuation is only 3 gray levels, the variation caused by weft density fluctuation is 2 gray levels, and the variation caused by cross-sectional shape fluctuation is 1 gray level. The overall prediction uncertainty is... ≈3.7 gray levels.

[0077] The prediction uncertainty at the two locations mentioned above differs by about 2.7 times. This difference is because the normal vector changes drastically at the edge of the intersection point, and the small fluctuations in process parameters are gradually amplified through the link of buckling waveform, three-dimensional shape, normal vector and reflected light intensity; while the normal vector changes gently in the flat area, and the same amplitude of process parameter fluctuations are smoothly attenuated during the link transmission process.

[0078] S2. During the operation of the weaving equipment, acquire the actual image of the fabric surface and extract the corresponding actual texture feature distribution.

[0079] Specifically, extracting the corresponding actual texture feature distribution includes:

[0080] Based on the weave diagram, the repeating units of the fabric weave structure are determined, and the warp and weft dimensions of the repeating units, as well as the actual directions of the warp and weft, are determined in combination with the warp density and weft density.

[0081] The dimensions of the extraction window are determined by the warp and weft dimensions, and the actual directions of the warp and weft are determined by the direction of the extraction window.

[0082] Within each extraction window, the window area is divided into a warp tissue point area, a weft tissue point area, and a cross transition area according to the tissue diagram;

[0083] The actual image is divided into windows according to the extraction window, and the corresponding local texture features are extracted in each window area. The actual texture feature distribution is obtained by combining them according to their spatial location.

[0084] A repeating unit in a fabric weave structure refers to the smallest indivisible periodic unit of the warp and weft yarn interlacing pattern in a fabric weave diagram. The fabric weave structure is periodic, meaning that the warp and weft yarns interlaced repeatedly according to the pattern defined in the weave diagram. The same interlacing pattern repeated in the warp and weft directions at a fixed cycle. The repeating unit is the area covered by a complete cycle of this periodic pattern. The size of the repeating unit can be directly read from the weave diagram matrix. The number of warp yarns in the repeating unit is equal to the number of columns in the weave diagram matrix, which is the number of warp yarns contained in a complete weave cycle. The number of weft yarns in the repeating unit is equal to the number of rows in the weave diagram matrix, which is the number of weft yarns contained in a complete weave cycle.

[0085] Taking a 2 / 1 twill fabric as an example, its weave diagram is a 3x3 matrix, indicating that one weave cycle contains 3 warp yarns and 3 weft yarns, and the area covered by the repeating unit is 3 warp yarns × 3 weft yarns. Combining a warp density of 60 yarns / cm and a weft density of 40 yarns / cm, the warp dimension of the repeating unit = 3 ÷ 60 = 0.05 cm, or 0.5 mm; the weft dimension = 3 ÷ 40 = 0.075 cm, or 0.75 mm. If it is a plain weave fabric, the weave diagram is a 2x2 matrix. When the warp density is 60 yarns / cm and the weft density is 40 yarns / cm, the warp dimension of the repeating unit = 2 ÷ 60 ≈ 0.033 cm, or 0.333 mm; the weft dimension = 2 ÷ 40 = 0.05 cm, or 0.5 mm.

[0086] The actual directions of the warp and weft are the actual angular directions of the warp and weft yarn arrangement on the fabric surface in the image. Ideally, the warp direction is vertical and the weft direction is horizontal. However, due to slight tilting or deflection of the fabric during weaving, the actual directions of the warp and weft in the image are not completely parallel to the image coordinate axes. The actual directions of the warp and weft are determined by performing spectral analysis on the actual image. A Fourier transform is performed on the actual image, and the two orthogonal directions with the most concentrated energy in the spectrum are the actual directions of the warp and weft of the fabric in the image. This direction information is used to determine the direction of the extraction window to ensure that the warp and weft of the extraction window are aligned with the actual warp and weft of the fabric.

[0087] An extraction window is a rectangular region on an actual image used to extract local texture features. The warp and weft dimensions of the repeating unit are used as the dimensions of the extraction window in the warp and weft directions, respectively, and the actual directions of the warp and weft are used as the arrangement direction of the extraction windows. This means that each extraction window exactly covers the area of ​​a complete weave cycle on the fabric surface. The size of the extraction window is bound to the physical size of the repeating unit, rather than using a fixed pixel size. This is because different fabric types have repeating units of different sizes. If a fixed pixel size extraction window is used, for fabrics with small repeating units, such as high-warp-density fine fabrics, a single window may cover multiple repeating units, causing the features within the window to be aliased by textures from multiple cycles. For fabrics with large repeating units, such as low-warp-density coarse fabrics, a single window may only cover a portion of the repeating unit, resulting in the features within the window not fully reflecting the information of a weave cycle. Using the repeating unit size as the window size ensures that each window corresponds exactly to a complete weave cycle, forming a correspondence with the calculated unit of the expected texture features.

[0088] For example, for a 2 / 1 twill fabric with a warp density of 60 threads / cm and a weft density of 40 threads / cm, the repeating unit has a warp dimension of 0.5mm and a weft dimension of 0.75mm. If the spatial resolution of the image acquisition is 0.005mm per pixel, i.e., 200 times optical magnification, then the pixel size of the extraction window is 0.5÷0.005=100 pixels in the warp direction and 0.75÷0.005=150 pixels in the weft direction. The direction of the extraction window is determined by the actual warp and weft directions determined by the aforementioned spectral analysis. If the actual direction has an angle of 3 degrees with the image coordinate axis, then the extraction window needs to be rotated 3 degrees to align with the actual warp and weft directions of the fabric.

[0089] Within each extraction window, the fabric surface is not uniform; different interlacing states correspond to different surface morphologies. Therefore, it is necessary to further divide the interior of the window into different sub-regions based on the weave diagram, so that texture features matching the surface morphology can be extracted from each sub-region. The warp weave point region refers to the interlacing points on which the warp yarns are located in the weave diagram and the surrounding area within the extraction window. In this region, the fabric surface mainly presents the texture features of the warp yarn surface, that is, the warp yarns are located on the outermost layer of the surface, and the surface morphology of the warp yarns (including cross-sectional contours, surface fiber textures, etc.) dominates the imaging appearance of this region.

[0090] The weft weave point region refers to the interlacing points and surrounding areas of the corresponding weave pattern within the extraction window. In this region, the weft yarn is located on the outermost layer of the surface, and the surface texture characteristics of the weft yarn dominate the imaging appearance of this region. The cross transition region refers to the transition zone between adjacent warp and weft weave point regions. In this zone, the warp and weft yarns exchange on the surface layer, that is, the warp yarn sinks from the surface and the weft yarn rises from the bottom, or vice versa. The surface morphology of this region is neither completely dominated by the warp yarn nor completely dominated by the weft yarn, but presents a mixed texture of the two yarns crossing and transitioning. The range of the cross transition region is determined by the cross contact area of ​​the warp and weft yarns at the interlacing points. The boundary of the cross transition region is located at the junction of the warp and weft weave point regions, and its width is approximately on the order of the yarn cross-sectional size, that is, a range extending from the edge of the warp weave point region towards the weft weave point region for about one yarn cross-sectional width.

[0091] For example, for a repeating unit (3 warp yarns × 3 weft yarns) of a 2 / 1 twill fabric, the weave diagram matrix has 6 warp weave points (value "1") and 3 weft weave points (value "0"). According to the weave diagram, the window area within the repeating unit can be divided into: 6 warp weave point areas, each surrounding a warp weave point; 3 weft weave point areas, each surrounding a weft weave point; and a cross transition area connecting adjacent different weave point areas. Taking a warp yarn diameter of 0.3 mm as an example, the width of the cross transition area is approximately 0.3 mm, that is, it extends approximately 0.3 mm from the edge of the warp weave point area to the adjacent weft weave point area.

[0092] Windowing refers to dividing the actual image window by window according to the size, orientation, and arrangement of the extraction windows, so that each window corresponds to a repeating unit on the fabric surface. Non-overlapping windowing is used, meaning adjacent windows are exactly connected end-to-end, and each pixel belongs to only one window. Within each extraction window, the content is divided into three parts according to the aforementioned region division: warp point region, weft point region, and cross-transition region. Corresponding local texture features are extracted from each region. Local texture features refer to the feature quantities calculated within that region that can describe the texture information of that region. The extracted texture feature types are the same for each region, but because the dominant surface texture of each region is different (either warp or weft), the extracted feature values ​​will naturally be different. The extraction method of local texture features is consistent with the extraction method of the expected texture feature distribution. Specifically, local gray-level statistical features are calculated in each region using a sub-window of a fixed size, including statistics such as gray-level mean, gray-level standard deviation, and gray-level gradient direction histogram. The size of the sub-window should be smaller than the size of the region to ensure that the pixels within the sub-window mainly belong to the current region type.

[0093] Taking a 2 / 1 twill fabric extraction window as an example, the window pixel size is 100×150 pixels, including 6 warp point regions, each occupying about two-thirds of the window area; 3 weft point regions, each occupying about one-sixth of the window area; and the cross transition region occupies the remaining area. Within each warp point region, the region is traversed with 10×10 pixel sub-windows, and the mean gray level, standard deviation, and 8-direction gradient histogram within each sub-window are calculated to obtain the texture feature vector of that sub-window. The feature vectors of each sub-window are arranged according to their spatial position to form the local texture features of the warp point region. The weft point region and the cross transition region are extracted in the same way.

[0094] Combining by spatial position refers to restoring the local texture features extracted from each region to their corresponding positions on the fabric surface according to their original spatial positions within the extraction window. Features from the warp point region are restored to their corresponding spatial positions, features from the weft point region are restored to their corresponding spatial positions, and features from the cross transition region are restored to their corresponding spatial positions. After combining the local features of all extraction windows according to the same spatial position relationship, the entire detection area is covered, resulting in the actual texture feature distribution.

[0095] The spatial resolution and feature type of the actual texture feature distribution are consistent with the expected texture feature distribution because both use the same feature extraction method and the same analysis structure, with repeating units and region divisions determined by process parameters, thus ensuring that the position-by-position comparison between the two in S3 is physically meaningful.

[0096] S3. Calculate the feature deviation between the actual texture feature distribution and the expected texture feature distribution position by position, and determine the deviation significance map after normalization based on the predicted uncertainty distribution.

[0097] Specifically, determining the significance plot of the deviation includes:

[0098] The deviation value of each feature component between the actual texture feature distribution and the expected texture feature distribution is calculated position by position to obtain the feature deviation;

[0099] Divide the feature bias by the prediction uncertainty at the corresponding position to obtain the significance of the bias of each feature component after normalization;

[0100] The deviation significance of each feature component at each location is synthesized to obtain the deviation significance at the corresponding location. The deviation significance of each location is arranged according to spatial position to obtain the deviation significance map.

[0101] Among them, the deviation value of each feature component is calculated position by position, which is the absolute value of the difference between the actual texture feature and the expected texture feature at the same position and the same feature component.

[0102] The significance of the deviation at each location is synthesized by taking the maximum value of the deviation significance among the normalized feature components as the significance of the deviation at the corresponding location.

[0103] Feature bias is the degree of difference between the actual texture feature distribution and the expected texture feature distribution at each spatial location. At each spatial location, the actual texture feature and the expected texture feature are each a vector containing multiple feature components. Subtracting the same feature component at corresponding positions in the two vectors and taking the absolute value yields the bias value for that component at that position. Position-by-position means that the feature bias is calculated with spatial position as the basic unit, and each position is calculated independently. Component-by-component means that within each position, the feature bias is calculated with each component in the feature vector as the basic unit, and each component is calculated independently. Position-by-position and component-by-component means that the granularity of the bias value calculation is the finest, with a bias value for each feature dimension at each spatial location.

[0104] For example, at a specific location, the expected texture feature vector contains three components: the gray-level mean, the gray-level standard deviation, and the principal direction angle of the gray-level gradient direction histogram. The expected values ​​are 180, 25, and 45 degrees, respectively, while the actual values ​​are 192, 28, and 50 degrees. Therefore, the deviation values ​​for these three components at this location are: gray-level mean deviation = |192-180| = 12, gray-level standard deviation deviation = |28-25| = 3, and gradient direction deviation = |50-45| = 5. All three deviation values ​​are non-negative scalars. At another location, such as a flat area of ​​the fabric, the expected values ​​are 175, 20, and 30 degrees, while the actual values ​​are 177, 21, and 31 degrees. The deviation values ​​for these three components are 2, 1, and 1, respectively. The deviation values ​​at this location are significantly smaller than those at the previous location, indicating that the actual texture at this location is closer to the expected texture.

[0105] At the location of the defect, such as a broken warp, the actual texture characteristics will deviate significantly. If the expected value at this location is 180, 25, and 45 degrees, but the actual value becomes 140, 42, and 82 degrees due to the breakage of the warp yarn causing a hole and exposure of the weft yarn, then the deviation values ​​of the three components are 40, 17, and 37, respectively. These deviation values ​​are significantly greater than the deviation values ​​at normal locations, reflecting the abnormal deviation between the actual texture and the expected texture caused by the defect.

[0106] Normalization refers to dividing the feature deviation by the prediction uncertainty, converting the deviation value into a measure of significance relative to the prediction accuracy. Prediction uncertainty describes the range of variation that the expected texture features may produce at each location due to fluctuations in process parameters. Dividing the feature deviation by this range of variation, the normalized value reflects the multiple of the actual deviation relative to the expected deviation range. If the normalized value is greater than 1, it indicates that the actual deviation exceeds the range that can be explained by fluctuations in process parameters, and the deviation may be caused by defects. If the normalized value is close to or less than 1, it indicates that the actual deviation is within the reasonable range of fluctuations in process parameters, and the deviation may only be caused by normal process fluctuations.

[0107] The deviation value of each feature component is divided by the prediction uncertainty at the corresponding position. The prediction uncertainty is a scalar value, and all feature components at each position share the same prediction uncertainty value. The normalization operation is to divide the deviation value of each feature component by the scalar value of the prediction uncertainty at that position. Taking the three positions mentioned above as examples, the first position is the edge of the interleaving point, a sensitive area for process parameter fluctuations. The prediction uncertainty at this position is 10, and the deviation values ​​of the three feature components are 12, 3, and 5, respectively. The significance of the deviations after normalization are 12÷10=1.2, 3÷10=0.3, and 5÷10=0.5, respectively. Among them, the significance of the deviation of the gray-scale mean component is 1.2, which exceeds 1, indicating that the actual deviation of this component exceeds the explanatory range of process fluctuations.

[0108] The second location is a flat area, insensitive to process parameter fluctuations. The prediction uncertainty for this location is 3, and the deviation values ​​of the three characteristic components are 2, 1, and 1, respectively. The normalized deviation significances are 2÷3≈0.67, 1÷3≈0.33, and 1÷3≈0.33, respectively. The significance of the deviations for all components is less than 1, indicating that the actual deviation at this location is within the reasonable range of process fluctuations. The third location is the location of the broken warp defect. The prediction uncertainty for this location is 10, and the deviation values ​​of the three characteristic components are 40, 17, and 37, respectively. The normalized deviation significances are 40÷10=4, 17÷10=1.7, and 37÷10=3.7, respectively. The significance of the deviations for all components is significantly greater than 1, indicating that there is an abnormal deviation at this location that far exceeds the range of process fluctuations.

[0109] The three examples above demonstrate the core value of normalization. Without normalization, the deviation values ​​at the three positions are of different magnitudes: the maximum deviation at the first position is 12, and the maximum deviation at the third position is 40, but there is a lack of a unified judgment benchmark. After normalization, each deviation value has a clear meaning relative to the prediction accuracy: values ​​greater than 1 are abnormal, and values ​​less than or close to 1 are normal. In particular, at the second position, although its absolute deviation values ​​(2, 1, 1) are not on the same order of magnitude as those at the first position (12, 3, 5), considering that the prediction uncertainty at this position is only 3, which is much lower than the 10 at the first position, the significance of the deviation after normalization is not the lowest. This reflects the characteristic that although the deviation at this position is small, the prediction accuracy is also small.

[0110] Synthesis refers to combining the significant deviations of multiple feature components at each location into a single scalar value, which serves as the significance of the deviation at that location. At each location, if the actual deviation of any feature component significantly exceeds the expected range, that location should be marked as a potential defect location. The strategy of maximizing the value ensures that detection is triggered as soon as one feature component exhibits an anomaly, avoiding the abnormal signal from being overwhelmed by the average effect of the normal components. Taking the normalized results of the aforementioned three locations as an example, at the first location, the significance of the deviations of the three components are 1.2, 0, and 0, respectively. The deviation significance at the first position is 1.2, with values ​​of 0.3 and 0.5 respectively. At the second position, the deviation significance of the three components is 0.67, 0.33, and 0.33 respectively, with the maximum value of 0.67, indicating a deviation significance of 0.67 at this position. At the third position, the deviation significance of the three components is 4, 1.7, and 3.7 respectively, with the maximum value of 4, indicating a deviation significance of 4 at this position. It can be observed that the deviation significance at the broken meridian defect position is significantly higher than that at the normal position, indicating that the synthesis method of taking the maximum value can effectively amplify the significance of the defect signal.

[0111] Arranging the significance of deviations at all locations according to spatial coordinates yields a deviation significance map. This map has the same spatial resolution as the fabric surface, with each pixel storing a scalar value that reflects the degree of deviation of the actual texture from the expected texture at that location (after normalization of prediction uncertainty). The deviation significance values ​​in normal areas are low and uniform, while the deviation significance values ​​in defective areas are significantly higher.

[0112] Normalization by dividing the feature deviation by the prediction uncertainty ensures that each pixel value in the deviation significance map has a clear physical meaning, representing the multiple of the actual deviation relative to the expected range of variation caused by process parameter fluctuations. The synthesis method of taking the maximum value ensures that abnormal signals in any feature dimension will not be masked by normal signals in other dimensions. Taking fabric defects as an example, warp breakage defects may cause a significant change in the gray-scale mean while the gray-scale gradient direction changes little, or vice versa. It is ensured that as long as an abnormal signal is captured in one dimension, the deviation significance at that position will be marked as a high value to avoid missed detection.

[0113] The deviation significance map serves as the input for abnormal region detection in S4. In this map, the values ​​of normal regions are low and relatively evenly distributed because the actual texture of normal regions is basically consistent with the expected texture. The deviation significance after normalization is close to or lower than 1. The values ​​of defective regions are significantly higher and exhibit local clustering. This significant difference in deviation significance values ​​between normal and defective regions provides favorable conditions for subsequent threshold determination based on local statistical features. Under the premise that normal regions are in the majority, the local statistical features are determined by the deviation significance values ​​of normal regions, and the abnormally high values ​​of defective regions are easily detected.

[0114] S4. Perform multi-scale anomaly detection on the deviation significance map, determine defects based on the local statistical features of each scale, and output the defect area by fusing the determination results of different scales.

[0115] Specifically, the output defect areas include:

[0116] The scale is determined based on the process parameters. At each scale, the deviation significance map is traversed by a sliding window of the corresponding scale size. The local statistical characteristics of the deviation significance within the sliding window are calculated to determine the significance threshold.

[0117] When the deviation within the sliding window is greater than the significance threshold, the corresponding position is identified as a candidate defect at the corresponding scale.

[0118] Check the detection results of each candidate defect at different scales. When a candidate defect is detected at both different scales, the corresponding location is confirmed as a defect area; otherwise, it is removed.

[0119] Among them, determining the scale based on process parameters involves determining the fine scale using the cross-sectional dimensions in the yarn parameters, determining the medium scale using the dimensions of repeating units in the weave diagram, and determining the coarse scale using the combined dimensions of multiple repeating units.

[0120] Local statistical features include local mean and local standard deviation. The significance threshold is the product of the sensitivity coefficient corresponding to the scale and the local standard deviation, plus the local mean. The sensitivity coefficient corresponding to the scale increases linearly with the scale.

[0121] Fabric defects have different spatial scales. Some defects involve only local anomalies of a single yarn, such as warp breaks, weft breaks, and fly waste. Some defects involve local damage to the fabric structure, such as skipped stitches, weft shrinkage, and uneven weave. Other defects cover a large area, such as oil stains, sizing stains, and color differences. Defects at different spatial scales require analysis windows of different sizes to be effectively detected. Windows that are too small cannot capture complete information about area-level defects, while windows that are too large will drown out the signals of yarn-level defects in a large area of ​​normal texture. Therefore, it is necessary to determine multiple analysis scales, each corresponding to a specific type of defect.

[0122] The analysis scale is tied to the physical dimensions in the process parameters. The fine scale is determined based on the cross-sectional dimensions in the yarn parameters. The cross-sectional dimensions describe the lateral width of a single yarn. The analysis window based on this can cover a single yarn and its adjacent areas, which is suitable for detecting local anomalies at the single yarn level. The medium scale is determined based on the size of the repeating unit in the weave diagram. A repeating unit contains a complete cycle of the fabric weave structure. The analysis window based on this can cover a complete weave cycle, which is suitable for detecting anomalies at the weave structure level. The coarse scale is determined based on the combined size of multiple repeating units. Multiple repeating units cover a larger area of ​​the fabric surface. The analysis window based on this is suitable for detecting area-level defects.

[0123] For example, for a 2 / 1 twill fabric with a warp density of 60 threads / cm and a weft density of 40 threads / cm, the warp cross-sectional diameter is 0.3mm. For the fine scale, the cross-sectional diameter is based on one to two times the cross-sectional diameter, ranging from 0.3mm to 0.6mm. For the medium scale, the diameter is based on the size of one repeating unit: 0.5mm in the warp and 0.75mm in the weft, taking the larger of the two (0.75mm). For the coarse scale, the diameter is based on the combined size of multiple repeating units, taking the combined size of three repeating units, i.e., 1.5mm in the warp and 2.25mm in the weft, taking the larger of the two (2.25mm). If the image spatial resolution is 0.005mm per pixel, then the corresponding sliding window pixel sizes for the three scales are approximately 60×60 pixels (fine scale), 100×150 pixels (medium scale), and 300×450 pixels (coarse scale), respectively.

[0124] Instead of using fixed pixel sizes, the analysis scale is bound to the physical structure parameters of the fabric. This ensures that the analysis window at each scale directly corresponds to the physical structure of a specific layer in the fabric, so that the detection results at different scales have clear physical meanings. Fine scales detect yarn-level anomalies, medium scales detect tissue-level anomalies, and coarse scales detect region-level anomalies.

[0125] At each scale, a sliding window corresponding to that scale is used to traverse the deviation significance map pixel by pixel. At each sliding position, the window covers a local area in the deviation significance map, and the local mean and local standard deviation of the deviation significance values ​​of all pixels within the window are calculated. The local mean describes the average level of deviation significance within the window, and the local standard deviation describes the dispersion of deviation significance values ​​within the window. Based on the local mean and local standard deviation, a significance threshold is determined at the center of the window. The significance threshold is the product of the sensitivity coefficient corresponding to the scale and the local standard deviation plus the local mean. This expression means that the local mean is used as a benchmark, and the local standard deviation is superimposed on the benchmark by a multiple of the sensitivity coefficient as the judgment threshold. The local mean reflects the average level of deviation significance in the normal area within the window, and the local standard deviation reflects the normal fluctuation range of deviation significance in the normal area. The significance threshold is set at the position where the local mean is added to a certain multiple of the local standard deviation, which means that only positions where the deviation significance significantly exceeds the normal fluctuation range will be judged as candidate defects.

[0126] The sensitivity coefficient determines the degree of deviation of the significance threshold relative to the local mean. The sensitivity coefficient increases linearly with the scale. At a fine scale, the sliding window is small, and the pixels within the window mainly belong to the same yarn or its adjacent areas. The local standard deviation of the normal area is small because the texture changes within the window are not significant. In this case, a small sensitivity coefficient is needed to effectively distinguish between normal and abnormal. At a coarse scale, the sliding window is large, and the window may cover various tissue structures and texture regions. The local standard deviation of the normal area is large because the texture changes within the window are rich. In this case, a larger sensitivity coefficient is needed to avoid misjudging normal texture changes as defects.

[0127] For example, at a fine scale, with a window of approximately 60×60 pixels and a sensitivity coefficient of 2, at a certain sliding position, the local mean of the significant deviation value within the window is 0.65, and the local standard deviation is 0.15. Therefore, the significance threshold is 2×0.15+0.65=0.95. If the significant deviation value at the center of the window is 1.2, which is greater than 0.95, then that position is considered a candidate defect at the fine scale. If the local mean at another sliding position is 0.6, and the local standard deviation is 0.12, the significance threshold is 2×0.12+0.6=0.84. Since the significant deviation value at that position is 0.8, which is less than 0.84, that position is not considered a candidate defect.

[0128] At the mesoscale, with a window of approximately 100×150 pixels and a sensitivity coefficient of 3, if the same candidate defect location is within the mesoscale window, the local mean is 0.7 and the local standard deviation is 0.2. Because the window is larger and contains more texture variations, the standard deviation is larger. The significance threshold is 3×0.2+0.7=1.3. The significance value of the deviation at this location is 1.2, which is less than 1.3, so it is not detected at the mesoscale. This means that the defect may be a very localized yarn-level defect, such as fly waste, whose influence range does not exceed the coverage of the fine-scale window, and therefore it is diluted by normal texture in the larger window at the mesoscale. At the coarse scale, with a window of approximately 300×450 pixels and a sensitivity coefficient of 4, the local mean at this location within the coarse-scale window is 0.72 and the local standard deviation is 0.25. The significance threshold is 4×0.25+0.72=1.72. The significance value of the deviation at this location is 1.2, which is much less than 1.72, so it is also not detected at the coarse scale.

[0129] A location detected at only a single scale may fall into two categories: either the actual defect genuinely affects only that single scale, such as very small fly waste, or random noise accidentally generates a high deviation significance value at that scale. These two scenarios are difficult to distinguish based solely on single-scale detection results. However, if a location is a genuine defect, its physical presence will typically generate detectable signals at both its principal and adjacent scales. Even small defects at the yarn level will still result in higher local statistical characteristics within a slightly larger analysis window due to the presence of the defect signal. Random noise, on the other hand, typically does not exhibit this consistency across different scales. The noise signal is described by different local statistical characteristics within windows at different scales, making it unlikely to trigger thresholds simultaneously at two independent scales. Therefore, when a location is detected at two different scales, it can be confirmed as a genuine defect with a high degree of confidence.

[0130] When a candidate defect is detected at two different scales, the corresponding location is confirmed as a defect region; otherwise, it is eliminated. That is, a defect is confirmed only if it is detected at at least two scales, and it is eliminated if it is detected only at a single scale. Taking the location detected at the aforementioned fine scale as an example, the deviation significance is 1.2 and the significance threshold is 0.95. This location is detected at the fine scale, but not at the medium and coarse scales. The thresholds for the medium scale are 1.3 and for the coarse scale are 1.72. Since this location is detected only at one scale, it does not meet the condition of being detected at two different scales. Therefore, this location is eliminated and is not a defect region. This elimination result is reasonable. Although the deviation significance value of this location exceeds the threshold of the fine scale, the extent of the exceedance is limited, and it may only be a local clustering effect of normal process fluctuations in the fine scale window.

[0131] Taking another location as an example, the deviation significance value of this location is 2. At the fine scale, the local mean is 0.65, the local standard deviation is 0.15, the sensitivity coefficient is 2, and the significance threshold is 0.95. Since 2 > 0.95, it is detected. At the meso scale, the local mean is 0.7, the local standard deviation is 0.2, the sensitivity coefficient is 3, and the significance threshold is 1.3. Since 2 > 1.3, it is also detected. This location is detected at both different scales, which meets the confirmation criteria and is confirmed as a defect area. This confirmation result is reasonable. The deviation significance value of this location exceeds not only the fine-scale threshold but also the meso-scale threshold, indicating that the abnormal deviation at this location has sufficient amplitude and spatial range, and is unlikely to be a random noise effect.

[0132] Taking warp breakage as an example, warp breakage causes the warp yarn continuity to be interrupted, exposing the weft yarn at the breakage location. This results in a continuous and significant deviation between the actual texture and the expected texture. The significance value of this deviation is 4. At a fine scale, the significance threshold is 0.95, and 4 is much greater than 0.95, so it is detected. At a medium scale, the significance threshold is 1.3, and 4 is much greater than 1.3, so it is also detected. At a coarse scale, the significance threshold is 1.72, and 4 is much greater than 1.72, so it is also detected. This location is detected at all three scales, meeting the confirmation criteria, and is confirmed as a defect area. When confirming the spatial range of this defect area, the detection window range of the coarsest scale among all the scales that detected this location is used to define the spatial range of the defect area. The coarse-scale window has the largest coverage area and can completely include the area affected by the warp breakage defect.

[0133] By binding the analysis scale to the physical structural parameters of the fabric, the detection targets at each scale have a clear physical correspondence, avoiding the subjectivity of manually setting the analysis scale. This allows for high sensitivity in capturing minute yarn-level defects at fine scales, while lower sensitivity at coarse scales avoids misjudging large-scale normal texture changes as regional defects. While suppressing false detections, it retains the ability to detect different types of defects. For defects with a large spatial range, such as oil stains and slurry spots, these defects will be detected at both fine and medium scales, meeting the confirmation criteria. For structural defects with a medium spatial range, such as skipped patterns and weft shrinkage, these defects will be detected at both fine and medium scales, also meeting the confirmation criteria. For yarn-level defects with a small spatial range, such as warp breaks and weft breaks, although the spatial range of the defect is small, the deviation significance value it causes is usually very high because there is a significant and continuous deviation between the actual texture and the expected texture, so that the defect can trigger the threshold at both fine and medium scales, meeting the confirmation criteria. Only single-scale false detections caused by random noise are eliminated because noise signals lack cross-scale consistency.

[0134] The confirmed defect area includes the spatial coordinates of each defect location and its scale information. The spatial coordinates identify the precise location of the defect on the fabric surface; the scale information indicates the scale at which the defect was detected, reflecting the physical size level of the defect; defects detected at a fine scale are yarn-level defects, those detected at a medium scale are weave-level defects, and those detected at a coarse scale are area-level defects. This information can be directly used for defect statistics and classification in fabric quality assessment.

[0135] Example 2

[0136] like Figure 3 As shown, this embodiment provides a visual inspection system for fabric defects in weaving equipment, including a priori module, an acquisition module, a comparison module, and an inspection module.

[0137] The prior module is used to obtain the process parameters of the fabric corresponding to the weaving equipment, in order to determine the sinking and floating relationship of the warp and weft yarns and calculate the normal vector distribution of the fabric surface. Based on the lighting parameters and imaging parameters, the expected texture feature distribution of the fabric is calculated, and the prediction uncertainty of each position is determined based on the fluctuation range of the process parameters.

[0138] The acquisition module is used to acquire actual images of the fabric surface and extract the corresponding actual texture feature distribution during the operation of the weaving equipment.

[0139] The comparison module is used to calculate the feature deviation between the actual texture feature distribution and the expected texture feature distribution position by position, and determine the deviation significance map after normalization based on the predicted uncertainty distribution;

[0140] The detection module is used to perform multi-scale anomaly region detection on the deviation significance map, determine defects based on the local statistical features of each scale, and output the defect region by fusing the determination results of different scales.

[0141] The above description is merely a preferred embodiment of this application. The scope of protection of this application is not limited to the above embodiments. All technical solutions falling within the scope of this application's concept are within the scope of protection of this application. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of this application should also be considered within the scope of protection of this application.

Claims

1. A method for visual inspection of fabric defects in weaving equipment, characterized in that, include: The process parameters of the fabric corresponding to the weaving equipment are obtained to determine the relationship between the warp and weft yarns and calculate the normal vector distribution of the fabric surface. The expected texture feature distribution of the fabric is calculated based on the lighting parameters and imaging parameters. The prediction uncertainty distribution is determined based on the fluctuation range of the process parameters. During the operation of the weaving equipment, the actual image of the fabric surface is acquired and the corresponding actual texture feature distribution is extracted; The feature deviation between the actual texture feature distribution and the expected texture feature distribution is calculated position by position, and the deviation significance map is determined after normalization based on the prediction uncertainty distribution. Multi-scale anomaly detection is performed on the deviation significance map. Defects are determined based on the local statistical features of each scale, and the determination results of different scales are fused to output the defect area.

2. The method for visual inspection of fabric defects in weaving equipment according to claim 1, characterized in that, The process parameters include weave diagram, warp density, weft density, and yarn parameters. The calculation of the expected texture feature distribution of the fabric includes: The lifting height of the upper yarn relative to the lower yarn at each interlacing point is determined based on the sinking and floating relationship of the warp and weft yarns, and the spacing between adjacent interlacing points is determined by combining the warp density and weft density. The buckling waveform of the warp and weft yarns in the fabric is then calculated. The three-dimensional geometry of the fabric surface is constructed by sweeping along the buckling waveform with the cross-sectional shape of the yarn. The three-dimensional geometry is then discretized and sampled to obtain the normal vector distribution of the fabric surface. Based on the normal vector distribution, the incident angle and reflection angle at each sampling point on the fabric surface are calculated by combining the lighting parameters and imaging parameters. The light intensity reflected to the camera direction at each sampling point is calculated by combining the reflection characteristics of the yarn material in the yarn parameters, so as to obtain the reflected light intensity distribution on the fabric surface. By combining imaging parameters to perform imaging degradation processing on the reflected light intensity distribution, the expected fabric image is obtained, and the expected texture feature distribution is obtained after extracting texture features.

3. The method for visual inspection of fabric defects in weaving equipment according to claim 2, characterized in that, The relationship between the sinking and floating of the warp and weft yarns is obtained by determining the positional relationship of the warp and weft yarns at each interlacing point according to the weave diagram, and the lifting height is determined according to the cross-sectional shape of the lower yarn at the corresponding interlacing point. The sweeping along the buckling waveform with the cross-sectional shape of the yarn involves sweeping through the natural cross-sectional shape of the yarn in the non-interlacing area, and determining the compressed cross-sectional shape in the interlacing area based on the compression relationship between the warp and weft yarns, and then using the compressed cross-sectional shape to replace the natural cross-sectional shape for sweeping.

4. The method for visual inspection of fabric defects in weaving equipment according to claim 2, characterized in that, The determination of the prediction uncertainty distribution is obtained by determining the variation range of the expected texture features at each sampling point due to the fluctuation range of process parameters.

5. The method for visual inspection of fabric defects in weaving equipment according to claim 2, characterized in that, The extraction of the corresponding actual texture feature distribution includes: Based on the weave diagram, the repeating units of the fabric weave structure are determined, and the warp and weft dimensions of the repeating units, as well as the actual directions of the warp and weft, are determined in combination with the warp density and weft density. The dimensions of the extraction window are determined by the warp and weft dimensions, and the actual directions of the warp and weft are determined by the direction of the extraction window. Within each extraction window, the window area is divided into a warp tissue point area, a weft tissue point area, and a cross transition area according to the tissue diagram; The actual image is divided into windows according to the extraction window, and the corresponding local texture features are extracted in each window area. The actual texture feature distribution is obtained by combining them according to their spatial location.

6. The method for visual inspection of fabric defects in weaving equipment according to claim 5, characterized in that, The determination of the significance map of the deviation includes: The deviation value of each feature component between the actual texture feature distribution and the expected texture feature distribution is calculated position by position to obtain the feature deviation; Divide the feature bias by the prediction uncertainty at the corresponding position to obtain the significance of the bias of each feature component after normalization; The deviation significance of each feature component at each location is synthesized to obtain the deviation significance at the corresponding location. The deviation significance of each location is arranged according to spatial position to obtain the deviation significance map.

7. The method for visual inspection of fabric defects in weaving equipment according to claim 6, characterized in that, The deviation value calculated for each feature component position by position is the absolute value of the difference between the actual texture feature and the expected texture feature at the same position and the same feature component. The process of synthesizing the deviation significance of each feature component at each position involves taking the maximum value of the deviation significance among the normalized feature components as the deviation significance at the corresponding position.

8. The method for visual inspection of fabric defects in weaving equipment according to claim 7, characterized in that, The output defect region includes: The scale is determined based on the process parameters. At each scale, the deviation significance map is traversed by a sliding window of the corresponding scale size. The local statistical characteristics of the deviation significance within the sliding window are calculated to determine the significance threshold. When the deviation within the sliding window is greater than the significance threshold, the corresponding position is identified as a candidate defect at the corresponding scale. Check the detection results of each candidate defect at different scales. When a candidate defect is detected at both different scales, the corresponding location is confirmed as a defect area; otherwise, it is removed.

9. The method for visual inspection of fabric defects in weaving equipment according to claim 8, characterized in that, The determination of scale based on process parameters is to determine the fine scale by the cross-sectional dimensions in the yarn parameters, the medium scale by the dimensions of the repeating units in the weave diagram, and the coarse scale by the combined dimensions of multiple repeating units. The local statistical features include the local mean and the local standard deviation. The significance threshold is the product of the sensitivity coefficient corresponding to the scale and the local standard deviation, plus the local mean. The sensitivity coefficient corresponding to the scale increases linearly with the scale.

10. A visual inspection system for fabric defects in weaving equipment, used to implement the visual inspection method for fabric defects in weaving equipment according to any one of claims 1-9, characterized in that, include: Prior module, acquisition module, comparison module and detection module; The prior module is used to obtain the process parameters of the fabric corresponding to the weaving equipment, in order to determine the sinking and floating relationship of the warp and weft yarns and calculate the normal vector distribution of the fabric surface. Based on the lighting parameters and imaging parameters, the expected texture feature distribution of the fabric is calculated, and the prediction uncertainty of each position is determined based on the fluctuation range of the process parameters. The acquisition module is used to acquire actual images of the fabric surface and extract the corresponding actual texture feature distribution during the operation of the weaving equipment. The comparison module is used to calculate the feature deviation between the actual texture feature distribution and the expected texture feature distribution position by position, and determine the deviation significance map after normalization based on the predicted uncertainty distribution; The detection module is used to perform multi-scale anomaly region detection on the deviation significance map, determine defects based on the local statistical features of each scale, and output the defect region by fusing the determination results of different scales.