Fabric density detection system based on infrared and visible light fusion

By combining multispectral collaborative imaging and deep learning feature fusion, the adaptability and accuracy issues of textile density detection on complex fabrics have been solved, achieving high-precision and automated fabric density measurement, which is suitable for quality control and product grading in textile production.

CN121724929AInactive Publication Date: 2026-03-24SHANDONG PRECISION PROD QUALITY INSPECTION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing textile density detection technologies have poor adaptability, low accuracy, and insufficient robustness on dark-colored and complex-textured fabrics. Furthermore, the fusion of infrared and visible light fails to fully exploit the complementary advantages of multispectral features, resulting in insufficient detection accuracy and reliability.

Method used

By employing multispectral collaborative imaging technology and achieving feature-level fusion through a dual-branch convolutional neural network, combined with multi-scale periodic perception and local structure enhancement algorithms, spatial-frequency joint analysis is performed to achieve high-precision calculation and reliability assessment of fabric density.

Benefits of technology

It significantly improves the accuracy and robustness of fabric density detection, enabling efficient and automated density measurement under complex working conditions, reducing labor costs and subjective errors, and improving detection efficiency and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724929A_ABST
    Figure CN121724929A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of nondestructive testing in the textile industry, and discloses a fabric density detection system based on infrared and visible light fusion. The system comprises a multispectral image acquisition unit, an image preprocessing and precise registration unit, a bimodal depth feature fusion unit, a density calculation and reliability analysis unit and a result output and man-machine interaction unit. Visible light and near-infrared images are synchronously collected, a double-branch convolutional neural network is combined with a deformable convolution and mixed attention mechanism to realize feature-level adaptive fusion, and enhanced features insensitive to color and texture changes are generated; a multi-scale periodic sensing network and airspace-frequency domain conjoint analysis are adopted, and guided filtering edge enhancement and a confidence coefficient evaluation mechanism are combined, so that accurate calculation and reliability verification of warp and weft yarn density are realized. The system effectively breaks through the limitation of single visible light detection on dark complex fabrics, and the detection precision, robustness and industrial applicability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of nondestructive testing in the textile industry, and in particular to a fabric density detection system based on infrared and visible light fusion. BACKGROUND

[0002] As a core indicator for evaluating the quality of textiles, fabric density directly affects the mechanical properties, appearance style and use comfort. Therefore, it is crucial to realize fast and accurate density detection for the quality control, cost management and product grading of textile production.

[0003] Traditional manual visual counting method has inherent defects such as low efficiency and large subjective error, which is difficult to meet the demand of intelligent production. Although the existing automatic detection technology based on machine vision has improved the efficiency to a certain extent, it mainly uses single visible light imaging. The accuracy of this method is seriously limited by the color, pattern and texture of the fabric surface, which leads to difficulty in feature extraction and sharp decline or even failure of counting accuracy. In addition, factors such as environmental light changes, surface fluff, wrinkle deformation and detection angle deviation further weaken the robustness and industrial applicability of single visible light vision system. Some studies try to introduce near-infrared imaging technology to improve the detection effect by using its penetration characteristics for some dyes. However, single infrared image often lacks sufficient texture details and spatial resolution, making it difficult to achieve accurate yarn positioning and boundary recognition. More importantly, the fusion of infrared and visible light in existing technologies is mostly limited to simple pixel-level superposition, which fails to fully exploit the complementary advantages of multispectral features. Moreover, there is a lack of effective technical means in key areas such as feature alignment, weight distribution and multiscale analysis, which restricts the further improvement of detection accuracy and reliability.

[0004] Therefore, it is urgent to design an intelligent detection system that can deeply fuse multispectral information, overcome the limitations of single modal, and have strong anti-interference ability, to realize high-precision, high-efficiency and automatic measurement of fabric density under complex working conditions. SUMMARY

[0005] The present application proposes a fabric density detection system based on infrared and visible light fusion. To address the poor adaptability, low precision and insufficient robustness of existing single visible light detection methods on dark and complex texture fabrics, a complete technical architecture of multispectral collaborative imaging, deep learning feature fusion and spatial-frequency domain joint analysis is constructed. The system synchronously acquires fabric images under visible light and near-infrared bands, realizes deep fusion at the feature level using a double-branch convolutional neural network, generates enhanced feature representation that is insensitive to color changes and texture interference, and combines multi-scale periodic perception and local structure enhancement algorithms to realize accurate calculation and reliability evaluation of warp and weft yarn density.

[0006] The application provides a fabric density detection system based on infrared and visible light fusion, which is suitable for high-precision, high-efficiency and automatic measurement of fabric density under complex working conditions.

[0007] A multispectral image acquisition unit is used for synchronously or quasi-synchronously acquiring visible light images and near-infrared images of the measured fabric; the unit integrates a high-resolution industrial camera, controllable visible light and near-infrared light sources, and a controller for ensuring accurate synchronization of the acquisition timing, thereby providing high-quality paired bimodal original data for subsequent processing; in order to ensure the physical accuracy of the measurement results, the unit must be calibrated for spatial resolution before being put into use, a conversion relationship R between pixels and millimeters is obtained by analyzing the calibration plate image and is fixed in the system, and the conversion relationship R provides a crucial reference scale for converting pixel distance into physical density.

[0008] An image preprocessing and accurate registration unit is electrically connected with the multispectral image acquisition unit and is used for performing a series of preprocessing operations such as filtering and noise reduction, contrast enhancement, geometric distortion correction and brightness normalization on the acquired visible light and near-infrared images, and performing sub-pixel level accurate spatial registration on two images belonging to the same field of view based on an improved feature point matching algorithm and a nonlinear optimization model, so as to establish a reliable bimodal image correspondence; the accurate registration is a fundamental prerequisite for realizing subsequent meaningful feature fusion;

[0009] A bimodal deep feature fusion unit, the core of which is a double-branch deep convolutional neural network, is used for extracting multi-level and multi-scale deep feature representations from the accurately spatially registered visible light images and near-infrared images; the unit includes a feature alignment module based on deformable convolution and a hybrid attention fusion module combining channel attention and spatial attention, which are used for adaptively weighting and fusing feature information from two spectral modalities, and outputting an enhanced fusion feature map which is not sensitive to color and texture changes; the fusion feature map fuses the advantages of bimodalities and is a key to improving the robustness of the system;

[0010] A density calculation and reliability analysis unit receives the fusion feature map; the unit adopts a strategy of joint spatial-frequency domain analysis: on the one hand, it extracts the global periodicity features of the texture through a multi-scale periodicity perception network and performs frequency domain main frequency estimation by using two-dimensional Fourier transform; on the other hand, it uses a guided filter edge enhancement algorithm to strengthen the yarn edge response in the spatial domain and performs local verification through projection contour analysis and peak detection. Finally, the unit combines the analysis results in the frequency domain and the spatial domain, and calculates the warp density and the weft density of the fabric in combination with an embedded confidence evaluation mechanism, while outputting the reliability index obtained in the evaluation process, thereby realizing controllable quality of the detection results;

[0011] The results output and human-computer interaction unit is used to display, store, and transmit detection results and configure system parameters. The output information includes density values, confidence levels, key feature images during processing, fabric images marked with yarn counting benchmarks, and system status logs. It provides users with a complete and traceable information chain from raw data to final results, completing a complete closed loop from image acquisition to density report generation.

[0012] Furthermore, the dual-modal deep feature fusion unit, which implements precise feature alignment and adaptive weighted fusion, specifically includes the following:

[0013] Dual-branch deep feature extraction network: Two deep convolutional neural network branches with identical structures but independently initialized weights are used to process the precisely registered visible light image and near-infrared image respectively; each deep convolutional neural network branch consists of multiple convolutional layers, batch normalization layers, activation function layers and residual connection blocks, and extracts features from low-level edge texture features to high-level semantic abstract features through a hierarchical structure.

[0014] Deformable convolutional feature alignment module: At specific levels of the deep convolutional neural network branch, a deformable convolutional layer is introduced to establish a dynamic receptive field. Using the feature map of the visible light branch as a geometric reference, the feature map of the near-infrared branch is adaptively learned in terms of spatial deformation field, which effectively compensates for the small spatial misalignment caused by registration residuals, differences in physical properties between modes, or fabric deformation.

[0015] Hybrid Attention Fusion Module: The feature maps of the two aligned modalities are stitched together along the channel dimension to form a preliminary fused feature map. First, the importance weights of each feature channel are learned through the channel attention module to emphasize information-rich feature channels and suppress redundant channels. Then, the spatial attention module generates a spatial weight heatmap to highlight key spatial regions in the feature map that are related to the yarn structure. Finally, the feature maps that have undergone dual channel and spatial weighting are summed element-wise to output a fused feature map that is complementary in information and enhances features.

[0016] Furthermore, the density calculation and reliability analysis unit, which performs joint spatial-frequency domain analysis and reliability assessment, specifically includes the following steps:

[0017] Step S1: Input the fused feature map into the multi-scale periodicity network. The multi-scale periodicity network contains three parallel convolutional branches, which use convolutional kernels of different sizes to capture texture periodicity information at different scales. The multi-scale features are fused through the feature pyramid structure to generate a multi-scale periodicity feature map.

[0018] Step S2: Calculate the one-dimensional projection curves of the multi-scale periodic feature map along the warp and weft directions respectively, remove high-frequency noise by sliding window averaging filter, retain the low-frequency components that reflect the periodicity of the yarn, and obtain the one-dimensional projection signals in the two directions.

[0019] Step S3: Perform fast Fourier transform on the one-dimensional projection signals in the two directions respectively to obtain the power spectral density distribution. Use the peak detection algorithm to identify significant spectral peaks other than the DC component. The corresponding frequencies in the warp and weft directions are the main frequencies f of the fabric texture in the warp and weft directions.

[0020] Step S4: Based on the main frequency f obtained in step S3 and the image spatial resolution R (pixels / mm), calculate the frequency domain analysis result P_freq (mm / thread) using the formula P_freq=R / f. The frequency domain analysis result P_freq represents the yarn spacing estimated from the perspective of the global frequency domain.

[0021] Step S5: Simultaneously, the fused feature map is input into the guided filtering-based local structure enhancement algorithm; the guided filtering-based local structure enhancement algorithm uses the gradient magnitude map of the fused feature map as the guide image, and maintains the edge characteristics while suppressing noise through the local linear model to generate a binary edge map with clear yarn boundaries and continuous integrity;

[0022] Step S6: Perform warp and weft projection analysis on the binary edge map respectively. By finding the positions of periodically occurring peaks (corresponding to yarn centers) or troughs (corresponding to yarn gaps) in the projection curve, calculate the spatial analysis result P_spatial (unit: mm / yarn) using the autocorrelation function or peak spacing statistical method. The spatial analysis result P_spatial represents the yarn spacing obtained from the local spatial structure analysis.

[0023] Step S7: Introduce a confidence assessment mechanism to calculate the relative difference α between the frequency domain analysis result P_freq and the spatial domain analysis result P_spatial: α = |P_freq - P_spatial| / ((P_freq + P_spatial) / 2). If α is lower than or equal to the preset consistency threshold θ (e.g., 0.15), the results of the two methods are considered consistent, and the final yarn spacing P_final = β × P_freq + (1 - β) × P_spatial, where β is a weighting coefficient learned based on historical data. If α is higher than the threshold θ, the spatial domain analysis result P_spatial is preferentially used as the final yarn spacing P_final, and a system alarm and manual review flag are triggered.

[0024] Step S8: Based on the final determined yarn spacing P_final, calculate the fabric density value (threads / cm or threads / inch), and combine the results of the confidence assessment mechanism, consistency indicators and quality control requirements to output a complete test report.

[0025] By adopting the above solution, the beneficial effects achieved by the present invention are as follows:

[0026] This invention overcomes the detection bottleneck of single visible light imaging on dark, complex-patterned fabrics by constructing a dual-modal collaborative imaging system using infrared and visible light and employing a feature-level fusion strategy based on deep learning. Near-infrared light has good penetration for most organic dyes, effectively revealing the physical structure and internal texture of yarns obscured by color, while visible light provides rich surface details and pattern information. Guided by deformable convolution and hybrid attention mechanisms, the system adaptively enhances useful features from different modalities, suppresses interference from illumination changes and surface fuzz, and generates robust feature representations insensitive to color and texture changes. This significantly improves the system's adaptability and detection accuracy across diverse fabric types, solving the technical challenge of traditional methods failing in specific scenarios.

[0027] This invention achieves dual verification and accurate calculation of fabric density by designing a multi-scale periodic sensing network and a spatial-frequency joint analysis mechanism. The multi-scale analysis network can simultaneously capture different texture periodic features from fine to coarse, avoiding the limitations of single-scale analysis on complex fabrics. Frequency domain analysis robustly extracts the main periodic information from a global perspective, exhibiting inherent robustness to local noise, minor wrinkles, and texture defects; while spatial edge enhancement and projection analysis provide accurate yarn position information and boundary evidence from a local perspective. Through a dynamic fusion strategy based on statistical consistency, the invention fully utilizes the anti-interference capability of frequency domain analysis while ensuring the reliability of results even when frequency domain analysis may fail (e.g., non-strictly periodic textures, spectral aliasing), thus maintaining high accuracy and strong robustness in various complex scenarios.

[0028] Furthermore, the deformable convolutional feature alignment module introduced in this invention effectively compensates for potential nonlinear spatial deviations between dual-modal images, ensuring spatial consistency of the fused features; while the guided filtering-based edge enhancement algorithm effectively suppresses noise interference while maintaining edge sharpness. This system provides the textile industry with a non-contact, high-efficiency, and high-precision automated density detection solution, significantly reducing labor costs and subjective errors, improving detection efficiency and consistency, and laying a solid technical foundation for digital and intelligent quality control and process optimization in textile production. It has significant industrial application value and market prospects. Attached Figure Description

[0029] Figure 1This is a system structure block diagram of a fabric density detection system based on the fusion of infrared and visible light proposed in this invention;

[0030] Figure 2 This is a schematic diagram of the network structure of the dual-modal deep feature fusion unit described in this embodiment of the invention;

[0031] Figure 3 This is a flowchart of the density calculation and reliability analysis unit described in this embodiment of the invention. Detailed Implementation

[0032] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0033] Example 1

[0034] according to Figure 1 This invention provides a fabric density detection system based on the fusion of infrared and visible light, the system comprising:

[0035] The multispectral image acquisition unit includes a high-resolution monochrome industrial camera (5-megapixel resolution, IMX264 CMOS sensor) equipped with a 2x telecentric lens to eliminate perspective distortion. The visible light source uses a highly uniform, flicker-free white LED surface light source (color temperature 6500K, color rendering index >90), and the surface of the light source is equipped with a diffuser to ensure that the uniformity of light intensity distribution on the fabric surface is greater than 90%. The near-infrared light source uses an LED light source with a center wavelength of 850 nm, a half-width of ±20 nm, and adjustable output power. This wavelength has good penetration for common textile dyes and is within the safe range for the human eye. It adopts an FPGA (Field Programmable Gate Array) based synchronization controller (FPGA board, chip model Xilinx Artix-7XC7A35T). This synchronization controller uses custom hardware description language (Verilog) code to precisely coordinate the triggering of the light source and the exposure of the camera.

[0036] The multispectral image acquisition unit operates as follows: It operates in a time-division trigger mode. The synchronous controller first triggers the visible light source to illuminate and synchronously acquires visible light images. After the visible light source is extinguished, a delay of 0.5 ms is followed by triggering the near-infrared light source to illuminate and synchronously acquiring near-infrared images. The entire cycle is less than 20 ms to ensure no fabric displacement between acquisitions. The fabric under test is conveyed by a precision roller system driven by a servo motor and equipped with an S-type tension sensor (range 0-100N, accuracy ±0.5% FS) and a correction mechanism based on a photoelectric sensor, ensuring that the fabric is centered in the field of view, with a smooth surface and no wrinkles during each acquisition. Before being put into use, the system requires spatial resolution calibration using a CNC-machined standard ceramic calibration plate (checkerboard pattern, grid physical size 1.000mm ±0.001mm). The calibration is performed using functions in the OpenCV 4.5 library to calculate the image spatial resolution R = 50.0 (pixels / mm). This parameter R is fixed in the system configuration file as the baseline parameter for all density calculations.

[0037] The image preprocessing and precise registration unit is implemented using an embedded GPU computing platform (NVIDIA Jetson XavierNX, 16GB version, running Ubuntu 18.04 LTS operating system). This unit is electrically connected to the multispectral image acquisition unit and is responsible for preprocessing and registering the acquired visible light and infrared images. First, adaptive bilateral filtering is applied to both the visible light and infrared images to remove noise while preserving edges, with parameters set to diameter d=9, SigmaColor=75, and SigmaSpace=75. Then, a contrast-limited adaptive histogram equalization algorithm is used to enhance the overall contrast, with ClipLimit=2.0 and TileGridSize=(8,8). Geometric distortion correction is performed on the image using the intrinsic parameter matrix and distortion coefficients obtained from camera calibration. The registration process first uses accelerated KA... The ZE feature point detection algorithm (OpenCV AKAZE_create, descriptor type KAZE, threshold 0.001) extracts robust feature points from two images, then uses LATCH binary descriptors (64 bytes) for fast matching, uses Hamming distance as a similarity metric, and combines the PROSAC algorithm (PROSAC in the usac method, confidence 0.99) to remove mismatched points. Finally, it solves the non-rigid transformation model (OpenCV's thinPlateSpline deformation model) using the moving least squares method to accurately register the infrared image to the visible light image coordinate system, achieving sub-pixel level alignment accuracy (average reprojection error <0.5 pixels).

[0038] The dual-modal deep feature fusion unit is deployed on a high-performance industrial computer (Intel i7 processor, 32GB RAM, RTX 3080 GPU) running Windows 10 and using PyTorch 1.9.0 as the deep learning framework. Its dual-branch feature extraction network is an improvement on the ResNet-34 architecture, removing the final fully connected layer and introducing a deformable convolutional module after the conv4_x layer. Its hybrid attention fusion module receives the feature maps (H / 16×W / 16×512) output from the two branches at the conv5_x layer. After weighted fusion using channel and spatial attention, a 1×1 convolution reduces the dimensionality, outputting a fused feature map of H / 16×W / 16×256.

[0039] The density calculation and reliability analysis unit runs on the same industrial computer. The three parallel branches of its multi-scale periodic sensing network have convolutional kernel sizes of 3×3, 5×5, and 7×7, respectively. The output feature maps are upsampled to the same size and then stitched together. Frequency domain analysis uses two-dimensional FFT. Spectral peak detection uses local maximum detection combined with parabolic interpolation to improve frequency estimation accuracy. In its guided filtering edge enhancement algorithm, the filtering radius is set to 8, the regularization parameter ε is 0.04, the confidence evaluation threshold θ is set to 0.15, and the fusion weight β is based on historical data of 1000 standard fabric samples, and is set to 0.7 in this embodiment.

[0040] The results output and human-machine interaction unit includes a 21.5-inch industrial touchscreen display (1920x1080 resolution). Its software interface is developed based on the Qt framework and can display raw visible light / infrared images, fused feature maps, edge enhancement maps, longitudinal and latitudinal projection curves with peak markers, as well as information such as final density values, confidence indices, and system status in roots / cm and roots / inch units in real time. The results output and human-machine interaction unit is also equipped with a gigabit Ethernet interface, which uploads the detection results (including density value, confidence, timestamp, and fabric ID) encapsulated in JSON format to the factory MES system in real time via the MQTT protocol. At the same time, all images and system logs during the processing are stored locally on a 256GB solid-state drive.

[0041] Example 2

[0042] This embodiment is based on Embodiment 1. In this embodiment, the dual-modal deep feature fusion unit realizes the process of precise feature alignment and adaptive weighted fusion, specifically including the following:

[0043] Dual-branch deep feature extraction network: Both branches use ResNet-34 as the backbone network, and the input image size is uniformly scaled to 512×512 pixels. Each branch contains 34 convolutional layers. The original ResNet-34 structure is maintained in the first four stages (conv1, conv2_x, conv3_x, conv4_x), and improvements are introduced after the conv4_x stage (feature map size is 32×32×256).

[0044] Deformable Convolutional Feature Alignment Module: At the end of the conv4_x stage, the feature map F_ir of the near-infrared branch is input to a deformable convolutional layer. The offset field of this deformable convolutional layer is obtained by regressing the feature map F_vis of the same layer of the visible light branch through an offset network containing two 3×3 convolutional layers and one 1×1 convolutional layer. The output F_ir_aligned of this deformable convolutional layer is precisely aligned with F_vis in the feature space, effectively compensating for the registration residual.

[0045] The hybrid attention fusion module consists of two parts: its channel attention module, which performs global average pooling and global max pooling on the concatenated feature map F_concat (32×32×512) along the channel dimension, adds the two pooling results, passes them through two fully connected layers (the first reduces the dimension to 512 / 16=32, the second increases the dimension back to 512), and then generates a channel weight vector W_c using the Sigmoid function. W_c is then multiplied by F_concat channel by channel to complete channel attention weighting. Its spatial attention module performs average pooling and max pooling on the channel-weighted feature map along the channel dimension to obtain two 32×32×1 feature maps, concatenates them into a 32×32×2 feature map, passes it through a 7×7 convolutional layer to reduce it to a single channel, and then generates a spatial weight map W_s using the Sigmoid function. W_s is then multiplied element by element by the channel-weighted feature map to complete spatial attention weighting.

[0046] Feature fusion and dimensionality reduction: The feature map, which has undergone dual weighting of channels and space, is passed through a 1×1 convolutional layer to reduce the number of channels from 512 to 256, and outputs a fused feature map F_fused. This fused feature map F_fused not only retains the complementary information of the two modes, but also highlights the key features related to yarn detection.

[0047] Example 3

[0048] according to Figure 2 and Figure 3 This embodiment is based on Embodiment 2. In this embodiment, the density calculation and reliability analysis unit realizes the process of joint spatial-frequency domain analysis and reliability assessment, specifically including the following steps:

[0049] Step S1: The fused feature map F_fused is input into an upsampling module to increase its spatial resolution from 32×32 to 64×64. Then, the upsampled feature map is input into a multi-scale periodicity perceptron. Three parallel branches use 3×3, 5×5, and 7×7 convolutional kernels, respectively. Each branch contains two convolutional layers and one batch normalization layer, and the output feature map size is 64×64×64. The three are concatenated to obtain a 64×64×192 feature map, which is then fused into a 64×64×128 multi-scale periodicity feature map F_ms through a 1×1 convolutional layer.

[0050] Step S2: The multi-scale periodic feature map F_ms is flattened into a 4096×128 matrix in spatial dimension. The average projection along the width direction (longitude) and height direction (latitude) of the image is calculated to obtain two one-dimensional signals S_w (length 64) and S_h (length 64). The projection signals are then subjected to Savitzky-Golay filtering with a window length of 5 and a polynomial order of 2 to smooth the noise.

[0051] Step S3: After zero-padding the two smoothed one-dimensional signals S_w and S_h to 256 points, perform an FFT transform to obtain the amplitude spectrum. Use a peak detection algorithm to find the first three significant peaks in the amplitude spectrum. Confirm the main peak by comparing the amplitude difference between the peak and the adjacent valley values, and record its corresponding frequencies f_w and f_h.

[0052] Step S4: Given that the image resolution is R pixels / mm (obtained through camera calibration), the theoretical yarn spacing is: P_freq_w = R / f_w, P_freq_h = R / f_h.

[0053] Step S5: Calculate the Sobel gradients in the X and Y directions of the fused feature map F_fused to obtain the gradient magnitude map G. Using the gradient magnitude map G as the guide map and the fused feature map F_fused as the input map, perform the guided filtering edge enhancement algorithm to obtain the edge enhancement map E. Apply adaptive threshold segmentation to the edge enhancement map E and use the local OTSU algorithm with a window size of 15×15 to obtain the binary edge map B.

[0054] Step S6: Project the binary edge map B horizontally (latitude-dense) and vertically (longitude-dense) to obtain the projection curves. Using the find_peaks algorithm, with a minimum horizontal spacing of 5 pixels and a minimum spuriousness of 0.15 times the maximum value of the projection curve, detect the positions of all significant peaks in the projection curve that meet the conditions. Calculate the average distance (in pixels) between adjacent peaks and convert it into physical distances P_spatial_w and P_spatial_h.

[0055] Step S7: Calculate the consistency measure between the frequency domain and spatial domain results: α = |P_freq - P_spatial| / ((P_freq + P_spatial) / 2). If α ≤ 0.15, take the weighting coefficient β = 0.7 and calculate P_final = β × P_freq + (1 - β) × P_spatial = 0.7 × P_freq + 0.3 × P_spatial; if α > 0.15, then P_final = P_spatial, and mark "requires manual review" in the inspection report, while recording the specific values ​​of inconsistencies.

[0056] Step S8: Final density = 10 / P_final (if P_final is in millimeters, then the density is in roots / cm). The system outputs a complete test report including warp density, weft density, confidence index, processing timestamp, fabric ID, and quality grade recommendation.

[0057] The guided filtering edge enhancement algorithm described in step S5 begins with the real-time processing of the fused feature map F_fused. First, the Sobel gradients of the fused feature map F_fused in the X and Y directions are calculated, and a gradient magnitude map G is synthesized. This gradient map clearly represents the direction and intensity of the yarn edge and is established as the guide image. The fused feature map F_fused is used as the input image. The core of the algorithm utilizes the guided filtering principle, using the gradient map G to guide the filtering process of the fused feature map F_fused. In this process, the filtering radius is set to 8 to define the neighborhood size used to calculate the local linear relationship, while the regularization parameter ε is 0.04 to balance the intensity of edge preservation and noise suppression to prevent overfitting. Finally, the algorithm outputs an edge enhancement map E. Under the guidance of the gradient map G, this image achieves specific contrast enhancement at the yarn boundary (high gradient region) while maintaining smoothness in the flat area of ​​the fabric (low gradient region), thereby significantly improving the clarity and continuity of the yarn outline and providing a better data foundation for spatial projection analysis.

[0058] Example 4

[0059] This embodiment is based on Embodiment 2. In this embodiment, as a simplified implementation scheme for low-to-mid-range applications, the density calculation and reliability analysis unit performs density calculations, specifically including the following steps:

[0060] Step S1: Convert the fused feature map F_fused into a single-channel grayscale image and perform Gaussian smoothing (σ=1.5) to remove high-frequency noise to obtain a smoothed image.

[0061] Step S2: Perform projection analysis on the smoothed image in the horizontal (latitudinal) and vertical (meridian) directions to obtain the projection signal curves in the two directions.

[0062] Step S3: Perform a one-dimensional Fourier transform on each projected signal curve, determine the main frequency f by finding the maximum value of the amplitude spectrum, and calculate the theoretical spacing P_freq=R / f.

[0063] Step S4: Simultaneously, the yarn edges are directly extracted from the fused feature map using the improved Canny edge detection algorithm (Gaussian filter σ=1.0, high-low threshold ratio 1:2).

[0064] Step S5: Perform a morphological closing operation (3×3 rectangular structuring element) on the edge image to connect the breakpoints, then perform a probabilistic Hough line transform to detect line clusters in the main directions, and estimate the yarn spacing P_spatial by counting the number of lines per unit length.

[0065] Step S6: Take the arithmetic mean of P_freq and P_spatial as the final yarn spacing and calculate the density value. When the difference between the two exceeds 20%, a warning message will be given, and the operator is advised to perform manual confirmation.

[0066] The innovations of this invention lie in the introduction of a dual-modal feature alignment and adaptive fusion module based on deformable convolution and hybrid attention mechanisms, which effectively solves the problems of feature differences and spatial misalignment between infrared and visible light images, achieving information complementarity and interference suppression; a multi-scale texture periodicity perception network is designed, which can robustly extract global periodic features of yarns of different thicknesses from the fused features, overcoming the limitations of single-scale analysis; a local yarn boundary refinement process based on guided filtering and spatial projection verification is proposed, which improves local positioning accuracy while maintaining global periodicity stability; and a dynamic weight fusion mechanism for frequency domain analysis and spatial domain verification is constructed, which adaptively adjusts the final result according to confidence evaluation, significantly improving the detection accuracy and reliability of the system on complex fabrics.

[0067] The present invention and its embodiments have been described above. This description is not restrictive. The accompanying drawings are only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this description and designs a similar structure and embodiment without departing from the spirit of the present invention, such design should fall within the protection scope of the present invention.

Claims

1. A fabric density detection system based on the fusion of infrared and visible light, characterized in that, The system includes: a multispectral image acquisition unit for synchronously or quasi-synchronously acquiring visible light and near-infrared images of the fabric under test; an image preprocessing and precise registration unit, electrically connected to the multispectral image acquisition unit, for preprocessing the acquired visible light and near-infrared images and performing sub-pixel-level precise spatial registration of the two images; a dual-modal depth feature fusion unit, comprising a dual-branch deep convolutional neural network, a deformable convolutional feature alignment module, and a hybrid attention fusion module, for extracting depth features from the registered visible light and near-infrared images and performing adaptive fusion to output an enhanced fused feature map; a density calculation and reliability analysis unit, which receives the fused feature map, performs frequency domain analysis through a multi-scale periodic sensing network, and performs spatial domain analysis using a guided filtering-based local structure enhancement algorithm, combined with a confidence assessment mechanism to calculate the warp and weft densities of the fabric; and a result output and human-computer interaction unit for displaying, storing, transmitting detection results, and configuring system parameters.

2. The fabric density detection system based on the fusion of infrared and visible light according to claim 1, characterized in that: The multispectral image acquisition unit includes a visible light source, a near-infrared light source, and a synchronization controller; the synchronization controller adopts a time-division triggering mode, sequentially triggering the visible light source and the near-infrared light source, and synchronously acquiring the corresponding images.

3. The fabric density detection system based on the fusion of infrared and visible light according to claim 1, characterized in that: The image preprocessing and precise registration unit uses the accelerated KAZE feature point detection algorithm and LATCH binary descriptor for feature matching, and combines the PROSAC algorithm and moving least squares method to solve the non-rigid transformation model to achieve sub-pixel level precise registration from infrared image to visible light image coordinate system.

4. The fabric density detection system based on the fusion of infrared and visible light according to claim 1, characterized in that: In the dual-modal deep feature fusion unit, the deformable convolutional feature alignment module uses the feature map of the visible light branch as a geometric reference and performs adaptive spatial deformation field learning on the feature map of the near-infrared branch through deformable convolutional layers to compensate for spatial misalignment.

5. The fabric density detection system based on the fusion of infrared and visible light according to claim 1, characterized in that: The hybrid attention fusion module includes a channel attention module and a spatial attention module. The channel attention module uses a compressed-excitation network structure to learn the importance weights of each feature channel. The spatial attention module generates a spatial weight heatmap based on a convolutional block attention mechanism, performs element-wise weighted summation on the double-weighted feature maps, and outputs a fused feature map.

6. The fabric density detection system based on the fusion of infrared and visible light according to claim 1, characterized in that: The density calculation and reliability analysis unit adopts a joint spatial-frequency domain analysis strategy. It extracts global periodic features through a multi-scale periodic sensing network and estimates the dominant frequency in the frequency domain. It then enhances the spatial yarn edge response by combining a guided filter edge enhancement algorithm. Local verification is performed through projection contour analysis and peak detection. The comprehensive analysis results are used to calculate the warp and weft densities and reliability indicators through a confidence assessment mechanism.

7. A fabric density detection system based on the fusion of infrared and visible light according to claim 6, characterized in that: The specific decision-making mechanism of the fusion decision module is as follows: First, calculate the relative difference between the frequency domain analysis result and the spatial domain analysis result, compare this difference with a preset confidence evaluation threshold, and if the difference is within an acceptable range, the final yarn spacing is the weighted fusion result of the two with weight coefficients. If the difference exceeds the acceptable range, the system will prioritize the spatial domain analysis result as the final value and trigger an alarm to indicate that manual review is required. This decision-making mechanism is precisely expressed by the following piecewise function: Among them, relative difference The calculation formula is: in, Indicates the final yarn spacing. This represents the results of the frequency domain analysis. This indicates the results of the spatial domain analysis. Indicates the weighting coefficient. Indicates relative difference. This indicates a preset threshold.

8. A fabric density detection system based on the fusion of infrared and visible light according to claim 1, characterized in that: The result output and human-computer interaction unit can display the original image, fused feature map, edge enhancement map, projection curve, density value and confidence index in real time, and upload the detection results to the factory management system through the network interface.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the image preprocessing and precise registration, dual-modal depth feature fusion, density calculation and reliability analysis functions of the system as described in any one of claims 1-8.