A method and system for measuring fabric texture parameters

By setting up multiple density measurement channels and image processing technology, the fabric type is identified and the warp and weft yarn values ​​are calculated, which solves the problems of low efficiency and poor accuracy in traditional fabric density measurement and achieves efficient and accurate fabric density measurement.

CN121661043BActive Publication Date: 2026-05-29ZHEJIANG SCI-TECH UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG SCI-TECH UNIV
Filing Date
2026-02-04
Publication Date
2026-05-29

Smart Images

  • Figure CN121661043B_ABST
    Figure CN121661043B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of woven fabric density detection of image analysis, in particular to a fabric structure parameter measurement method and system, which comprises the following steps: setting multiple types of density measurement channels, the types including a solid color channel, a stripe channel and a printed fabric channel; obtaining a to-be-measured fabric sample image, and preprocessing the to-be-measured fabric sample image to obtain a sample label; determining a matched type in the multiple density measurement channels according to the sample label; calculating the warp and weft yarn values corresponding to the to-be-measured fabric sample image based on the determined matched type, and converting the warp and weft yarn values according to preset parameters to calculate the warp and weft parameter values of the to-be-measured fabric sample image under a standard length. The application sets multiple types of density measurement channels, can effectively overcome the interference problem in the traditional method when processing different types of woven fabrics (such as solid color fabrics, stripe fabrics and printed fabrics), and improves the efficiency and accuracy of density measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of fabric density detection using image analysis, and in particular to a method and system for measuring fabric structure parameters. Background Technology

[0002] Fabric density is one of the important indicators for measuring fabric quality and performance. Common density indicators include warp density and weft density. Traditional fabric density measurement methods usually rely on manual yarn counting, which is not only inefficient but also easily affected by human factors. In addition, traditional measurement methods cannot be adapted to different fabric types (such as solid colors, stripes, prints, etc.), thus leading to inaccurate measurements in complex fabric structures.

[0003] In recent years, image analysis-based fabric density detection methods have gradually become a research hotspot. These methods can automatically extract the texture features of fabrics through image processing techniques, thereby realizing the calculation of fabric density.

[0004] However, existing methods are often affected by complex texture patterns when processing striped and printed fabrics, leading to a significant reduction in the accuracy and stability of density measurements. Therefore, employing different processing methods for different types of woven fabrics is crucial for improving the accuracy and practicality of image analysis techniques. Summary of the Invention

[0005] This invention proposes a method and system for measuring fabric structure parameters, which can automatically identify fabric types and apply different calculation methods according to different types of fabrics, so as to overcome the shortcomings of existing technologies and achieve efficient and accurate fabric density measurement.

[0006] In a first aspect, this application provides a method for measuring the structural parameters of a fabric, employing the following technical solution:

[0007] A method for measuring fabric structure parameters includes the following steps:

[0008] Multiple types of density detection channels are set up, including solid color channels, stripe channels, and print channels;

[0009] Acquire an image of the fabric sample to be tested, and preprocess the image to obtain sample labels;

[0010] The matching type is determined in several density detection channels based on the sample labels;

[0011] Based on the determined matching type, the warp and weft yarn values ​​corresponding to the fabric sample image to be tested are calculated, and the warp and weft yarn values ​​are converted according to preset parameters to calculate the warp and weft parameter values ​​of the fabric sample image under standard length.

[0012] By adopting the above technical solutions and setting up multiple types of density measurement channels, the interference problems in traditional methods can be effectively overcome when dealing with different types of woven fabrics (such as solid color fabrics, striped fabrics, and printed fabrics), thereby improving the efficiency and accuracy of density measurement.

[0013] In one embodiment, the image of the fabric sample to be tested is preprocessed to obtain sample labels, including the following steps:

[0014] Calculate the preprocessed image of the fabric sample to be tested to obtain the density channel parameters, compare the density channel parameters with a preset type threshold, and determine whether the density channel parameters meet the preset type threshold.

[0015] If the density measurement channel parameters meet the preset type threshold, the sample image to be tested is determined to be a solid color, and the sample label is set to a solid color label.

[0016] If the density measurement channel parameters do not meet the preset type threshold, then the sample image to be tested is subjected to a two-dimensional Fourier transform to obtain a spectrum image.

[0017] Based on the spectral image, obtain spectral periodic features and determine whether the spectral periodic features meet the preset stripe conditions;

[0018] If the spectral periodicity feature meets the preset stripe condition, the sample image to be tested is determined to be stripe type, and the sample label is set as stripe label;

[0019] If the spectral periodicity features do not meet the preset stripe conditions, the fabric sample image to be tested is determined to be a printed type, and the sample label is set as a printed label.

[0020] By adopting the above technical solution, the density channel parameters of the fabric sample image to be tested are calculated, and the density channel parameters are compared with the preset type threshold. Based on the density channel parameters, it is determined whether the fabric sample image to be tested is a solid color. If so, the fabric sample image to be tested is determined to be a solid color. If the spectral periodic characteristics meet the preset stripe conditions, the fabric sample image to be tested is determined to be a stripe. In this way, the type of the fabric sample image to be tested can be accurately determined, which facilitates the subsequent accurate calculation of the density measurement of the fabric sample image to be tested.

[0021] In one embodiment, the warp and weft yarn values ​​corresponding to the fabric sample image to be tested are calculated based on the matching density measurement channel, including the following steps:

[0022] Based on a preset scale set, wavelet convolution is performed on the updated sample image to be tested to obtain a scale response set, which includes at least the variance scale response.

[0023] The objective function corresponding to each element is calculated based on the scale response set, and the target scale is obtained based on the constraints.

[0024] The target scale is determined based on the scale discrimination condition to obtain the warp and weft yarn values ​​corresponding to the fabric sample image to be tested.

[0025] In one embodiment, the target scale is determined based on a scale discrimination condition, including the following steps:

[0026] The image of the fabric sample to be tested is divided into several grid units according to a preset ratio, and the peak detection parameters and peak detection indices corresponding to the grid units are calculated in sequence.

[0027] The peak detection index is normalized to generate a quality score, and the grid cell is updated based on the quality score.

[0028] The peak detection parameters and the updated grid cells are used to perform weighted fusion to obtain the warp and weft yarn values ​​corresponding to each grid cell.

[0029] In one embodiment, wavelet convolution is performed on the updated fabric sample image to be tested based on a preset scale set, wherein updating the fabric sample image to be tested further includes the following steps:

[0030] When the fabric sample image to be tested is determined to be striped, the main lobe of the stripes is determined for the fabric sample image to be tested, and the Gaussian parameters are determined based on the spectrum image;

[0031] A pair of Gaussian notch filters are constructed based on the Gaussian parameters to obtain a suppressed main lobe image, and the suppressed main lobe image is inversely transformed to update the test pattern image.

[0032] In one embodiment, before performing wavelet convolution on the updated sample image to be tested based on a preset scale set, the following steps are also included:

[0033] When the fabric sample image to be tested is determined to be a printed type, the fabric sample image to be tested is divided into regions based on K-means clustering and texture feature extraction technology to obtain interference regions;

[0034] The interference area is removed from the fabric sample image to obtain a defect pattern, and the defect pattern is repaired based on the structure-first repair technique to update the fabric sample image.

[0035] In one embodiment, after calculating the warp and weft parameter values ​​of the fabric sample image at a standard length, the following steps are also included:

[0036] After calculating the warp and weft parameters of the fabric sample image to be tested, a quality inspection traceability signal is generated, and the quality inspection traceability interface is entered based on the quality inspection traceability signal.

[0037] The latitude and longitude parameter values ​​are normalized to generate standard feature vectors, and the weighted results corresponding to the grid cells are obtained based on the weighted model and the standard feature vectors.

[0038] The weighted result is compared with the weighted threshold to obtain the detection result corresponding to the grid cell.

[0039] In one embodiment, the weighted result is compared with the weighted threshold, wherein the weighted threshold is obtained by the following steps:

[0040] Automatic weighting results are obtained based on the image of the fabric sample to be tested, and the weighting threshold is obtained based on the acceptance of the entered labels.

[0041] In one embodiment, after comparing the weighted result with a weighted threshold to obtain the detection result corresponding to the grid cell, the method further includes the following step:

[0042] Set trigger conditions, and determine whether the trigger conditions are met based on the weighted results and the detection results;

[0043] If the triggering conditions are met, the corresponding processing steps are determined based on the weighted result and the detection result.

[0044] Secondly, this application provides a system for measuring the structural parameters of a fabric, employing the following technical solution:

[0045] A system for measuring fabric structure parameters, performing the method for measuring fabric structure parameters as described in the first aspect, includes:

[0046] The channel setting module is used to set multiple types of density testing channels, including solid color channels, stripe channels, and pattern channels.

[0047] An image processing module is used to acquire an image of the fabric sample to be tested and to preprocess the image of the fabric sample to obtain a sample label.

[0048] A type matching module is used to determine the matching type in several density detection channels based on the sample label;

[0049] The parameter processing module is used to calculate the warp and weft yarn values ​​corresponding to the fabric sample image to be tested based on the determined matching type, and to convert the warp and weft yarn values ​​according to preset parameters to calculate the warp and weft parameter values ​​of the fabric sample image to be tested at the standard length.

[0050] In summary, this application includes at least one of the following beneficial technical effects:

[0051] 1. Setting up multiple density measurement channels can effectively overcome the interference problems in traditional methods when dealing with different types of woven fabrics (such as solid color fabrics, striped fabrics, and printed fabrics), thereby improving the efficiency and accuracy of density measurement;

[0052] 2. Calculate the density channel parameters of the fabric sample image to be tested, compare the density channel parameters with the preset type threshold, and determine whether the fabric sample image to be tested is a solid color based on the density channel parameters. If it is, the fabric sample image to be tested is determined to be a solid color. If the spectral periodic characteristics meet the preset stripe conditions, the fabric sample image to be tested is determined to be a stripe. This allows for accurate determination of the type of the fabric sample image to be tested, which is convenient for subsequent accurate calculation of the density measurement of the fabric sample image to be tested. Attached Figure Description

[0053] Figure 1 This is a block diagram of a method for measuring fabric structure parameters provided in an embodiment of this application;

[0054] Figure 2 This is a flowchart illustrating the specific process of generating sample labels provided in this application embodiment;

[0055] Figure 3 This is a flowchart illustrating the generation of warp and weft yarn values ​​using a solid color channel, as provided in an embodiment of this application.

[0056] Figure 4 This is a schematic diagram of the scale and variance V provided in the embodiments of this application;

[0057] Figure 5 This is a flowchart of ROI mesh and weighted fusion provided in an embodiment of this application;

[0058] Figure 6 This is a flowchart illustrating the generation of warp and weft yarn values ​​via stripe channels, as provided in an embodiment of this application.

[0059] Figure 7 This is a flowchart illustrating the generation of warp and weft yarn values ​​through the printing channel, as provided in an embodiment of this application.

[0060] Figure 8 This is a schematic diagram of the quality inspection and traceability process provided in the embodiments of this application;

[0061] Figure 9 This is a schematic diagram of the overall system configuration and signal flow provided in the embodiments of this application. Detailed Implementation

[0062] To better understand the purpose, technical solutions, and advantages of this application, it has been described and illustrated below with reference to the accompanying drawings and embodiments. However, those skilled in the art should understand that this application can be implemented without these details. In some cases, to avoid obscuring various aspects of this application due to unnecessary description, well-known methods, processes, systems, components, and / or circuits already described at a higher level will not be elaborated upon. It will be apparent to those skilled in the art that various modifications can be made to the embodiments disclosed in this application, and the general principles defined in this application can be applied to other embodiments and application scenarios without departing from the principles and scope of this application. Therefore, this application is not limited to the illustrated embodiments, but conforms to the broadest scope consistent with the scope of protection claimed in this application.

[0063] This application discloses a method for measuring fabric structure parameters, which is applied to a fabric structure parameter measurement system. The system includes a processor for acquiring images of the fabric sample to be measured and performing data processing based on the images to obtain corresponding warp and weft parameter values.

[0064] like Figure 1 As shown, the method for measuring fabric structure parameters includes the following steps:

[0065] S100, with multiple types of encryption channels.

[0066] The fabric structure parameter measurement system includes multiple types of density measurement channels, including solid color channels, stripe channels, and print channels. The solid color channel is used to calculate the warp and weft yarn values ​​for solid color fabrics, the stripe channel is used to calculate the warp and weft yarn values ​​for striped fabrics, and the print channel is used to calculate the warp and weft yarn values ​​for printed fabrics.

[0067] It should be noted that the various density detection channels are distinguished based on system-defined type labels. In this embodiment, the type label fabric_type ∈ {plain, stripe, print} corresponds to solid color, stripe, and print types, respectively.

[0068] S200: Acquire the image of the fabric sample to be tested, and preprocess the image of the fabric sample to obtain the sample label.

[0069] Among them, the fabric sample image to be tested refers to the fabric sample image for which the tissue structure parameters need to be determined. The processor can directly acquire the fabric sample image to be tested by an industrial camera and lens under uniform geometric conditions, or it can directly receive the fabric sample image to be tested input by humans. There are no further restrictions here.

[0070] It should be noted that the manually input images of the fabric samples to be tested are also images obtained using industrial cameras and lenses. Industrial cameras and lenses can provide stable illumination and support lighting control such as brightness / duty cycle, thus enabling the acquisition of images of the fabric samples to be tested with standard light sources.

[0071] In addition, after receiving the original image of the fabric sample to be tested, the processor needs to preprocess the image to obtain the preprocessed image I. In order to more accurately identify the type of the current fabric sample image to be tested, the original image needs to be converted to grayscale and denoised (optional bilateral filtering, non-local mean or median filtering).

[0072] It should be noted that the pixel-physical ratio coefficient k is obtained through a calibration board / ruler, and the original acquisition data such as exposure, gain, white balance, light source brightness, and working distance are saved. In a preferred embodiment, without limiting specific brands and models, operable engineering conditions are proposed for imaging and illumination to ensure that the quality of the underlying data meets the algorithm stability requirements: For the camera, an imaging device with an effective resolution of at least 1920×1080 is preferred, along with a fixed focal length lens and a fixed working distance to reduce batch variations in geometric distortion. Exposure and white balance are locked before acquisition to reduce brightness and chromaticity fluctuations. For illumination, a uniform diffuse surface light source or a coaxial ring light source is preferred to suppress directional shadows and highlights. If necessary, a polarizing filter is placed in front of the light source or lens to weaken local saturation caused by specular reflection. The fabric sample is fixed flat on the acquisition plane with a frame or glass plate to avoid wrinkles and warping causing systematic shifts in the latitude and longitude projection peaks. The aforementioned equipment and lighting configuration take into account both general availability and cost, and also meet the comprehensive requirements of texture detail separability, measurement repeatability and cross-batch consistency in this embodiment, thereby providing a stable and reliable input foundation for subsequent type identification and density calculation.

[0073] Furthermore, an ideal lens should project straight lines from the real world as straight lines in the image. However, due to design and manufacturing limitations of lenses (especially wide-angle and inexpensive lenses), light bends as it passes through the lens, causing straight lines in the image to bend and object edges to be stretched or compressed. Therefore, lens distortion parameters are needed to quantify the degree of this distortion. These parameters are calibrated once during line construction and corrected in preprocessing. When the equipment or working distance changes, a recalibration process can be automatically triggered to ensure the timeliness and cross-batch comparability of k. The selection of the scaling factor k is set according to specific circumstances, which will not be elaborated on here.

[0074] Subsequently, contrast-limited adaptive histogram equalization is performed to improve texture separability, and flat-field correction is applied when necessary to eliminate large-scale illumination unevenness. Orientation correction is then performed using Hough transform or principal direction statistics to make the principal latitude and longitude directions more horizontal / vertical, reducing angular errors in subsequent projection. Finally, a grayscale image with statistical characteristics of grayscale variance and orientation consistency of C is output.

[0075] It's important to note that image grayscale conversion transforms a color image into a single-channel grayscale image to simplify subsequent calculations. Existing techniques are used for image grayscale conversion, which will not be elaborated upon here. After grayscale conversion, each pixel value represents its brightness.

[0076] During image acquisition, noise may affect image quality, especially in low-light environments. This embodiment uses median filtering to preserve edges and suppress noise; the specific formula is as follows:

[0077] ;

[0078] Here, N(x, y) represents the 3×3 or 5×5 neighborhood around the current pixel. When the estimated density of salt-and-pepper noise points exceeds 1%, 5×5 is preferred. In areas with weak texture, a slight smoothing can be performed using a bilateral filter with small parameters before median filtering to suppress quantization noise and specular graininess.

[0079] Histogram equalization enhances the contrast of grayscale images, especially in low-contrast regions, ensuring that details are fully preserved. Histogram equalization adjusts the distribution of grayscale values, making the contrast more uniform and improving the visual appeal of the grayscale image.

[0080] For samples with narrow grayscale dynamic range or uneven illumination, perform histogram equalization: set grayscale levels The probability of occurrence is as follows:

[0081]

[0082] Its cumulative distribution is as follows:

[0083] ;

[0084] Using the above formula Mapped to Contrast stretching is implemented. Optionally, to suppress edge noise diffusion caused by over-enhancement, a contrast-limited adaptive equalization (CLAHE) is used, with its mesh size and clipping threshold determined empirically or through a small-sample mesh search.

[0085] In one implementation, a linear Hough transform is performed in the edge domain to address the possibility that the yarn direction in the grayscale image may be tilted due to an incorrect shooting angle. To ensure the accuracy of subsequent analysis results, the Hough transform is used to correct the orientation of the grayscale image, as shown in the following formula:

[0086] ;

[0087] The angle θ of the cumulative spatial peak value of Hough was calculated, and the image was rotated by -θ to align the latitude and longitude directions with the image coordinate axes as much as possible. To suppress the influence of isolated line segments and noise, the cumulative threshold was set to 30% to 50% of the maximum cumulative value, and non-maximum suppression (NMS) was used for peak purification.

[0088] It should be noted that the preprocessing module outputs a preprocessed image I containing the equalization and orientation correction results, along with an edge map E, a background mask mask_bg, and a correction angle rect_angle, for subsequent type recognition and channel processing.

[0089] Combination Figure 2 In one embodiment, the image of the fabric sample to be tested is preprocessed to obtain sample labels, including the following steps:

[0090] S210, calculate the preprocessed sample image to be tested to obtain the density channel parameters, compare the density channel parameters with the preset type threshold, and determine whether the density channel parameters meet the preset type threshold.

[0091] S220, if the density channel parameters meet the preset type threshold, the sample image to be tested is determined to be a solid color, and the sample label is set to a solid color label.

[0092] S230, if the density measurement channel parameters do not meet the preset type threshold, then perform a two-dimensional Fourier transform on the sample image to be measured to obtain a spectrum image.

[0093] S240: Obtain spectral periodicity features based on the spectral image and determine whether the spectral periodicity features meet the preset stripe conditions.

[0094] S250, if the spectral periodic characteristics meet the preset stripe conditions, the sample image to be tested is determined to be striped, and the sample label is set as stripe label.

[0095] S260, if the spectral periodic characteristics do not meet the preset stripe conditions, the sample image to be tested is determined to be a printed type, and the sample label is set as a printed label.

[0096] The density measurement channel parameters include grayscale variance and directional consistency, and the preset type thresholds include variance threshold and consistency threshold. The variance threshold and consistency threshold are set according to actual conditions, and will not be elaborated upon here. Specifically, for the density measurement channel parameters to meet the preset type thresholds, the grayscale variance must be lower than the variance threshold and the directional consistency must be higher than the consistency threshold.

[0097] A spectral image is an image generated by performing a two-dimensional Fourier transform on a preprocessed image of the fabric sample to be tested. The specific details of how to perform the two-dimensional Fourier transform are based on existing technology and will not be elaborated upon here. Spectral periodicity characteristics refer to the spectral structure and direction angle. Preset stripe conditions refer to paired narrow-band periodic peaks and an estimable stripe direction angle. Only when a paired narrow-band periodic peak is found at the center of the amplitude spectrum based on the spectral image, and the stripe direction angle can be estimated, is the fabric sample image determined to be a striped type; otherwise, it is determined to be a printed type.

[0098] To obtain more accurate measurement data of fabric structure parameters, it is necessary to accurately identify the type of the fabric sample image to be tested. Therefore, fabric type identification is an important step in this application. The fabric type is accurately determined from the sample image to be tested—whether it is solid color, striped, or printed—and an appropriate calculation method is selected based on the type.

[0099] Combination Figure 3 It should be noted here that solid-color fabrics typically have a uniform color and do not contain complex patterns or textures. To determine whether a fabric is solid-color, this embodiment calculates the grayscale variance of the preprocessed image I. If the grayscale variance of the preprocessed image I is less than the variance threshold, the fabric is considered solid-color. The variance calculation formula is:

[0100] ;

[0101] in, To preprocess the grayscale values ​​of image I, The mean of the preprocessed image I, The variance is used. If the variance is less than a set threshold, the fabric is considered to be a solid color.

[0102] A significant characteristic of striped fabrics is their obvious periodicity in frequency. Therefore, when the density measurement channel parameters do not meet the variance threshold, this embodiment uses Fourier transform to perform spectral analysis on the preprocessed image I to detect the presence of periodic components in the spectrum. The Fourier transform converts the preprocessed image I from the spatial domain to the frequency domain, examining the amplitude spectrum |F(u,v)|. If a set of narrow-band periodic peaks symmetrically distributed around the center of the spectrum exists in a certain direction, it is determined to be a striped fabric. To avoid interference between DC and low-frequency illumination, a protective ring is set at the center, with a radius of 5% to 8% of Nyquist, and peak arrays are searched in the outer ring region. The angle between the peak array and the horizontal direction is used to obtain the estimable stripe direction angle. The estimable stripe direction angle is understood according to existing technology and will not be elaborated further here. Only when the amplitude spectrum center is determined to have a pair of narrow-band periodic peaks and the stripe direction angle can be estimated, is the tested fabric image determined to be striped; otherwise, it is determined to be a printed type.

[0103] The Fourier transform formula is as follows:

[0104] ;

[0105] Where f(x, y) represents the image's spatial domain pixels, and F(u, v) represents the frequency domain representation. By analyzing the spectral periodic characteristics in the spectral image, it can be determined whether the fabric is striped.

[0106] In one implementation, to avoid misjudging uniform base fabric as printed fabric, a local directional consistency index (such as the structural tensor eigenvalue ratio or directional gradient concentration) is calculated for suspected base fabric areas. If the consistency index is higher than the consistency threshold, the candidate color block is judged as non-printed.

[0107] The specific steps are as follows: Perform K-means clustering (K=2~5) in the HSV space to obtain several candidate color patches. Calculate the Gray-Level Co-occurrence Matrix (GLCM) indices (energy, contrast, entropy, inverse moment, correlation, etc.) within each candidate patch. When the proportion of high-contrast / high-entropy color patches exceeds a preset threshold, it is determined to be a printed patch. This threshold can be set according to the actual situation; for example, it can be set to 80%.

[0108] S300 determines the matching type in several density measurement channels based on the sample label.

[0109] It's important to note that when the sample label is a solid color label, it indicates that the current fabric sample image belongs to the solid color category. In this case, the sample label corresponds to the type label "plain". After obtaining the sample label, the processor generates a solid color determination signal. Based on this signal, the preprocessed fabric sample image is automatically input into the solid color channel for subsequent processing. Similarly, the processor generates stripe labels and printed labels, generates corresponding determination signals for each, and automatically inputs the preprocessed fabric sample image into the corresponding density testing channel based on these signals.

[0110] It should be noted that a corresponding routing signal is generated based on the type label, and the image of the fabric sample to be tested is transmitted to different density measurement channels based on different routing signals.

[0111] S400 calculates the warp and weft yarn values ​​corresponding to the fabric sample image to be tested based on the determined matching type, and converts the warp and weft yarn values ​​according to preset parameters to calculate the warp and weft parameter values ​​of the fabric sample image to be tested at the standard length.

[0112] The preset parameter refers to the pixel-to-physical ratio k. Based on k, the average inter-peak pixel distance dpx is converted into warp density and weft density over a standard length and then output. Specifically, based on the calibrated pixel-to-physical ratio k (mm / pixel or pixel / mm), the average inter-peak pixel distance dpx is converted into physical spacing d = dpx·k, and the warp density and weft density are obtained over a standard length L (preferably 10cm). The output results are bound to the sample number, timestamp, and device parameters to support horizontal comparison and vertical traceability.

[0113] In one embodiment, the warp and weft yarn values ​​corresponding to the fabric sample image to be tested are calculated based on the matching density measurement channel, including the following steps:

[0114] S410, perform wavelet convolution on the updated sample image to be tested based on a preset scale set to obtain a scale response set, the scale response set including at least the variance scale response.

[0115] S420 calculates the objective function corresponding to each element based on the scale response set and obtains the target scale based on the constraints.

[0116] S430 determines the target scale based on scale discrimination conditions to obtain the warp and weft yarn values ​​corresponding to the fabric sample image to be tested.

[0117] Combination Figure 3After determining that it is a solid color channel, Morlet wavelet one-dimensional convolution is performed on the preprocessed fabric sample image along the row and column directions on the preset scale set A to obtain the scale response set. The wavelet response variance-scale curve or energy-signal-noise ratio objective function J(a) is calculated. Under the constraints of minimum peak distance and threshold T, the scale a* that maximizes J(a) is selected as the target scale. The scale discrimination condition is characterized by bimodal or flat-topped peaks. When the curve has bimodal or flat-topped peaks, the target scale is selected based on the ROI peak integrity and SNR, which is then used for subsequent thresholding, skeletonization, and projection peak counting. The warp and weft yarn values ​​are then extracted, and the fabric density is calculated using the grayscale projection method.

[0118] It should be noted that Morlet wavelet transform, as a commonly used time-frequency analysis tool, can provide both time and frequency information simultaneously. In this embodiment, Morlet wavelet is used for multi-scale analysis to extract texture features from fabrics. The optimal scale is selected by calculating the variance of the wavelet transform at different scales. The Morlet wavelet formula is:

[0119] ;

[0120] Where w is the frequency parameter. The optimal scale is selected using the variance curve to ensure accurate extraction of yarn information.

[0121] In another embodiment, For Morlet frequency parameters, the frequency parameters are taken as follows: By performing one-dimensional wavelet convolution along both the row and column directions on the preprocessed image I, the response images of the enhanced meridians and parallels can be obtained.

[0122] Next, let the preset scale set A = {a1, a2, ..., aM}, which can cover the frequency band of the estimated yarn width ±50%. Define the column vector variance for the scale response set corresponding to each scale aj:

[0123] ;

[0124] Where M is the number of scales, and the variance is defined based on the column vector variance:

[0125] ;

[0126] refer to Figure 4A curve of V versus aj is plotted with scale as the horizontal axis, and the optimal scale a* corresponding to the global maximum is taken as the target scale. This criterion still has unimodal discriminability in the presence of noise and slight wrinkles. The response map at the target scale a* is binarized with an adaptive threshold to obtain latitude / longitude candidate lines. Subsequently, skeletonization is performed to preserve the center line of a single pixel. For sporadic holes and short breaks, 3×3 structuring element closing operations and short segment splicing are performed to improve the continuity of the line array.

[0127] It should be noted here that the formula for calculating the threshold is: The preprocessed image I is subjected to horizontal and vertical grayscale projections using a threshold to calculate the warp and weft yarn values. The formulas for horizontal and vertical projections are as follows:

[0128]

[0129] The projected peak corresponds to the yarn center, and the number of peaks approximately equals the number of yarns. Preferably, for and Slight smoothing and moving average were applied, with a window length ≤ 1 / 3 of the estimated yarn spacing, and the calculation was performed using the density of the adaptive threshold striped woven fabric.

[0130] ;

[0131] Where T is the projection threshold, then the peak value is detected, and the adjacent peak distance constraint is set, as shown in the following formula:

[0132] ;

[0133] The intervals are determined by statistical analysis of the training samples (preferably using the mean ± 3σ). Incomplete peaks at the endpoints are corrected using the half-peak counting method, which is an existing technique and will not be elaborated upon here.

[0134] Combination Figure 5 To enhance robustness under complex textures and local defects in the sample image under test, the preprocessed image I is divided into Regions of Interest (ROIs) using an m×n grid. Each ROI is then weighted and fused based on peak integrity, peak SNR, and curve smoothness. In one embodiment, the target scale is determined based on scale discrimination criteria, including the following steps:

[0135] S431, the preprocessed sample image to be tested is divided into several grid units according to a preset ratio, and the peak detection parameters and peak detection indices corresponding to the grid units are calculated in sequence.

[0136] S432 normalizes the peak detection index to generate a quality score and updates the grid cells based on the quality score.

[0137] S433 performs weighted fusion based on peak detection parameters and updated grid cells to obtain the warp and weft yarn values ​​corresponding to each grid cell.

[0138] Among them, the peak detection parameter refers to the inter-peak pixel distance. Peak number Peak detection index refers to peak integrity. Peak signal-to-noise ratio curve smoothness Quality fraction refers to . The default values ​​are α=β=γ=1. Updating mesh cells based on quality score means setting a lower threshold τ to remove obviously abnormal ROIs.

[0139] Normalize the remaining ROIs to obtain their weights: The global results are weighted and merged: The longitude and latitude directions are calculated independently. and Then proceed to pixel-to-physical conversion. If all ROIs are removed due to qi < τ or the weights are excessively concentrated on a few abnormal ROIs, they are marked "re-inspection required". When all ROIs are judged to be abnormal or the weights are excessively concentrated, they are marked "re-inspection required". Finally, the remaining ROIs are weighted and fused, and the fused output is... and The warp and weft yarn values ​​of the preprocessed fabric sample image are calculated.

[0140] In one embodiment, wavelet convolution is performed on the updated fabric sample image to be tested based on a preset scale set. The updating of the fabric sample image to be tested further includes the following steps:

[0141] S411, when the image of the fabric sample to be tested is determined to be striped, the main lobe of the stripes in the image of the fabric sample to be tested is determined, and the Gaussian parameters are determined based on the spectrum image.

[0142] S412 constructs a pair of Gaussian notch filters based on Gaussian parameters to obtain a suppressed main lobe image, and performs an inverse transform on the suppressed main lobe image to update the sample image to be tested.

[0143] The Gaussian parameters include the notch bandwidth σ and the center radius D0. (Refer to...) Figure 5For striped samples, 2D-FFT is performed on the preprocessed image I to accurately locate the main lobe ±(u0,v0) and its side lobes. The notch bandwidth σ and center radius D0 are adaptively determined based on the peak half-width at half-maximum (FWHM). Paired Gaussian notches are constructed to suppress the main peak and side lobes, and a ring low-pass filter can be superimposed to weaken the broad-spectrum noise caused by feathering / highlights. A guard ring is set near DC to avoid excessive attenuation of the background stripe. Inverse transform is used to update the sample image under test, thereby obtaining a striped image.

[0144] Combination Figure 6 When the sample image is determined to be striped, a 2D-FFT is performed on the preprocessed image I to obtain |F(u,v)|. To suppress the influence of DC and low-frequency illumination, a guard ring R0 (with a radius of 5% to 8% of Nyquist) is set at the center. Energy peaks are searched outside the ring band, and symmetry verification (paired peaks about the spectral center) and angular clustering (K=2) are performed. Based on this, the main lobe ±(u0,v0) and orientation angle of the stripes are obtained.

[0145] It should be noted here that the construction of paired Gaussian notch filters is as follows:

[0146] ;

[0147] Where D1 and D2 are the Euclidean distances from (u,v) to ±(u0,v0), and σ is the bandwidth parameter. The Gaussian notch filter specifically adaptively adjusts parameters such as threshold selection, bandwidth estimation, and sidelobe coverage. The specific adjustment rules are as follows: Threshold selection is based on the statistical minimum / maximum amplitude within the ring band (excluding DC), setting T as the candidate bright spot threshold. Bandwidth estimation involves finding the nearest local minimum along the radial direction of the characteristic peak, denoted by distances Dleft and Dright, and taking... Side lobe coverage: σ∈[0.6D0,1.0D0]. When the fringe direction is approximately parallel to the latitude / longitude, a pair of narrower bandwidth notch filters are superimposed radially in ±(u0,v0) to cover side lobe leakage. After multiplying |F| with H, an inverse transform is performed in conjunction with the original phase to obtain the defringe image IdeStripe.

[0148] It should be noted that after performing an inverse transformation on the suppressed main lobe image to update the test pattern image, steps S410-S430 are executed on the updated test pattern image. Since the stripe interference band has been suppressed, the variance-scale curve peak is more prominent, the projection curve is more regular, and the threshold and peak distance constraints are easier to set. Compared with directly counting without removing stripes, the false detection rate is significantly reduced.

[0149] When the spectrum contains broad-spectrum high-frequency noise (such as feathering or high-light reflection), a ring-shaped Gaussian low-pass filter (with a cutoff frequency of 1.1 to 1.2 times the outer edge of the main peak) is superimposed before the notch filter to suppress unstructured interference in the notch filter design. For samples with extremely sparse fringes (main peak close to the origin), the guard ring R0 is appropriately reduced and a smaller σ is used to avoid over-suppression of the latitude and longitude texture.

[0150] In one embodiment, before performing wavelet convolution on the updated sample image to be tested based on a preset scale set, the following steps are also included:

[0151] S413, when the fabric sample image to be tested is determined to be a printed type, the fabric sample image to be tested is divided into regions based on K-means clustering and texture feature extraction technology to obtain interference regions.

[0152] S414, remove interference areas from the fabric sample image to obtain defect patterns, and repair the defect patterns based on the structure-first repair technique to update the fabric sample image.

[0153] Reference Figure 6 Specifically, K-means clustering is performed in HSV space, and contrast is used to weight the localization of printing interference areas. Then, Criminisi, a structure-first approach, is used to reconstruct the texture of the occluded areas based on sample repair. The repair template is preferably 5×5, but can be widened to 7×7 in areas with complex edge textures if necessary. To reduce the brightness gradient and texture abruptness at the repair edges, local histogram matching and edge smoothing are introduced. The Morlet-projection link count from steps S410 to S430 is reused on the repair results to obtain the warp / weft yarn count and dpx, and quality indicators such as the repair pixel ratio Rᵢ are output.

[0154] Combination Figure 7 In one implementation, K-means clustering (K=2~5) is performed in the HSV space to obtain candidate color patches. For each patch, the following are calculated: region area ratio, boundary complexity (perimeter / area), and GLCM indices (energy, contrast, entropy, correlation, inverse moment, etc.). When a color patch has an area ratio exceeding a threshold and exhibits high contrast / high entropy characteristics, the region is marked as a printing interference area. To avoid misjudging the base fabric texture as a print, a local orientation consistency index is further calculated for suspected base fabric areas. Those with high consistency are determined to be non-printed.

[0155] In a preferred embodiment, a structure-first, example-based repair method is employed: a priority is defined for the boundary pixel p to be repaired.

[0156] ;

[0157] Where C(p) is the confidence term (the proportion of known pixels within the template), and D(p) is the data term (the gradient projection intensity along the iso-illuminance line). Each time, the position with the largest P(p) is selected as the center block, the most similar block is searched in the complete region for filling, and the confidence and boundary are updated. This process is iterated until the repair is complete.

[0158] Preferably, the repair template size is 5×5. When the printing obscuration area is large and the structural continuity is weak, it can be temporarily widened to 7×7 in a local stage and then reduced back to 5×5 after completion, in order to balance structural extension and calculation load.

[0159] To minimize repair traces, local histogram matching is preferred before and after block replacement to ensure that the repaired block and its neighbors maintain consistent mean brightness and contrast. A slight Gaussian smoothing (σ = 0.5~1.0 pixels) is applied to the edge bands to achieve a seamless transition. For prints with strong color differences, color normalization (fixed brightness, compressed color) can be performed before repair to reduce matching errors.

[0160] It should be noted that after repairing the defect pattern based on the structure-first repair technique to update the test pattern image, steps S410-S430 are performed on the updated test pattern image. Since the pattern occlusion is replaced by the texture with consistent structure, the variance-scale curve recovers the single-peak discriminability, the projection curve peak column is complete, and the peak SNR and peak spacing stability are significantly improved, thus obtaining a stable warp density / weft density estimate.

[0161] In one implementation, the system writes the following metrics to aux_metrics: repair pixel ratio Average priority Template hit rate (average similarity of most similar block matches) and number of boundary iterations .when Exceeding the limit or If the score remains consistently low, the system will label it as "Insufficient Confidence for Repair / Excessive Print Coverage" and output before-and-after comparison images for manual review. Samples that fail the review will proceed to the "Requires Re-inspection" process.

[0162] In one embodiment, after calculating the warp and weft parameter values ​​of the fabric sample image at a standard length, the following steps are also included:

[0163] S500: After calculating the warp and weft parameter values ​​of the fabric sample image to be tested, a quality inspection traceability signal is generated, and the quality inspection traceability interface is entered based on the quality inspection traceability signal.

[0164] S600 normalizes the latitude and longitude parameter values ​​to generate standard feature vectors, and obtains the weighted results corresponding to the grid cells based on the weighted model and the standard feature vectors.

[0165] S700 compares the weighted result with the weighted threshold to obtain the detection result corresponding to the grid cell.

[0166] The quality inspection traceability signal is generated by the processor to provide a structured summary of the entire process results and intermediate quantities. Once the processor generates the quality inspection traceability signal based on latitude and longitude parameter values, it automatically enters the quality inspection traceability interface. Inspection results include compliant, non-compliant, or borderline.

[0167] Combination Figure 8 After completing the pixel-to-physical conversion, the system enters the quality inspection and traceability process, summarizing the results and intermediate quantities of the entire process in a structured manner, and generating quality records and confidence conclusions for traceability and re-inspection. The quality records are bound and archived with sample numbers, timestamps, and equipment parameters (camera / light source / stage).

[0168] It's important to note that the quality record includes wavelet parameters, frequency domain / notch filter parameters, thresholds and geometric constraints, quality metrics, confidence levels and thresholds, and reporting and interfaces. Wavelet parameters represent the optimal scale a*, the Morlet frequency parameter ω0, and target values ​​or key points on the variance-scale curve related to the scale search. Frequency domain / notch filter parameters include the main lobe position (u0, v0) of the fringe channel, notch bandwidth σ, guard radius D0, and sidelobe processing indicators. Thresholds and geometric constraints include the projected peak detection threshold T, minimum peak spacing range [dmin, dmax], and ROI grid configuration (number of rows and columns, coverage area, masking / ignore markers). Quality metrics include peak signal-to-noise ratio (SNR), peak spacing coefficient of variation (CV), and repair pixel ratio R. i (Printing channel), weights of each ROI, and peak missing rate, etc. Confidence and threshold: The weighted result Conf and weighted threshold β are calculated based on multi-source indicators, and the conclusions and reasons for meeting / not meeting the standards are given. Reports and interfaces: Result reports (including warp density, weft density, error limits, and confidence levels) and structured data (JSON / CSV / DB) can be integrated with MES / ERP / QMS, and support horizontal comparison and retrospective query within the same batch.

[0169] Furthermore, to improve the interpretability of the judgment, the weighted result Conf is generated in a hierarchical weighted manner: for the indicator set (SNR, CV, R... i Normalization is performed on peak missing rate, ROI weight distribution balance, etc., and weighted summation or logistic regression mapping is performed based on the weight vectors for different fabric types (plain / stripe / print) to obtain Conf∈[0,1].

[0170] In one embodiment, the weighting threshold β can be set to a range of 0.70–0.85 and can be adaptively fine-tuned according to working conditions and fabric type. For compliant samples, the system automatically outputs structured quality records, generates reports, and archives them. For critical samples (e.g., |Conf-β|≤ε), they can be marked as "attention" for random inspection and verification.

[0171] In another optional implementation, the system can also attach key intermediate quantities (such as spectrograms, peak projection curves, repair masks, and before-and-after comparison images) to the report as thumbnails or links for quick manual review. Furthermore, all quality records maintain a one-to-one correspondence with the original images / parameters, ensuring consistent output when the same input is replayed at any point in time, thus meeting the requirements for engineering traceability and forensic verification.

[0172] The system automatically generates quality records and result confidence scores. The recorded content includes, but is not limited to: optimal scale a*, frequency parameter ω0, frequency domain parameters (u0, v0, σ, D0), projection threshold T, peak SNR, peak spacing coefficient of variation CV, and repair pixel ratio R. i ROI weighting, peak missing rate, etc. Confidence scoring comprehensively considers multiple sources of indicators, indicating both acceptability and serving as a trigger for anomaly detection. Quality records are stored long-term in a structured format, supporting backtracking by sample, batch, device, and time dimensions.

[0173] To facilitate consistent evaluation, the main indicators are compressed into the [0,1] interval to form a standard feature vector. :

[0174]

[0175]

[0176] ;

[0177] xC is the mean / lower quantile of the ROI peak integrity (already in [0,1]). SNRref, CVref, and Rref are engineering reference values ​​that can be automatically estimated based on the data.

[0178] The online rating uses a simple weighted model (weights are non-negative and sum to 1):

[0179] ;

[0180] In one embodiment, the weighted result is compared with a weighted threshold, wherein the weighted threshold is obtained by the following steps:

[0181] S710 obtains automatic weighted results based on the image of the fabric sample to be tested, and obtains a weighted threshold based on the acceptance of the entered labels.

[0182] The weighted threshold β is obtained through a "run first, calibrate later" approach. First, the system is run on representative samples, and the results (x) and the automatic results are retained. Then, a label (1 = acceptable) is provided by manual verification, and the final weighting is determined accordingly. **β (e.g., to ensure an acceptable pass rate of ≥95% for "acceptable" samples, the 5th percentile of the Conf can be taken as β). Weighted thresholds can be set according to plain / stripe / print classifications. . Meets the standard: If the hard constraints (minimum peak spacing, peak continuity) are met, the results and report will be output and archived. Failure to meet / critical criteria: If a hard constraint is violated, it is marked as an anomaly and the process is transferred to S800-S900. All scores, threshold versions, key intermediate quantities, and charts are archived together to ensure traceability and reproducibility.

[0183] In one embodiment, after comparing the weighted result with a weighted threshold to obtain the detection result corresponding to the grid cell, the method further includes the following step:

[0184] S800, set the trigger conditions, and determine whether the trigger conditions are met based on the weighted result and the detection result;

[0185] S900, if the triggering condition is met, the corresponding processing steps are determined based on the weighted result and the detection result.

[0186] The triggering conditions include: substandard detection results; bimodal / flat-topped variance-scale curves leading to a* instability; main peaks near the origin or abnormal energy; localized strong high-frequency noise / highlights; excessive print coverage; broken ROI peaks or extreme weight bias; and more. When the processor determines that any of the above conditions are met, it will proceed with the following operation.

[0187] (1) Parameter adaptation:

[0188] Scale domain: Expand or refine scale coverage and step size (e.g., change geometric series sampling to denser sampling), and allow searching a* in both row and column directions separately.

[0189] Contrast Enhancement: Adaptively adjusts the contrast limit and window size of CLAHE to avoid over-enhancement that introduces false peaks.

[0190] Peak detection strategy: Dynamically reset the threshold T and the minimum peak distance range [dmin, dmax], and introduce a joint criterion of "first-order extreme value combined with second-order derivative zero crossing" to suppress false peaks.

[0191] Frequency domain suppression: Adaptively adjust the notch bandwidth σ and the guard ring parameter D0, and set a narrowband notch or superimpose a ring low-pass filter on the sidelobe if necessary.

[0192] Print repair: Widen or tighten the range of K and the repair template (e.g., temporarily widen from 5×5 to 7×7), and fine-tune the histogram matching and edge smoothing intensity.

[0193] ROI strategy: Temporarily block low-confidence ROIs, or make a gentle redistribution of ROI weights to avoid a few abnormal areas dragging down the overall results.

[0194] (2) Rollback and recalculation:

[0195] The process can be rolled back to the preprocessing enhancement or critical channel node and rerun with the new parameter combination. Each rerun saves a snapshot of the "parameters-results" (including version number, timestamp, and operator / task ID) for verification. A maximum adaptive round number (e.g., 2-3 times) and a minimum change amount (e.g., lower limit of step size for T and σ) can be set to avoid invalid oscillations.

[0196] (3) Re-inspection labeling and comparison before and after

[0197] If Conf is still lower than β or the quality indicators fail to meet the standards after multiple rounds of adaptation, the system will automatically generate a "re-inspection required" label and output a before / after comparison chart and a list of parameter changes (including a*, ω0, T, [d_min, d_max], σ, D0, ROI weights, etc.) for manual review and process-side closure.

[0198] (4) Return to normal process:

[0199] When the quality metric meets the standard and Conf≥β, exit the abnormal branch and return to the main link to continue processing. The abnormal rollback path is in Figure 1 The dashed lines indicate preprocessing enhancement. All adaptive and rollback operations do not change the original image, but only affect the processing parameters, and the entire process is logged to meet auditing and traceability requirements.

[0200] It should be noted that when the test result is deemed unqualified, the triggering condition is met, and the following operations are performed: (1) parameter adaptive adjustment and (2) rollback recalculation. If Conf is still lower than β after multiple rounds of adaptive adjustment or the quality index is not met, the following operations are performed: (3) re-inspection and comparison before and after. When the quality index is met and Conf≥β, the following operations are performed: (4) return to normal process. When the processor determines that the weighted result shows a double peak / flat top in the variance-scale curve leading to a* instability, the main peak of the stripe is close to the origin or the energy is abnormal, there is local strong high-frequency noise / high gloss, the printing coverage ratio is too large, the ROI peak column is broken or the weight is extremely biased, and Once any condition is met, the process will proceed to operations such as (1) parameter adaptation, (2) rollback and recalculation, (3) re-inspection and comparison before and after, and (4) return to normal process.

[0201] This application also discloses a system for measuring fabric structure parameters and a method for measuring fabric structure parameters. The system includes a hardware layer and a software layer.

[0202] The fabric structure parameter measurement system includes a channel setting module, an image processing module, a type matching module, and a parameter processing module. The channel setting module is used to set multiple types of density measurement channels, including solid color channels, stripe channels, and printed channels. The image processing module acquires images of the fabric sample to be tested and preprocesses them to obtain sample labels. The type matching module determines the matching type among several density measurement channels based on the sample labels. The parameter processing module calculates the warp and weft yarn values ​​corresponding to the fabric sample image based on the determined matching type and converts these values ​​according to preset parameters to calculate the warp and weft parameter values ​​of the fabric sample image at a standard length.

[0203] The other functions performed in the aforementioned channel setting module, image processing module, type matching module, and parameter processing module, as well as the technical details of each function, are the same as or similar to the corresponding features in the fabric structure parameter measurement method described above, and therefore will not be repeated here.

[0204] Reference Figure 9 In one embodiment, the fabric density detection system based on frequency domain analysis of the present invention adopts a modular architecture with hardware and software layers to ensure functional independence, closed-loop process, and data traceability. The hardware layer consists of an industrial camera and lens acquiring fabric sample images under uniform geometric conditions. A standard light source provides stable illumination and supports control over brightness / duty cycle, while a calibration plate / ruler serves as a reference for pixel-to-physical ratio. A stage / positioning mechanism is used to fix the sample and provide pose / trigger signals. The computing and storage unit handles the operation of each algorithm module and data persistence. Image data is transmitted to the acquisition and calibration module, while illumination control, calibration reference, pose / trigger, and operation / scheduling information are synchronously input in the form of control / reference signals, jointly completing a stable and reproducible upstream input.

[0205] To enhance robustness under complex operating conditions, the system incorporates ROI grids and weighted fusion strategies in the counting phase of all three types of channels. After ROI grid division, each sub-region outputs quality indicators such as peak integrity, SNR, and curve smoothness. After weight calculation and normalization, the peak spacing and count of each ROI are weighted and fused to obtain the global average peak-to-peak pixel distance dpx and warp / weft yarn count. Subsequently, the pixel-to-physical conversion module converts dpx into warp and weft density on a standard length (preferably 10 cm) according to the calibration ratio k. The quality inspection and traceability module structurally records key intermediate parameters such as a*, ω0, (u0,v0,σ,D0), threshold T, SNR, CV, repair pixel ratio Ri, and ROI weights, and generates a confidence score for result interpretation and quality traceability. When the quality inspection fails to meet the standards or the confidence level is lower than the threshold β, the anomaly detection and fault tolerance module triggers parameter adaptation and process rollback (dashed line rollback to preprocessing), and outputs re-inspection label and before-and-after comparison results to ensure that the measurement conclusions are still interpretable under abnormal samples.

[0206] The data management and interface module runs through the end of the software layer, providing archiving, reporting, and system integration capabilities for longitude / latitude precision results and quality records. It can be integrated with MES / ERP / QMS as needed. Overall, the hardware layer ensures stable imaging and calibration, while the software layer... Figure 1 The sequence completes the closed-loop processing from data acquisition to result quality inspection. The three types of density measurement channels divided by category and the ROI weighted fusion ensure the engineering adaptability and metrological consistency of various fabrics such as solid colors, stripes and prints.

[0207] The implementation principle is as follows:

[0208] Combination Figure 1 and Figure 9 The software layer is organized around the main link of "acquisition—enhancement—identification—splitting—density measurement—conversion—quality inspection". Acquisition and calibration generate pixel-physical ratio k and output metadata simultaneously with the received image and hardware-side signals. Preprocessing enhancement sequentially performs grayscale conversion, noise reduction, CLAHE, orientation correction, and flat-field correction to obtain a preprocessed image with higher texture separability. Type identification and splitting comprehensively considers statistics, frequency domain, and texture features to classify samples into three categories: plain, stripe, or print, and routes them to the corresponding density measurement channel accordingly. For plain samples, the plain density measurement module... Figure 4 Morlet multi-scale convolution is employed, and the optimal scale a* is selected using variance-scale or objective function J(a). After thresholding and skeletonization, peak counting is completed using horizontal / vertical projection. For stripe samples, the stripe density measurement module is as follows: Figure 5First, the main lobe ±(u0,v0) is located in the frequency domain and directional interference is suppressed using a symmetrical Gaussian notch filter (with a ring low-pass filter superimposed if necessary). Then, the wavelet-projection link is reused in the spatial domain. For printed samples, the printed density measurement module is as follows: Figure 6 The interference region was located by K-means segmentation in HSV space and combined with GLCM index. Then, the bottom texture was restored by Criminisi sample with structure priority. Finally, the wavelet-projection link was reused to obtain the counting results.

[0209] It should be understood that although the steps in the flowcharts in the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise expressly stated herein, there is no strict order in which these steps are performed, and they may be performed in other orders.

[0210] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. A method for measuring the structural parameters of a fabric, characterized in that, Includes the following steps: Multiple types of density detection channels are set up, including solid color channels, stripe channels, and print channels; Acquire an image of the fabric sample to be tested, and preprocess the image to obtain sample labels; The matching type is determined in several density detection channels based on the sample labels; Based on the determined matching type, the warp and weft yarn values ​​corresponding to the fabric sample image to be tested are calculated, and the warp and weft yarn values ​​are converted according to preset parameters to calculate the warp and weft parameter values ​​of the fabric sample image under standard length. The image of the fabric sample to be tested is preprocessed to obtain sample labels, including the following steps: The preprocessed image of the fabric sample to be tested is calculated to obtain the density channel parameters. The density channel parameters are compared with a preset type threshold to determine whether the density channel parameters meet the preset type threshold. The density channel parameters include grayscale variance and orientation consistency, and the preset type threshold includes variance threshold and consistency threshold. If the density measurement channel parameters meet the preset type threshold, the sample image to be tested is determined to be a solid color, and the sample label is set to a solid color label. If the density measurement channel parameters do not meet the preset type threshold, then the sample image to be tested is subjected to a two-dimensional Fourier transform to obtain a spectrum image. Based on the spectral image, obtain spectral periodic features and determine whether the spectral periodic features meet the preset stripe conditions; If the spectral periodicity feature meets the preset stripe condition, the sample image to be tested is determined to be stripe type, and the sample label is set as stripe label; If the spectral periodicity features do not meet the preset stripe conditions, the fabric sample image to be tested is determined to be a printed type, and the sample label is set as a printed label.

2. The method for measuring fabric structure parameters according to claim 1, characterized in that, The calculation of warp and weft yarn values ​​corresponding to the fabric sample image based on the determined matching type includes the following steps: Based on a preset scale set, wavelet convolution is performed on the updated sample image to be tested to obtain a scale response set, which includes at least the variance scale response. The objective function corresponding to each element is calculated based on the scale response set, and the target scale is obtained based on the constraints. The target scale is determined based on the scale discrimination condition to obtain the warp and weft yarn values ​​corresponding to the fabric sample image to be tested.

3. The method for measuring fabric structure parameters according to claim 2, characterized in that, The target scale is determined based on the scale discrimination criteria, including the following steps: The preprocessed sample image to be tested is divided into several grid units according to a preset ratio, and the peak detection parameters and peak detection indices corresponding to the grid units are calculated in sequence. The peak detection index is normalized to generate a quality score, and the grid cell is updated based on the quality score. The peak detection parameters and the updated grid cells are used to perform weighted fusion to obtain the warp and weft yarn values ​​corresponding to the preprocessed fabric sample image.

4. The method for measuring fabric structure parameters according to claim 2, characterized in that, The updated fabric sample image to be tested is subjected to wavelet convolution based on a preset scale set. The updating of the fabric sample image to be tested further includes the following steps: When the fabric sample image to be tested is determined to be striped, the main lobe of the stripes is determined for the fabric sample image to be tested, and the Gaussian parameters are determined based on the spectrum image; A pair of Gaussian notch filters are constructed based on the Gaussian parameters to obtain a suppressed main lobe image, and the suppressed main lobe image is inversely transformed to update the image of the fabric sample to be tested.

5. The method for measuring fabric structure parameters according to claim 2, characterized in that, Before performing wavelet convolution on the updated sample image to be tested based on a preset scale set, the following steps are also included: When the fabric sample image to be tested is determined to be a printed type, the fabric sample image to be tested is divided into regions based on K-means clustering and texture feature extraction technology to obtain interference regions; The interference area is removed from the fabric sample image to obtain a defect pattern, and the defect pattern is repaired based on the structure-first repair technique to update the fabric sample image.

6. The method for measuring fabric structure parameters according to claim 3, characterized in that, After calculating the warp and weft parameters of the fabric sample image under standard length, the following steps are also included: After calculating the warp and weft parameters of the fabric sample image to be tested, a quality inspection traceability signal is generated, and the quality inspection traceability interface is entered based on the quality inspection traceability signal. The latitude and longitude parameter values ​​are normalized to generate standard feature vectors, and the weighted results corresponding to the grid cells are obtained based on the weighted model and the standard feature vectors. The weighted result is compared with the weighted threshold to obtain the detection result corresponding to the grid cell.

7. The method for measuring fabric structure parameters according to claim 6, characterized in that, The weighted result is compared with the weighted threshold, wherein the weighted threshold is obtained by the following steps: Automatic weighting results are obtained based on the image of the fabric sample to be tested, and the weighting threshold is obtained based on the acceptance of the entered labels.

8. The method for measuring fabric structure parameters according to claim 6, characterized in that, After comparing the weighted result with the weighted threshold to obtain the detection result corresponding to the grid cell, the following steps are also included: Set trigger conditions, and determine whether the trigger conditions are met based on the weighted results and the detection results; If the triggering conditions are met, the corresponding processing steps are determined based on the weighted result and the detection result.

9. A system for measuring the structural parameters of a fabric, characterized in that, A method for measuring fabric structure parameters according to any one of claims 1-8, comprising: The channel setting module is used to set multiple types of density testing channels, including solid color channels, stripe channels, and pattern channels. An image processing module is used to acquire an image of the fabric sample to be tested and to preprocess the image of the fabric sample to obtain a sample label. The image processing module is also used to calculate the preprocessed image of the fabric sample to be tested to obtain the density channel parameters, compare the density channel parameters with a preset type threshold, and determine whether the density channel parameters meet the preset type threshold; wherein, the density channel parameters include grayscale variance and orientation consistency, and the preset type threshold includes variance threshold and consistency threshold; If the density measurement channel parameters meet the preset type threshold, the sample image to be tested is determined to be a solid color, and the sample label is set to a solid color label. If the density measurement channel parameters do not meet the preset type threshold, then the sample image to be tested is subjected to a two-dimensional Fourier transform to obtain a spectrum image. Based on the spectral image, obtain spectral periodic features and determine whether the spectral periodic features meet the preset stripe conditions; If the spectral periodicity feature meets the preset stripe condition, the sample image to be tested is determined to be stripe type, and the sample label is set as stripe label; If the spectral periodicity features do not meet the preset stripe conditions, the fabric sample image to be tested is determined to be a printed type, and the sample label is set as a printed label; A type matching module, which is used to determine the matching type in several density detection channels based on the sample label; The parameter processing module is used to calculate the warp and weft yarn values ​​corresponding to the fabric sample image to be tested based on the determined matching type, and to convert the warp and weft yarn values ​​according to preset parameters to calculate the warp and weft parameter values ​​of the fabric sample image to be tested at the standard length.