Fabric density measuring system and method based on moire patterns

By utilizing the moiré pattern-based fabric density measurement system, the problems of small field of view and poor real-time performance in existing technologies are solved by employing the moiré pattern amplification effect and frequency scaling method. This achieves high-precision, low-cost fabric density measurement with a large field of view, meeting the real-time monitoring needs of textile production lines.

CN121883373APending Publication Date: 2026-04-17NANJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV
Filing Date
2025-12-17
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing fabric density measurement technologies suffer from problems such as short deployment distance, small field of view, high cost, and difficulty in guaranteeing real-time performance, making it difficult to meet the real-time monitoring needs of modern textile production lines.

Method used

A fabric density measurement system based on moiré patterns is adopted. Through an adaptive fabric detection module, a moiré pattern feature extraction module, and a density measurement module, the system utilizes the moiré pattern amplification effect and frequency scaling method, combined with commercial cameras and lenses, to achieve large field-of-view coverage, low cost, and real-time high efficiency density measurement.

Benefits of technology

It achieves high-precision density measurement over a large field of view, reduces system deployment costs, and meets the real-time monitoring needs of textile production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883373A_ABST
    Figure CN121883373A_ABST
Patent Text Reader

Abstract

The invention discloses a fabric density measurement system and method based on moire, and the system comprises a self-adaptive fabric detection module which preprocesses an original fabric image into a plurality of image blocks, constructs a demosaicking feature map according to the demosaicking feature indexes of the image blocks, generates a fabric region image, and transmits the fabric region image to a fabric density measurement module; positioning a fabric area containing moire patterns in the image; the moire feature extraction module is used for partitioning and enhancing the cloth area image to generate moire feature matrixes of warp dimension and weft dimension; and the density measurement module is used for verifying the effectiveness of the moire pattern characteristic matrix and realizing cloth density measurement. According to the method, the density of the cloth is measured by extracting the characteristics of the moire patterns generated by overlapping the shot cloth texture and the camera color filtering array, so that the problems of short deployment distance and small field of view of the existing fabric density measurement technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of quality inspection technology of industrial Internet of Things, specifically relating to a fabric density measurement system and method based on moiré pattern. Background Technology

[0002] In modern textile production, fabric density, as a core parameter for measuring textile quality, is defined as the number of yarns per unit length (usually expressed as yarns per centimeter or yarns per inch). This key indicator not only directly affects the physical properties of the fabric (including tensile strength, air permeability, hand feel, and texture), but also serves as a crucial basis for determining the quality grade of the final product. Any uncorrected density deviation can lead to large-scale fabric defects, significantly reducing production profit margins and potentially causing economic losses of up to millions of yuan annually.

[0003] Current methods for measuring fabric density mainly fall into three categories: spatial domain analysis, frequency domain analysis, and convolutional neural network (CNN) methods. These existing methods typically employ brightness peak analysis, periodic analysis based on Fast Fourier Transform (FFT), or data-driven yarn detection; their core reliance is on clear and high-resolution fabric texture features, such as significant brightness gradient differences, clearly identifiable yarn structures, and regular periodic weave structures. To capture these key texture features, cameras must be deployed at close range to the fabric (typically within 50 cm) for imaging. This close-range imaging requirement presents two major technical bottlenecks in industrial applications: First, system deployment costs will increase significantly. To achieve large-area detection, multiple sets of equipment need to work together, not only driving up hardware procurement costs but also bringing complex system integration challenges; second, real-time system performance is difficult to guarantee. To achieve large-area detection, the system needs to process a large number of images acquired at close range from different areas, and the resulting computational load will lead to significant delays, failing to meet the stringent real-time monitoring requirements of modern textile production lines.

[0004] Therefore, developing a fabric density measurement solution that can achieve large field-of-view coverage, low-cost deployment, and real-time efficiency while ensuring accuracy has become a key technical challenge that urgently needs to be overcome in the current textile density quality inspection process. Summary of the Invention

[0005] To address the shortcomings of the existing technologies, the present invention aims to provide a fabric density measurement system and method based on moiré patterns. This system measures the fabric density by extracting the features of the moiré pattern generated by superimposing the captured fabric texture with the camera's color filter array, thereby solving the problems of short deployment distance and small field of view in existing fabric density measurement technologies.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] The present invention provides a fabric density measurement system based on moiré pattern, comprising: an adaptive fabric detection module, a moiré pattern feature extraction module, and a density measurement module;

[0008] The adaptive fabric detection module is used to preprocess the original fabric image captured by the camera into multiple image blocks, and construct a demosaic feature map based on the demosaic feature index of the image blocks, and further generate a fabric area image to locate the fabric area containing moiré patterns in the image.

[0009] The moiré pattern feature extraction module is used to segment and enhance the generated fabric area image, perform a two-dimensional fast Fourier transform, and calculate the frequency features of the moiré pattern using a dynamic weighting method, generating moiré pattern feature matrices in both warp and weft dimensions. and ;

[0010] The density measurement module verifies the validity of the moiré feature matrix. If the feature matrix is ​​valid, a model between the moiré features and the fabric density is constructed to achieve fabric density measurement. If the feature matrix is ​​invalid, a valid moiré image is obtained through frequency scaling, and the moiré feature extraction is re-executed until it is valid.

[0011] Furthermore, the fabric refers to a fabric with a regular arrangement of yarn weft threads.

[0012] Furthermore, the preprocessing method of the adaptive fabric detection module is as follows:

[0013] Original fabric image captured by camera Image blocks are captured using a sliding window to reduce interference from the fabric pattern. The sliding window is set to a square window with a side length of [missing information]. pixels, stride pixels, the height of the original fabric image captured is pixels, width is Pixel;

[0014] Number of slides in the horizontal direction relative to the original fabric image The calculation is as follows:

[0015] ;

[0016] in, Indicates rounding up;

[0017] Number of slides in the vertical direction relative to the original fabric image The calculation is as follows:

[0018] ;

[0019] The entire original fabric image was divided into × There are 1 image patch, each image patch being 1. × Pixels; Histogram equalization and normalization are performed on each image patch to standardize the image data, resulting in preprocessed image patches. .

[0020] Furthermore, the method for constructing the demosaic feature map by the adaptive fabric detection module is as follows:

[0021] The preprocessed image blocks are processed sequentially. The spectrum is obtained by performing a two-dimensional fast Fourier transform. Set a period threshold T, and sum the energy of frequency components with periods less than or equal to the period threshold T, and then compare it with the energy of the image patch. The ratio of the sum of the energy of all frequency components is used as an image patch. Demosaic feature index ,as follows:

[0022] ;

[0023] in, The energy represented by the spectrum. The spectrogram mask represents the periodic threshold T; after concatenating the demosaic feature indices of all image patches, interpolation yields a demosaic feature map of size M×W. Binarize the de-mosaic feature map to generate a detection mask for the fabric region. ; Original fabric image Detection mask for fabric area Multiply to obtain the fabric area image. .

[0024] Furthermore, the period threshold T in the demosaic feature map construction method of the adaptive fabric detection module restricts the possible frequency distribution of ultra-high frequency noise, and its value range is close to the sampling period of the image.

[0025] Furthermore, the segmentation and enhancement method of the moiré pattern feature extraction module is specifically as follows:

[0026] Image of the generated fabric area Image blocks are captured using a sliding window to reduce interference from the fabric pattern. The sliding window is set to a square window with a side length of [missing information]. pixels, stride Pixels, generated fabric area image Height is pixels, width is Pixel;

[0027] Number of slides in the horizontal direction relative to the fabric area image The calculation is as follows:

[0028] ;

[0029] in, Indicates rounding up;

[0030] Number of slides in the vertical direction relative to the fabric area image The calculation is as follows:

[0031] ;

[0032] The entire fabric area image is divided into × There are 1 image patch, each image patch being 1. × Pixels; Histogram equalization, Gaussian smoothing, and adaptive threshold binarization are performed sequentially on each image patch to enhance moiré contrast and suppress fabric texture interference, resulting in enhanced moiré image patches. .

[0033] Furthermore, the method by which the moiré pattern feature extraction module calculates the frequency features of the moiré pattern is as follows:

[0034] Enhanced moiré image patches The spectrum is obtained by performing a two-dimensional fast Fourier transform. A dynamic weighted refinement method is used in the spectrum diagram. The weighted region surrounding the moiré frequency component is selected, and a weighted average is performed based on the pixel intensity to locate the coordinates of the moiré frequency component. Calculate the moiré frequency value and direction The formula is as follows:

[0035] ;

[0036] Where c is the physical size of a single pixel of the camera; the moiré frequency values ​​of all image blocks are aggregated to generate moiré feature matrices in both warp and weft dimensions. and .

[0037] Furthermore, the specific method for validating the moiré feature matrix of the density measurement module is as follows: for each enhanced moiré image block... Moiré pattern feature matrix from warp and weft dimensions and Extract the corresponding moiré frequency value and direction If the moiré frequency value If the value is high, then adjacent moiré patterns are distributed in the same pixel and are considered invalid; otherwise, they are considered valid.

[0038] Furthermore, the specific method for constructing a model between moiré pattern features and fabric density in the density measurement module to achieve fabric density measurement is as follows:

[0039] For each enhanced moiré image patch Moiré pattern feature matrix from warp and weft dimensions and Extract the corresponding moiré frequency value and direction Calculate fabric density The formula is as follows:

[0040] ;

[0041] in, The sampling frequency of the camera. The direction of the camera's sampling frequency. The focal length of the camera lens. For shooting distance; cloth density for stitching all image blocks. get × Fabric density in each area.

[0042] Furthermore, the frequency scaling method specifically refers to:

[0043] With sampling rate Perform downsampling on the fabric area image to generate a frequency scaling map;

[0044] Set the resolution threshold The Tenengrad gradient method is used to evaluate the sharpness value of the fabric region image; if the sharpness value of the fabric region image is less than... Then adjust the sampling rate. Continue sampling until the sharpness value of the fabric area image reaches a local optimum; otherwise, adjust the sampling rate. Until the image sharpness value of the fabric area reaches a local minimum;

[0045] Moiré pattern feature extraction is performed on a clear frequency scaling map;

[0046] Based on the moiré characteristics of the frequency scaling map and the sampling rate The accurate moiré features of the enhanced moiré image patch were reconstructed.

[0047] This invention also provides a moiré pattern detection method based on feature analysis, which, based on the above system, includes the following steps:

[0048] 1) Use a camera to collect data from the original fabric of the density to be tested;

[0049] 2) Preprocess the original fabric images captured by shooting, crop image blocks according to the sliding window, and perform histogram equalization and normalization to improve contrast;

[0050] 3) Perform two-dimensional fast Fourier transform on the image blocks sequentially to obtain the spectrum. Set a period threshold and use the ratio of the detected period less than or equal to the period threshold to the sum of the energy of all frequency components of the image block as the demosaic feature index of the image block.

[0051] 4) After stitching together the demosaic feature indices of all image blocks, interpolate to obtain a demosaic feature map, and perform binarization to generate a detection mask for the fabric region; multiply the original fabric image and the detection mask of the fabric region to obtain the fabric region image.

[0052] 5) The fabric area image is segmented and enhanced. Image blocks are cropped according to the sliding window, and histogram equalization, Gaussian smoothing and adaptive threshold binarization are performed on each image block to obtain the enhanced moiré image block.

[0053] 6) Perform frequency domain transformation on the enhanced moiré image patch, use dynamic weighted thinning method to locate the coordinates of the moiré frequency components, and extract the moiré frequency values;

[0054] 7) Segment the moiré frequency values ​​of all image blocks to generate moiré feature matrices in both warp and weft dimensions;

[0055] 8) Verify the validity of the moiré features extracted from the moiré feature matrix. If the features are invalid, perform frequency scaling until accurate moiré features are extracted.

[0056] 9) Obtain the spatial frequency value and direction of the camera color filter array, the focal length of the lens, and the distance from the camera to the fabric, and output the density measurement results of multiple fabric areas.

[0057] The beneficial effects of this invention are:

[0058] 1. Large field of view measurement range: This invention uses moiré patterns as a sensing medium. Based on the moiré pattern amplification effect, it can magnify yarn textures that are difficult to distinguish at a distance into detectable low-frequency stripes. At the same time, this invention combines frequency scaling method to further improve the measurement range of the invention and realize a large field of view measurement range.

[0059] 2. High-precision measurement: This invention uses moiré patterns as a sensing medium, which is highly sensitive to changes in stripe density; by utilizing dynamically weighted and refined feature extraction, the accuracy of feature extraction is further improved, achieving high-precision density measurement.

[0060] 3. Low cost: This invention does not require complex customized acquisition equipment and high-performance computing equipment. It only uses commercial cameras and lenses to build the system, making it suitable for large-scale industrial applications.

[0061] 4. Real-time performance: This invention does not require complex deep learning algorithms, but is based solely on frequency domain feature extraction and density model derivation, resulting in low processing latency and meeting the real-time monitoring needs of the production line. Attached Figure Description

[0062] Figure 1 This is a schematic diagram of the system of the present invention;

[0063] Figure 2 This is a schematic diagram of the preprocessing method of the adaptive fabric detection module in this invention;

[0064] Figure 3 This is a schematic diagram illustrating the principle of the method for removing mosaic feature indicators in this invention;

[0065] Figure 4 This is a schematic diagram of the frequency scaling method in this invention. Detailed Implementation

[0066] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to embodiments and accompanying drawings. The content mentioned in the embodiments is not intended to limit the present invention.

[0067] Reference Figure 1 As shown, the present invention provides a fabric density measurement system based on moiré pattern, comprising: an adaptive fabric detection module, a moiré pattern feature extraction module, and a density measurement module;

[0068] The adaptive fabric detection module is used to preprocess the original fabric image captured by the camera into multiple image blocks, and construct a demosaic feature map based on the demosaic feature index of the image blocks, and further generate a fabric area image to locate the fabric area containing moiré patterns in the image.

[0069] Specifically, the preprocessing method of the adaptive fabric detection module is as follows:

[0070] Original fabric image captured by camera Image blocks are captured using a sliding window to reduce interference from the fabric pattern. The sliding window is set to a square window with a side length of [missing information]. pixels, stride pixels, the height of the original fabric image captured is pixels, width is Pixel;

[0071] Number of slides in the horizontal direction relative to the original fabric image The calculation is as follows:

[0072] ;

[0073] in, Indicates rounding up;

[0074] Number of slides in the vertical direction relative to the original fabric image The calculation is as follows:

[0075] ;

[0076] The entire original fabric image was divided into × There are 1 image patch, each image patch being 1. × Pixels; Histogram equalization and normalization are performed on each image patch to standardize the image data, resulting in preprocessed image patches. .

[0077] Specifically, the method by which the adaptive fabric detection module constructs the demosaic feature map is as follows:

[0078] The preprocessed image blocks are processed sequentially. The spectrum is obtained by performing a two-dimensional fast Fourier transform. Set a period threshold T, and sum the energy of frequency components with periods less than or equal to the period threshold T, and then compare it with the energy of the image patch. The ratio of the sum of the energy of all frequency components is used as an image patch. Demosaic feature index ,as follows:

[0079] ;

[0080] in, The energy represented by the spectrum. The spectrogram mask represents the periodic threshold T; after concatenating the demosaic feature indices of all image patches, interpolation yields a demosaic feature map of size M×W. Binarize the de-mosaic feature map to generate a detection mask for the fabric region. ; Original fabric image Detection mask for fabric area Multiply to obtain the fabric area image. .

[0081] In the adaptive fabric detection module, the period threshold T in the demosaic feature map construction method restricts the possible frequency distribution of ultra-high frequency noise, and its value range is close to the sampling period of the image.

[0082] The moiré pattern feature extraction module is used to segment and enhance the generated fabric area image, perform a two-dimensional fast Fourier transform, and calculate the frequency features of the moiré pattern using a dynamic weighting method, generating moiré pattern feature matrices in both warp and weft dimensions. and ;

[0083] Specifically, the segmentation and enhancement method of the moiré pattern feature extraction module is as follows:

[0084] Image of the generated fabric area Image blocks are captured using a sliding window to reduce interference from the fabric pattern. The sliding window is set to a square window with a side length of [missing information]. pixels, stride Pixels, generated fabric area image Height is pixels, width is Pixel;

[0085] Number of slides in the horizontal direction relative to the fabric area image The calculation is as follows:

[0086] ;

[0087] in, Indicates rounding up;

[0088] Number of slides in the vertical direction relative to the fabric area image The calculation is as follows:

[0089] ;

[0090] The entire fabric area image is divided into × There are 1 image patch, each image patch being 1. × Pixels; Histogram equalization, Gaussian smoothing, and adaptive threshold binarization are performed sequentially on each image patch to enhance moiré contrast and suppress fabric texture interference, resulting in enhanced moiré image patches. .

[0091] Specifically, the method by which the moiré pattern feature extraction module calculates the frequency features of the moiré pattern is as follows:

[0092] Enhanced moiré image patches The spectrum is obtained by performing a two-dimensional fast Fourier transform. A dynamic weighted refinement method is used in the spectrum diagram. The weighted region surrounding the moiré frequency component is selected, and a weighted average is performed based on the pixel intensity to locate the coordinates of the moiré frequency component. Calculate the moiré frequency value and direction The formula is as follows:

[0093] ;

[0094] Where c is the physical size of a single pixel of the camera; the moiré frequency values ​​of all image blocks are aggregated to generate moiré feature matrices in both warp and weft dimensions. and .

[0095] The density measurement module verifies the validity of the moiré feature matrix. If the feature matrix is ​​valid, a model between the moiré features and the fabric density is constructed to achieve fabric density measurement. If the feature matrix is ​​invalid, a valid moiré image is obtained through frequency scaling, and the moiré feature extraction is re-executed until it is valid.

[0096] Specifically, the method for validating the moiré feature matrix of the density measurement module is as follows: for each enhanced moiré image block... Moiré pattern feature matrix from warp and weft dimensions and Extract the corresponding moiré frequency value and direction If the moiré frequency value If the value is high, then adjacent moiré patterns are distributed in the same pixel and are considered invalid; otherwise, they are considered valid.

[0097] Specifically, the method for constructing a model between moiré pattern features and fabric density in the density measurement module to achieve fabric density measurement is as follows:

[0098] For each enhanced moiré image patch Moiré pattern feature matrix from warp and weft dimensions and Extract the corresponding moiré frequency value and direction Calculate fabric density The formula is as follows:

[0099] ;

[0100] in, The sampling frequency of the camera. The direction of the camera's sampling frequency. The focal length of the camera lens. For shooting distance; cloth density for stitching all image blocks. get × Fabric density in each area.

[0101] The frequency scaling method is specifically as follows:

[0102] With sampling rate Perform downsampling on the fabric area image to generate a frequency scaling map;

[0103] Set the resolution threshold The Tenengrad gradient method is used to evaluate the sharpness value of the fabric region image; if the sharpness value of the fabric region image is less than... Then adjust the sampling rate. Continue sampling until the sharpness value of the fabric area image reaches a local optimum; otherwise, adjust the sampling rate. Until the image sharpness value of the fabric area reaches a local minimum;

[0104] Moiré pattern feature extraction is performed on a clear frequency scaling map;

[0105] Based on the moiré characteristics of the frequency scaling map and the sampling rate The accurate moiré features of the enhanced moiré image patch were reconstructed.

[0106] The fabric in question refers to a fabric with a regular arrangement of yarn weft threads.

[0107] This invention also provides a moiré pattern detection method based on feature analysis, which, based on the above system, includes the following steps:

[0108] 1) Use a camera to collect data from the original fabric of the density to be tested;

[0109] 2) Preprocess the original fabric images captured by shooting, crop image blocks according to the sliding window, and perform histogram equalization and normalization to improve contrast;

[0110] 3) Perform two-dimensional fast Fourier transform on the image blocks sequentially to obtain the spectrum. Set a period threshold and use the ratio of the detected period less than or equal to the period threshold to the sum of the energy of all frequency components of the image block as the demosaic feature index of the image block.

[0111] 4) After stitching together the demosaic feature indices of all image blocks, interpolate to obtain a demosaic feature map, and perform binarization to generate a detection mask for the fabric region; multiply the original fabric image and the detection mask of the fabric region to obtain the fabric region image.

[0112] 5) The fabric area image is segmented and enhanced. Image blocks are cropped according to the sliding window, and histogram equalization, Gaussian smoothing and adaptive threshold binarization are performed on each image block to obtain the enhanced moiré image block.

[0113] 6) Perform frequency domain transformation on the enhanced moiré image patch, use dynamic weighted thinning method to locate the coordinates of the moiré frequency components, and extract the moiré frequency values;

[0114] 7) Segment the moiré frequency values ​​of all image blocks to generate moiré feature matrices in both warp and weft dimensions;

[0115] 8) Verify the validity of the moiré features extracted from the moiré feature matrix. If the features are invalid, perform frequency scaling until accurate moiré features are extracted.

[0116] 9) Obtain the spatial frequency value and direction of the camera color filter array, the focal length of the lens, and the distance from the camera to the fabric, and output the density measurement results of multiple fabric areas.

[0117] Reference Figure 2 As shown, the preprocessing method in step 2) is as follows:

[0118] 21) Extract image blocks from the captured original image using a sliding window. The sliding window is set to a square window with a side length of N pixels and a step size of S pixels. The captured original image has a height of M pixels and a width of W pixels.

[0119] 22) Perform histogram equalization on each image block to adjust the image grayscale distribution and enhance contrast;

[0120] 23) Perform max-min normalization on the equalized image blocks to uniformly scale the pixel value range to the [0, 1] interval, thus standardizing the image data.

[0121] Reference Figure 3 As shown, the method for extracting the demosaic feature index of the image patch in step 3) is as follows:

[0122] 31) Perform a two-dimensional fast Fourier transform on the preprocessed image block to obtain its spectrum;

[0123] 32) Set a period threshold T, and use the ratio of the total energy of the frequency components with a period less than or equal to the period threshold T to the total energy of all frequency components of the image block as the high-frequency saliency index of the image block to evaluate the high-frequency noise introduced by the image processing module (ISP module) of the camera to perform demosaic interpolation on the screen pixel arrangement projected on the camera color filter array.

[0124] Reference Figure 4 As shown, the frequency scaling method in step 8) is:

[0125] 81) Evaluate the sharpness of image patches;

[0126] 82) If the sharpness of an image patch is less than the set threshold, adjust the sampling rate until the sharpness reaches a local optimum;

[0127] 83) If the sharpness of an image patch is greater than the set threshold, adjust the sampling rate until the sharpness reaches the local worst.

[0128] This invention has many specific applications. The above description is only a preferred embodiment of this invention. It should be noted that for those skilled in the art, several improvements can be made without departing from the principle of this invention, and these improvements should also be considered within the scope of protection of this invention.

Claims

1. A fabric density measurement system based on moiré pattern, characterized in that, include: Adaptive fabric detection module, moiré feature extraction module, and density measurement module; The adaptive fabric detection module is used to preprocess the original fabric image captured by the camera into multiple image blocks, and construct a demosaic feature map based on the demosaic feature index of the image blocks, and further generate a fabric area image to locate the fabric area containing moiré patterns in the image. The moiré pattern feature extraction module is used to segment and enhance the generated fabric area image, perform a two-dimensional fast Fourier transform, and calculate the frequency features of the moiré pattern using a dynamic weighting method to generate moiré pattern feature matrices in the warp and weft dimensions. The density measurement module verifies the validity of the moiré feature matrix. If the feature matrix is ​​valid, a model between the moiré features and the fabric density is constructed to achieve fabric density measurement. If the feature matrix is ​​invalid, a valid moiré image is obtained through frequency scaling, and the moiré feature extraction is re-executed until it is valid.

2. The fabric density measurement system based on moiré pattern according to claim 1, characterized in that, The preprocessing method of the adaptive fabric detection module is as follows: Original fabric image captured by camera The image is cropped using a sliding window, which is set to a square window with a side length of [missing information]. pixels, stride pixels, the height of the original fabric image captured is pixels, width is Pixel; Number of slides in the horizontal direction relative to the original fabric image The calculation is as follows: ; in, Indicates rounding up; Number of slides in the vertical direction relative to the original fabric image The calculation is as follows: ; The entire original fabric image was divided into × There are 1 image patch, each image patch having a size of 1. × Pixels; Histogram equalization and normalization are performed on each image patch to standardize the image data, resulting in preprocessed image patches. .

3. The fabric density measurement system based on moiré pattern according to claim 2, characterized in that, The method for constructing the demosaic feature map by the adaptive fabric detection module is as follows: The preprocessed image blocks are processed sequentially. The spectrum is obtained by performing a two-dimensional fast Fourier transform. Set a period threshold T, and sum the energy of frequency components with periods less than or equal to the period threshold T, and then compare it with the energy of the image patch. The ratio of the sum of the energy of all frequency components is used as an image patch. Demosaic feature index ,as follows: ; in, The energy represented by the spectrum. The spectrogram mask represents the periodic threshold T; after concatenating the demosaic feature indices of all image patches, interpolation yields a demosaic feature map of size M×W. Binarize the de-mosaic feature map to generate a detection mask for the fabric region. ; Original fabric image Detection mask for fabric area Multiply to obtain the fabric area image. .

4. The fabric density measurement system based on moiré pattern according to claim 3, characterized in that, The periodic threshold T in the demosaic feature map construction method of the adaptive fabric detection module restricts the possible frequency distribution of ultra-high frequency noise, and its value range is close to the sampling period of the image.

5. The fabric density measurement system based on moiré pattern according to claim 3, characterized in that, The specific segmentation and enhancement method of the moiré feature extraction module is as follows: Image of the generated fabric area The image is cropped using a sliding window, which is set to a square window with a side length of [missing information]. pixels, stride Pixels, generated fabric area image Height is pixels, width is Pixel; Number of slides in the horizontal direction relative to the fabric area image The calculation is as follows: ; in, Indicates rounding up; Number of slides in the vertical direction relative to the fabric area image The calculation is as follows: ; The entire fabric area image is divided into × There are 1 image patch, each image patch having a size of 1. × Pixels; Histogram equalization, Gaussian smoothing, and adaptive threshold binarization are performed sequentially on each image patch to enhance moiré contrast and suppress fabric texture interference, resulting in enhanced moiré image patches. .

6. The fabric density measurement system based on moiré pattern according to claim 5, characterized in that, The specific method for calculating the frequency features of moiré patterns by the moiré feature extraction module is as follows: Enhanced moiré image patches The spectrum is obtained by performing a two-dimensional fast Fourier transform. A dynamic weighted refinement method is used in the spectrum diagram. The weighted region surrounding the moiré frequency component is selected, and a weighted average is performed based on the pixel intensity to locate the coordinates of the moiré frequency component. Calculate the moiré frequency value and direction The formula is as follows: ; Where c is the physical size of a single pixel of the camera; the moiré frequency values ​​of all image blocks are aggregated to generate moiré feature matrices in both warp and weft dimensions. and .

7. The fabric density measurement system based on moiré pattern according to claim 6, characterized in that, The specific method for validating the moiré feature matrix of the density measurement module is as follows: For each enhanced moiré image block... Moiré feature matrix from warp and weft dimensions and Extract the corresponding moiré frequency value and direction If the moiré frequency value If the value is high, then adjacent moiré patterns are distributed in the same pixel and are considered invalid; otherwise, they are considered valid.

8. The fabric density measurement system based on moiré pattern according to claim 7, characterized in that, The specific method for constructing a model between moiré pattern features and fabric density in the density measurement module to achieve fabric density measurement is as follows: For each enhanced moiré image patch Moiré feature matrix from warp and weft dimensions and Extract the corresponding moiré frequency value and direction Calculate fabric density The formula is as follows: ; in, The sampling frequency of the camera. The direction of the camera's sampling frequency. The focal length of the camera lens. For shooting distance; cloth density for stitching all image blocks. get × Fabric density in each area.

9. The fabric density measurement system based on moiré pattern according to claim 8, characterized in that, The frequency scaling method is specifically as follows: With sampling rate Perform downsampling on the fabric area image to generate a frequency scaling map; Set the resolution threshold The Tenengrad gradient method is used to evaluate the sharpness value of the fabric area image; If the image sharpness value of the fabric area is less than Then adjust the sampling rate. Continue sampling until the sharpness value of the fabric area image reaches a local optimum; otherwise, adjust the sampling rate. Until the image sharpness value of the fabric area reaches a local minimum; Moiré pattern feature extraction is performed on a clear frequency scaling map; Based on the moiré characteristics of the frequency scaling map and the sampling rate The accurate moiré features of the enhanced moiré image patch were reconstructed.

10. A moiré pattern detection method based on feature analysis, based on the system described in any one of claims 1-9, characterized in that, The method includes the following steps: 1) Use a camera to collect data from the original fabric of the density to be tested; 2) Preprocess the original fabric images captured by shooting, crop image blocks according to the sliding window, and perform histogram equalization and normalization to improve contrast; 3) Perform two-dimensional fast Fourier transform on the image blocks sequentially to obtain the spectrum. Set a period threshold and use the ratio of the detected period less than or equal to the period threshold to the sum of the energy of all frequency components of the image block as the demosaic feature index of the image block. 4) After stitching together the demosaic feature indices of all image blocks, interpolate to obtain a demosaic feature map, and perform binarization to generate a detection mask for the fabric region; multiply the original fabric image and the detection mask of the fabric region to obtain the fabric region image. 5) The fabric area image is segmented and enhanced. Image blocks are cropped according to the sliding window, and histogram equalization, Gaussian smoothing and adaptive threshold binarization are performed on each image block to obtain the enhanced moiré image block. 6) Perform frequency domain transformation on the enhanced moiré image patch, use dynamic weighted thinning method to locate the coordinates of the moiré frequency components, and extract the moiré frequency values; 7) Segment the moiré frequency values ​​of all image blocks to generate moiré feature matrices in both warp and weft dimensions; 8) Verify the validity of the moiré features extracted from the moiré feature matrix. If the features are invalid, perform frequency scaling until accurate moiré features are extracted. 9) Obtain the spatial frequency value and direction of the camera color filter array, the focal length of the lens, and the distance from the camera to the fabric, and output the density measurement results of multiple fabric areas.