Color matching compensation method based on online detection of color difference of helmet paint surface

By acquiring multi-band reflection intensity and near-infrared texture morphology images of the helmet paint surface, and combining them with a texture-spectral response fingerprint database, the problem of inaccurate color difference detection caused by texture interference in online inspection of helmet coating quality was solved, achieving efficient and accurate color difference judgment and real-time color adjustment compensation for the coating equipment.

CN122434873APending Publication Date: 2026-07-21MEIZHOU JINYUE HELMETS LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MEIZHOU JINYUE HELMETS LTD
Filing Date
2026-04-27
Publication Date
2026-07-21

Smart Images

  • Figure CN122434873A_ABST
    Figure CN122434873A_ABST
Patent Text Reader

Abstract

The present application relates to a color matching compensation method based on online detection of helmet paint color difference, aiming to solve the problem of inaccurate color difference determination caused by the interference of paint texture microstructure on the response of reflected spectrum. The core technical scheme includes: obtaining helmet paint multi-band reflection and near-infrared geometric feature data through narrow-band tunable light source and multi-spectral imaging; using neural network to classify and intensity quantify the surface texture, and matching the texture-spectrum fingerprint library to extract the texture-induced spectral shift mode, and modulating the ideal spectral response to generate adaptive theoretical standard curve; comparing the measured and theoretical spectral sequences wave by wave, and fusing through adaptive weight coefficient matrix to realize comprehensive color difference determination with physical and visual characteristics; automatically generating spraying color matching instructions when the difference is too large to realize closed-loop control. The present application effectively improves the color detection accuracy and automatic color matching intelligence level of complex texture paint.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multispectral visual inspection and industrial surface color difference correction technology, and in particular to a color compensation method based on online detection of color difference in helmet paint. Background Technology

[0002] Currently, in the field of online inspection of coating quality for industrial products such as helmets, color consistency evaluation largely relies on standard color comparison and automatic color difference correction technology. Typical industrial automated production lines extensively adopt online color difference detection solutions based on spectrophotometers, RGB cameras, or multispectral vision. As the requirements for appearance color accuracy and uniformity of high-end consumer products such as helmets continue to increase, mainstream technologies are continuously developing towards high-resolution imaging and multispectral / superspectral fusion detection.

[0003] Existing automated color difference detection systems typically employ the following technical approach: Under controlled light conditions, high-sensitivity spectral sensors or multi-band cameras acquire the reflectance spectrum information or RGB data of the sample surface. This data is then compared pixel-by-pixel with the theoretical reflectance spectrum of a preset standard color chart to calculate various color difference criteria, including ΔE. When the color difference exceeds the tolerance during detection, the system can implement closed-loop control for color compensation and adjust the pigment material ratio in the spraying equipment to reduce the risk of batch-to-batch color difference. Current mainstream multispectral vision equipment can achieve high-precision color data acquisition across 32 to 64 bands and, in conjunction with AI segmentation / matching models, improve detection coverage and sensitivity.

[0004] On complex industrial components such as helmets, the paint surface often exhibits complex textures such as matte particles, high-gloss flow lines, simulated brushed metal, silkscreen printing, and micro-pits. These textures, with their localized scattering and spatial optical heterogeneity, significantly affect reflectivity across various wavelengths, causing morphological distortion between the measured spectral response and the ideal standard color spectrum. When the detection system uses band contrast or tristimulus value models for standard color comparison, the presence of surface textures easily introduces color measurement distortion, leading to a significant deviation of the color difference criterion from the actual perceived color difference, thus affecting the accuracy and reliability of subsequent color compensation.

[0005] Currently, mainstream methods for handling texture interference in publicly available literature and industry applications include: reducing high-frequency textures through spatial filtering techniques in image preprocessing (such as Gaussian blurring and median filtering); selecting only "flat, texture-free areas" as comparison samples using semantic segmentation or region mask recognition; using deep learning to generate detextured reconstructed images to improve comparison purity; and developing multi-view or multi-angle multispectral acquisition to weaken texture orientation sensitivity. Some patent papers and top conference papers have also proposed introducing attention mechanisms to assign dynamic low weights to significant texture regions to suppress their impact on color difference. However, the above methods generally suffer from the following technical shortcomings: First, steps such as spatial filtering and detexturing reconstruction significantly increase the complexity of the system software and the computational load, making them unsuitable for the real-time closed-loop requirements of high-volume, high-cycle production lines.

[0006] Second, taking only the areas without texture will significantly reduce the representativeness of the test samples, making it difficult to fully reflect the overall uniformity of the coating, and it is difficult to implement in working conditions such as the composite curved surface of helmets where textures are widely distributed.

[0007] Third, deep learning end-to-end models are highly dependent on training samples with complex textures, and their generalization ability and on-site interpretability are insufficient, and they are difficult to maintain.

[0008] Fourth, some existing solutions rely on adding multi-angle, multi-light source or special filter / polarization hardware, which leads to a sharp increase in the size, cost and maintenance threshold of the detection equipment, and makes system integration difficult.

[0009] Fifth, traditional color difference comparison models fail to analyze and separate the influence of texture structure on spectral response from a physical perspective. They are prone to misjudging predictable spectral distortion caused by texture as color deviation in the formula, resulting in misadjustment or omission of adjustment, which affects the traceability of process links and closed-loop quality control.

[0010] In industrial scenarios such as painted helmets, characterized by complex textures, rapid production cycles, and mass production, existing color difference detection and closed-loop standard color comparison technologies still cannot achieve a unified balance of high robustness, ease of integration, real-time performance, and physical traceability. The industry urgently needs a novel standard color comparison method that can directly model and decouple the relationship between complex paint texture structures and multispectral responses. This method would enable dynamic adjustment of the theoretical response of the standard color reference under actual texture conditions, relying solely on algorithm-level modeling without physical texturing, increasing hardware complexity, or sacrificing runtime efficiency. It would also possess physical interpretability and process feedback capabilities, effectively improving the anti-interference capability and system deployment breadth of color difference detection. This technological breakthrough is directly related to the accuracy, cost, and automation levels in fields such as intelligent spraying, automatic color matching, and industrial visual quality inspection, representing a key bottleneck in the intelligent manufacturing of complex curved products such as high-end helmets. Summary of the Invention

[0011] This application provides a color compensation method based on online detection of color difference in helmet paint, which aims to solve one of the problems or issues of the prior art mentioned in the background.

[0012] The color compensation method based on online detection of helmet paint color difference provided in this application specifically includes: S1: Acquire multi-band reflection intensity data and near-infrared texture morphology images of the helmet paint surface under narrowband tunable light source excitation, and generate the original detection dataset; S2: Perform convolution feature extraction on the surface geometric features in the original detection dataset to generate texture category labels and texture intensity level parameters; S3: Based on the texture category label, retrieve the preset texture-spectral response fingerprint library to obtain the spectral response offset mode vector that matches the current helmet paint microstructure; S4: Use the spectral response offset mode vector to perform band-by-band weighted modulation processing on the reference spectral response data under an ideal smooth surface to generate a standard spectral response curve; S5: Calculate the band-by-band difference between the spectral response sequence in the original detection dataset and the standard spectral response curve to obtain the initial spectral deviation vector; S6: Construct an adaptive nonlinear weighting coefficient matrix based on the texture intensity level parameters, allocate the contribution of different bands in the initial spectral deviation vector, and generate the processed deviation data for each band. S7: Based on the processed deviation data of each band, perform fusion calculation and output a comprehensive color difference judgment value with physical interpretability; S8: Determine whether the comprehensive color difference judgment value exceeds the preset tolerance threshold. If it does, generate a color adjustment execution command containing compensation amount information to drive the spraying equipment to adjust the pigment ratio.

[0013] The color compensation method based on online detection of helmet paint color difference provided in this application has the following beneficial effects: (1) To address the problem of inaccurate color difference detection caused by the diversity of surface textures in intelligent spraying scenarios for complex curved workpieces such as helmets, this solution abandons the traditional passive image repair approach of "removing textures first and then comparing" and innovatively proposes a modeling-driven detection mechanism based on a "texture-spectral response fingerprint library". By systematically collecting the multispectral reflectance characteristics of typical substrate and paint texture combinations during the production line deployment stage, and integrating microscopic three-dimensional morphology data to establish a physical correlation model between texture geometric features and spectral responses of each band, accurate modeling of the reflectance behavior of different texture types under different illumination bands is achieved. During online detection, the system dynamically retrieves and generates the spectral response mode that the ideal standard color chart should have under the specific texture state based on the real-time identified texture category and intensity level, thereby migrating the standard reference from "ideal smooth surface" to "current real texture conditions", fundamentally overcoming the standard mismatch problem caused by texture scattering and occlusion effects, significantly improving the relevance and accuracy of color difference judgment, especially showing significantly better stability and robustness than traditional methods on strong interference textures such as matte particles and simulated metal brushing.

[0014] (2) This solution adopts a lightweight convolutional network combined with an adaptive weighted fusion strategy, which ensures the efficiency and engineering deployability of the detection process while achieving high-precision texture perception. After the image acquisition module acquires low-resolution multispectral images and near-infrared texture maps simultaneously, texture classification and local intensity estimation can be completed with only one forward inference, avoiding complex iterative optimization, end-to-end deep learning reconstruction or high-cost multi-angle acquisition devices, and greatly reducing the system's demand for computing resources and hardware configuration. The generated ΔE color difference value is based on the nonlinear difference fusion of band-by-band measured and expected response, and the fusion weight is adaptively adjusted by texture intensity - strong texture regions focus on long band (600-750nm) comparison, effectively avoiding the defect of short bands being easily affected by microstructure scattering interference, and further enhancing the physical rationality and process guidance value of the results. The entire processing link takes less than 15ms per frame, which meets the requirements of high-speed production line cycle time, supports real-time operation of edge GPU, has good embeddability and scalability, and is suitable for batch continuous detection of various substrates such as ABS plastic and carbon fiber composite materials.

[0015] The aforementioned technical approaches collectively construct a new generation of color difference detection system that combines physical interpretability, process adaptability, and real-time response capabilities. This system overcomes the bottlenecks of existing technologies, such as reliance on complex image processing algorithms, difficulty in tracing error sources, and weak generalization ability. It not only realizes a paradigm shift from "experience-based parameter tuning" to "model-guided" approaches, but also provides a reliable data foundation and logical support for subsequent process parameter feedback control, quality traceability analysis, and cross-production line standardization. It is particularly suitable for large-scale customized production scenarios with stringent requirements for color consistency and appearance quality, such as school football equipment and personal protective equipment. Attached Figure Description

[0016] Figure 1 This is the main flowchart of a color compensation method based on online detection of color difference in helmet paint.

[0017] Figure 2 This is a sub-flowchart of a color compensation method based on online detection of color difference in helmet paint.

[0018] Figure 3 This is another sub-flowchart of the color compensation method based on online detection of color difference in helmet paint. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0021] like Figure 1 As shown, this application provides a color compensation method based on online detection of helmet paint color difference, specifically including: S1: Acquire multi-band reflection intensity data and near-infrared texture morphology images of the helmet paint surface under narrowband tunable light source excitation, and generate the original detection dataset; S2: Perform convolution feature extraction on the surface geometric features in the original detection dataset to generate texture category labels and texture intensity level parameters; S3: Based on the texture category label, retrieve the preset texture-spectral response fingerprint library to obtain the spectral response offset mode vector that matches the current helmet paint microstructure; S4: Use the spectral response offset mode vector to perform band-by-band weighted modulation processing on the reference spectral response data under an ideal smooth surface to generate a standard spectral response curve; S5: Calculate the band-by-band difference between the spectral response sequence in the original detection dataset and the standard spectral response curve to obtain the initial spectral deviation vector; S6: Construct an adaptive nonlinear weighting coefficient matrix based on the texture intensity level parameters, allocate the contribution of different bands in the initial spectral deviation vector, and generate the processed deviation data for each band. S7: Based on the processed deviation data of each band, perform fusion calculation and output a comprehensive color difference judgment value with physical interpretability; S8: Determine whether the comprehensive color difference judgment value exceeds the preset tolerance threshold. If it does, generate a color adjustment execution command containing compensation amount information to drive the spraying equipment to adjust the pigment ratio.

[0022] Step S1: Acquire multi-band reflectance intensity data and near-infrared texture morphology images of the helmet paint surface under narrowband tunable light source excitation, and generate the original detection dataset. Specifically, this includes: S1.1: Perform wavelength scanning control processing on the narrowband tunable light source array to generate thirty-two discrete narrowband excitation light sequences covering the range of 400 to 750 nanometers, thereby obtaining a time-series excitation light control instruction set with specific wavelength band identification.

[0023] After receiving the narrowband tunable light source array initialization signal from the system scheduling module, the wavelength tuning unit of the light source controller is set to a working mode covering the continuous spectrum from 400 to 750 nanometers, and a wavelength index table is generated according to the 32 pre-divided equally spaced narrowband nodes.

[0024] The wavelength index table is input to the digital / analog hybrid drive module. Based on the target center wavelength and bandwidth tolerance of each node, the corresponding drive current and modulation voltage parameters are calculated. The coefficients are then corrected in conjunction with the spectral response calibration curve of the light source array to ensure that the peak wavelength error of the spectral output of each node does not exceed the allowable threshold.

[0025] After generating the modulation parameter sequence, a timing control channel corresponding one-to-one with the wavelength index is established. A fixed exposure time slot is allocated to each narrowband node through high-precision timing logic, and an anti-overlapping dead time is inserted between adjacent nodes to eliminate spectral crosstalk and afterglow effects during wavelength switching.

[0026] The control data, after parameter mapping and timing allocation processing, is encapsulated into an instruction data packet containing fields such as band ID, center wavelength, bandwidth, modulation degree, and execution time slot. This data packet is then sent to each light source driver unit via a high-speed serial interface, and echo verification is performed in the controller to ensure that the instructions are consistent with the hardware status.

[0027] By using the above-mentioned chain control method, wavelength tuning and timing assignment are bound together into an integrated excitation light control sequence, forming a timing excitation light control instruction set that covers the target spectral range and has precise node parameter calibration, thereby achieving the standardization and repeatability requirements of multi-band light source excitation.

[0028] S1.2: Based on the time-series excitation light control instruction set, synchronous illumination and imaging triggering processing are performed on the helmet paint area to capture the reflected light intensity distribution under each band using a high-sensitivity multispectral camera and obtain surface depth information using a near-infrared structured light projector, thereby obtaining a multi-channel reflection intensity raw frame sequence and a near-infrared point cloud raw data stream containing band labels.

[0029] Based on the timing-based excitation light control command set output from the preceding sub-steps, this command set is synchronously distributed to the narrowband tunable light source array drive control module and the trigger interface of the multispectral imaging system to ensure the consistency of the time base for light source excitation and image acquisition. The narrowband tunable light source array is sequentially driven to the specified wavelength emission state according to the control command set sequence, and the light source activation time window for each band is locked using a high-precision clock signal, forming an excitation pulse signal stream corresponding to the expected wavelength. The external trigger pin of the high-sensitivity multispectral camera is directly connected at the hardware level to the trigger synchronization output of the light source controller. The rising edge trigger mode ensures that the camera completes frame acquisition within the exposure range at the excitation time of each band, thereby guaranteeing that each reflected light intensity distribution data has accurate band label attributes. Phase offset calibration is performed on the scanning trigger signal of the near-infrared structured light projector and the trigger signal of the multispectral camera. This allows for the immediate output of an coded raster map after each band exposure without interfering with visible light band imaging, achieving surface depth map acquisition corresponding to the reflected intensity data of each band. The raw reflectance intensity frame sequences of each band output by the multispectral camera are stored as a multi-channel image cache according to the acquisition order, and the depth measurement point array data output by the near-infrared structured light projector are cached as a point cloud data stream in real time. The two types of data are bound together to form a synchronous data record package through a timestamp association mechanism. Through the above synchronous illumination and imaging triggering process, the temporal excitation light control command of the previous step is transformed into a multi-channel raw reflectance intensity frame sequence and a near-infrared point cloud raw data stream with band label attributes, realizing the spatiotemporal consistency and source traceability of spectral and geometric data acquisition.

[0030] For example, in an automated helmet painting production line, a narrowband tunable light source array is configured with 32 discrete bands. The excitation wavelength is sequentially set by the control command set to a light source output with a step size of 10.9 nm, ranging from 400 nm to 750 nm. The single-band exposure time is 5 ms, and the band interval switching delay is 1 ms. A high-sensitivity multispectral camera is set to an external trigger mode, with a trigger delay controlled within 2 μs, a pixel resolution of 2048 × 1080, and a dynamic range of 12 bits. A near-infrared structured light projector has a center wavelength of 850 nm, a modulation frequency of 50 Hz, and a spatial resolution of 0.1 mm. It outputs striped coded light when offset from the camera trigger signal by 200 μs. Through a timestamp alignment mechanism, the 32 frames of reflected light intensity images output by the camera are sequentially combined into a 32-channel band frame set, and the depth data obtained from structured light analysis is stored in a buffer as an XYZ point cloud structure. For each corresponding band of image frame and point cloud data, a band index and acquisition timestamp are bound to ensure that pixel-level spatiotemporal registration and radiometric correction can be directly performed in the subsequent S1.3 step. Under this parameter configuration, the total acquisition time for the entire band of a single helmet area does not exceed 0.2 seconds, and the output multi-channel reflectance intensity sequence is precisely consistent with the near-infrared point cloud data in terms of spatial coordinate system and acquisition time, providing a reliable data foundation for high-precision color difference analysis under complex texture conditions.

[0031] S1.3: Perform pixel-level spatiotemporal registration and radiometric correction on the original frame sequence of multi-channel reflectance intensity and the original data stream of near-infrared point cloud to eliminate light source fluctuation noise and unify the spatial coordinate system, thereby obtaining a multispectral reflectance intensity matrix after geometric alignment and radiometric normalization and a registered near-infrared texture topography mesh.

[0032] A unified processing entry interface is established for the original frame sequence of multi-channel reflection intensity obtained in step S1.2 and the original data stream of near-infrared point cloud. The frame timestamp and the point cloud acquisition time identifier are indexed and matched to form a time-series paired data unit with a one-to-one correspondence.

[0033] For each pair of time-series paired data units, a feature-point-based spatial registration algorithm is executed to extract checkerboard or dot matrix calibration points of the multispectral imaging plane, calculate the camera intrinsic and extrinsic parameter matrices, and project the corresponding three-dimensional spatial feature points in the near-infrared point cloud onto the multispectral image coordinate system to establish an initial spatial mapping relationship matrix.

[0034] The Iterative Closest Point (ICP) algorithm is used to finely optimize the initial spatial mapping relationship. The geometric features of the point cloud are used to maximize the matching degree with the contour edge of the multispectral image, and the slight pose deviation caused by mechanical vibration or parallax is corrected, so that the multi-channel reflection intensity frame and the near-infrared depth grid achieve pixel-level correspondence accuracy.

[0035] A radiometric correction model based on a whiteboard reference frame is introduced to calculate the instantaneous power fluctuation coefficient of the light source in each narrowband band. And perform band-by-band normalization on the elements of the multispectral reflectance intensity matrix: in The original reflection intensity, The corrected reflection intensity. This represents the instantaneous power fluctuation coefficient of the light source in each narrowband band.

[0036] The light field equalization algorithm is used to smooth the multispectral reflectance intensity matrix after radiometric correction, suppressing the vignetting effect caused by uneven spatial distribution of the light source, and maintaining the relative energy consistency of each pixel across all bands.

[0037] Output the multispectral reflectance intensity matrix after registration and radiation normalization, and the corresponding near-infrared texture topography mesh after registration.

[0038] By using the above pixel-level spatiotemporal registration and radiometric correction processing method, the original multi-channel reflection data and depth topography data from the previous step are unified into the same spatial reference system and the light source fluctuation noise is eliminated, achieving precise alignment of spatial geometric features and full-band spectral features, providing a high-precision, low-noise input foundation for subsequent feature layer data fusion.

[0039] For example, in an automated spraying production line, the multispectral camera resolution is set to 2048×1080 pixels, the frame acquisition frequency is 60Hz, and the near-infrared structured light projector point cloud density is 16 points per square millimeter. Spatial calibration is performed using a nine-point checkerboard calibration board, and the errors of the camera's intrinsic and extrinsic parameter matrices are less than 0.05 pixels. After aligning the multispectral and near-infrared point cloud data according to the acquisition timestamps, the ICP algorithm is iterated 20 times, reducing the root mean square error of the registration from 0.42 mm to 0.08 mm. Using a standard white board with a reflectivity of 0.99 as a reference, the instantaneous power fluctuation coefficient of the light source is measured in each band. Between 0.92 and 1.08, according to the formula After normalizing the reflection intensity of each band, signal noise caused by fluctuations in the light source output is effectively suppressed. After optical field equalization, the brightness uniformity of the entire field of view is improved to near the limit of the sensor's dynamic range. The generated multispectral reflection intensity matrix and the near-infrared texture topography grid are strictly aligned in physical position, ensuring spatial consistency and radiometric accuracy during subsequent spectral and geometric feature fusion.

[0040] S1.4: Based on the multispectral reflectance intensity matrix and the registered near-infrared texture topography mesh, perform feature layer data fusion processing to bind and map the thirty-two-dimensional spectral vector of each spatial pixel to its corresponding local curvature and gradient features, thereby obtaining a pixel-level multidimensional feature descriptor subset with spatial-spectral joint attributes.

[0041] Based on the multispectral reflectance intensity matrix after geometric alignment and radiometric normalization, and the registered near-infrared texture mesh, pixel coordinate indices with spatial consistency are selected as the spatial reference system for fusion calculation. For each spatial pixel coordinate, a 32-dimensional narrowband reflectance intensity vector covering 400 to 750 nm is extracted from the multispectral reflectance intensity matrix to form a subset of spectral responses arranged in wavelength order. Using the curvature calculation module at the corresponding position in the near-infrared texture mesh, the local curvature scalar value is calculated based on the rate of change of the normal of the triangular facet at that position. Simultaneously, the gradient calculation unit is invoked to perform a first-order difference operator operation within a continuous sampling window to obtain the directional gradient feature vector at that pixel position. The curvature scalar value and the directional gradient feature vector are combined into a surface geometry descriptor according to a preset geometric feature encoding format, and a feature-level concatenation operation is performed with the aforementioned 32-dimensional spectral response subset to generate a multidimensional joint feature entry that simultaneously contains spectral and surface microstructure information. The extraction, calculation, and stitching process is repeated for all pixel locations to form a pixel-level multidimensional feature descriptor subset covering the detection area, while maintaining its index association with the original spatial coordinates to support subsequent texture category recognition and spectral response shift pattern retrieval. Through a pixel-by-pixel feature binding mapping process, the spectral and geometric information from the previous step is transformed into a discrete, indexable feature matrix with joint spatial-spectral properties, achieving an integrated expression of texture and color information and providing an accurate input basis for suppressing complex texture interference.

[0042] S1.5: The pixel-level multidimensional feature descriptor subset is structured and metadata is annotated to integrate the spectral response sequence and surface geometric feature field according to a preset data format, thereby finally forming an original detection dataset containing a complete spectral response sequence and surface geometric features.

[0043] Step S2: Perform convolutional feature extraction on the surface geometric features in the original detection dataset to generate texture category labels and texture intensity level parameters. Specifically, this includes: S2.1: Perform multi-scale gray-level normalization preprocessing on the near-infrared texture image to eliminate ambient light fluctuation interference and generate a normalized texture matrix with a uniform dynamic range.

[0044] The registered near-infrared texture topography mesh is used as the input data carrier. The depth grayscale value of each pixel is extracted and converted into the form of an initial grayscale matrix to ensure that the spatial position and geometric structure remain consistent in subsequent processing.

[0045] A local maximum and minimum value normalization algorithm is introduced into the initial grayscale matrix. For each local window region, the minimum and maximum grayscale values ​​are calculated, and a linear stretching transformation is performed based on the interval difference. This improves the contrast of texture details in the local area and reduces the overall offset caused by changes in ambient lighting.

[0046] Multi-scale pyramid decomposition is performed on the normalized matrix to construct a scale sequence from the original resolution image and its scaled multi-layer images. The gray-level histogram statistical features are calculated at each scale layer to form a multi-scale gray-level distribution set that reflects the distribution of different spatial frequency components.

[0047] A combination of high-pass enhancement filtering and low-pass smoothing filtering is used to perform high-frequency and low-frequency separation processing on images of various scales in a multi-scale gray-level distribution set. High-frequency components are used to enhance and filter out large areas of slowly varying illumination, while low-frequency components are used to smooth and suppress independent random noise points, so as to suppress unstructured light source interference while preserving the real texture and morphology structure.

[0048] The grayscale matrix after the above multi-scale and filtering processing is subjected to global histogram equalization, and a target dynamic range mapping function is constructed to map the input grayscale level to a unified output grayscale range [0,1], so as to ensure that the data collected in different batches are comparable and uniform in numerical scale.

[0049] By using the above multi-scale gray-level standardization processing method, the registered near-infrared texture morphology data from the previous step is transformed into a normalized texture matrix with a uniform dynamic range and significantly reduced sensitivity to illumination changes, thus providing a robust and generalizable input foundation for subsequent convolutional neural network feature extraction.

[0050] S2.2: Perform forward propagation calculations of a multi-level dilated convolutional neural network based on the normalized texture matrix to extract a high-dimensional spatial feature tensor representing the density and directional gradient of micro-pits on the paint surface.

[0051] Using the obtained normalized texture matrix as input, a predefined topological structure of a multi-level dilated convolutional neural network model weight parameters is loaded into the hardware inference unit to establish a feature mapping path adapted to the near-infrared texture data of the painted surface. According to the dilation rate parameters and kernel size set in the first layer of the network, a two-dimensional dilated convolution operation with boundary mirror padding is performed on the normalized texture matrix to achieve initial expansion of the receptive field of local microstructure patterns while preserving spatial location information. The output feature map of the first layer is processed by batch normalization and nonlinear activation functions before being fed into the stacked dilated convolution modules of the second to fourth layers. Layer by layer, an increasing dilation rate and different scale convolution kernels are combined to form a multi-scale response encoding for changes in micro-dimple density and directional gradient. For each level of convolution output, a cross-layer skip connection structure is introduced to introduce low-frequency global structural information while preserving high-frequency detail components, enhancing the geometric consistency of the features. At the end of the network, the feature tensor obtained after multi-scale dilated convolution is adaptively adjusted for channel weights through a channel attention mechanism to highlight feature channels highly correlated with local curvature changes and microstructure directionality. Through the above multi-level dilated convolution forward propagation calculation, the normalized texture matrix is ​​converted into a high-dimensional spatial feature tensor that can simultaneously reflect the density distribution of micro-pits on the paint surface and the trend of directional gradient changes, thereby realizing the transformation of surface geometric features into intermediate feature representations that are adapted to subsequent texture semantic classification heads.

[0052] For example, for near-infrared topographic data of an ABS helmet with a normalized texture matrix size of 256×256 pixels, the dilated convolutional neural network is configured as follows: the first layer has a kernel size of 3×3, a dilation rate of 1, and 32 output channels; the second layer has a kernel size of 3×3, a dilation rate of 2, and 64 output channels; the third layer has a kernel size of 3×3, a dilation rate of 4, and 128 output channels; and the fourth layer has a kernel size of 3×3, a dilation rate of 8, and 256 output channels. Batch normalization and nonlinear activation using the LeakyReLU function are applied after each convolutional layer. Skip connections are established between the first and second layers and between the third and fourth layers to fuse feature information at different scales. The channel attention module uses global average pooling and a two-layer fully connected network to assign weights to the 256-dimensional channel features. The final output high-dimensional spatial feature tensor has a dimension of 256×64×64 (channels × height × width). The channel dimension carries the information of micro-dimple density pattern and directional gradient pattern extracted under different void ratios. After subsequent global average pooling and soft maximum probability mapping processing in S2.3, this high-dimensional tensor can be effectively mapped to a discrete texture category label space. In the experimental verification, it achieved a significant improvement in microstructure recognition under three texture conditions: matte particles, specular flow lines, and simulated metal brushing, while maintaining real-time performance with an inference latency of less than 12ms.

[0053] S2.3: Use a pre-trained texture semantic classification head to perform global average pooling and soft maximum probability mapping on the high-dimensional spatial feature tensor to output discrete texture category labels that represent the distribution state of local microstructures.

[0054] The high-dimensional spatial feature tensor output by the S2.2 sub-step is input into the texture semantic classification head model that has been trained offline. The spatial distribution features of the tensor channel direction are used as the main feature source to construct the classification processing input matrix.

[0055] Global average pooling is performed on the input matrix to compress the two-dimensional spatial distribution of each feature channel into a single scalar response value by averaging the horizontal and vertical dimensions, thereby maintaining the semantic integrity of the channels while reducing the dimensionality of redundant spatial information.

[0056] The scalar sequence of channel responses after global average pooling is input into the Softmax probability mapping function. By performing exponential normalization on the score value of each category, a probability distribution vector is generated on all predefined texture category label sets.

[0057] Based on this probability distribution vector, the category index corresponding to the highest probability value is selected as the predicted output category code, and the preset category mapping table is called to convert the category code into a readable discrete texture category label, thereby realizing the conversion of spatial geometric features into texture semantic labels.

[0058] By using global average pooling and soft maximum probability mapping, the high-dimensional spatial feature tensor of the previous step is transformed into a quantitative discrete texture category label, thus achieving the expected technical effect of abstracting the distribution state of complex surface microstructures into standardized category identifiers that can be directly used for fingerprint database retrieval.

[0059] S2.4: Construct a nonlinear regression evaluator based on the feature channel activation values ​​corresponding to the discrete texture category labels to quantize and fit the texture roughness components in the high-dimensional spatial feature tensor, thereby generating continuous numerical texture intensity level parameters.

[0060] Channel index mapping is performed on the activation values ​​of each channel feature in the high-dimensional spatial feature tensor to establish a one-to-one mapping relationship between the discrete texture category labels obtained in step S2.3 and the corresponding channels to extract the channel vectors activated by the target category. Feature normalization is performed on the channel vectors by subtracting the mean from each channel activation value and dividing by the standard deviation to obtain a centered activation feature set with uniform variance, thereby eliminating regression bias caused by differences in absolute amplitude between different samples. The input matrix of the nonlinear regression estimator is constructed based on the normalized activation feature set, and the radial basis kernel function is selected as the nonlinear mapping operator to enhance the fitting ability to high-order texture roughness changes. The hyperparameter set of the regression estimator is determined using the cross-validation method, including the regularization factor and kernel width parameter, and the measured calibration values ​​of texture roughness in the training sample set are used as the regression output target to minimize the mean square error between the predicted value and the measured value, and optimize the coefficient matrix W. The nonlinear regression process is implemented in the following form: in For the predicted texture intensity level parameters, To normalize the activation feature matrix, This is the weight matrix. For bias vectors, This is the mapping function corresponding to the radial basis kernel. A linear scaling transformation is performed on the output prediction result to map it to a preset physical meaning range to conform to the defined range of the texture intensity level parameter. Through this chain-like nonlinear regression processing method, the discrete texture category information from the previous step is transformed into a numerical level parameter that can continuously characterize local roughness, achieving high-precision quantitative representation of texture intensity in physical space.

[0061] For example, in the processing scenario for matte granular texture samples of ABS substrates, the pre-constructed training set contains 500 texture topography images with measured roughness Ra values, corresponding to Ra values ​​distributed from 0.8 to 4.5 micrometers. The texture category label output by S2.3 is "Matte," and the associated channel activation vector length is 64. In this embodiment, the 64-dimensional activation vector is normalized to obtain normalized features with a mean of 0 and a standard deviation of 1. A support vector regressor with a radial basis function kernel is constructed, with a regularization factor set to 10 and a kernel width γ set to 0.05. The optimal parameter combination is obtained through 5-fold cross-validation. The normalized features are used as the input matrix X, and the measured roughness Ra is used as the regression target, using the formula... The predicted value was calculated, where the radial basis function f applied an exponential decay to the Euclidean distance between X and the support vectors. The output calculated by the regression model was 2.35 micrometers, which, after linear scaling and mapping to the texture intensity level range [0,10], corresponded to level 5.2. The final continuous parameters successfully preserved the trend of granular detail changes and demonstrated a significant ability to distinguish the intensity of long-wavelength scattering influence in the subsequent spectral migration modeling process.

[0062] S2.5: The discrete texture category label and the continuous numerical texture intensity level parameter are structurally encapsulated to form a standard texture feature vector containing a complete description of surface geometry for subsequent steps.

[0063] like Figure 2 As shown, step S3 involves retrieving a pre-set texture-spectral response fingerprint database based on the texture category label to obtain a spectral response offset mode vector that matches the current helmet paint microstructure. Specifically, this includes: S3.1: Perform hash index encoding on the texture category label to generate a texture feature retrieval key value with a unique identifier attribute, which serves as the input address pointer for accessing the texture-spectral response fingerprint database.

[0064] It should be noted that the texture-spectral response fingerprint database refers to a pre-installed data structure in the system. This database uses discrete texture category labels as indexes and stores the reference reflectance attenuation coefficients and band scattering enhancement factors for different paint surface microstructures (such as matte particles, high-gloss flow lines, and simulated brushed metal) at various narrowband wavelengths. This fingerprint database is constructed by collecting typical texture-spectral paired samples during the offline calibration phase, and is used to quickly retrieve the corresponding spectral response shift mode vector based on the real-time identified texture category during online detection.

[0065] Using the discrete texture category labels generated in the preceding steps as input data, these labels are digitized as unique semantic identifiers to meet the requirements of high-speed indexing. The discrete texture category labels are input to the character encoding module, where they are mapped one-to-one according to a predefined texture category encoding table to obtain distinguishable integer category code values. A hash mapping algorithm is then used to hash these integer category code values. The algorithm selects a multiplicative hash function with a low collision probability, multiplying it by a prime number larger than the sampling range and performing a bitwise cyclic shift operation to generate a primary hash value set. For this primary hash value set, a modulo operation is performed to compress it into the address space of the texture-spectral response fingerprint database, ensuring that the output code values ​​meet the boundary conditions of the database index range. Collision resolution strategies (including open-address linear probing and double hashing) are used to iteratively recalculate when address collisions are detected to guarantee the uniqueness of the final index code value. This unique index code value is cached as a texture feature retrieval key in a high-speed register, forming a standardized data object that can be directly used as a pointer to the physical address of the texture-spectral response fingerprint database. By using the hash index encoding method described above, the texture category label results from the previous step are transformed into index keys with a compact structure and extremely high access speed, thereby improving the real-time and accurate retrieval capability of the fingerprint database.

[0066] For example, in an intelligent spray coating production line, the system acquires a texture category label of "matte grainy texture," with an integer code value of 42 in the category coding table. After processing with a hash mapping algorithm, the code value 42 is first multiplied by the prime factor 109 and shifted left by 5 bits to obtain a primary hash value of 14624. A modulo operation is then performed on 14624 with the fingerprint database capacity of 8192 to obtain a compressed index code value of 624. If the index position is found to be free, it is directly output as the unique retrieval key. In another case, when the texture category label is "simulated brushed metal," the integer code value 78 is processed in the same way to obtain a primary hash value of 25488. A modulo operation of 8192 yields an index code value of 2000. However, if the position is found to be occupied, a double hash re-probing is performed. An offset of 37, generated by XORing the original hash value with the code value, is added to the original hash value. A new modulo operation is then performed to obtain a new index code value of 2037. After confirming that the position is free, it is stored in the cache. In both cases, the generated key values ​​can be mapped to the physical address of the fingerprint database within 1 microsecond, significantly reducing the average conflict rate. This ensures that the process of obtaining the texture category to the spectral response offset mode will not become a bottleneck under the production condition of a spraying cycle of 2 seconds per piece, achieving the high robustness and low latency requirements of the spectral fingerprint retrieval stage.

[0067] S3.2: Based on the texture feature retrieval key value, perform a multi-dimensional neighborhood matching query in the texture-spectral response fingerprint database to extract the original spectral response offset dataset containing the reference reflectance attenuation coefficient and the band scattering enhancement factor.

[0068] Based on the texture feature retrieval key value output from step S3.1, a multi-dimensional index mapping relationship is established and locked onto the texture-spectral response fingerprint database storage structure to ensure accurate positioning of subsequent retrieval operations in the high-dimensional spectral feature space. The retrieval key value is input to a neighborhood query module that supports multi-vector similarity measurement. This module calculates the multi-dimensional distance vector between the retrieval key value and each texture fingerprint entry in the database based on a pre-defined spectral offset multi-channel similarity function. The similarity function simultaneously considers the normalized difference between the reference reflectance attenuation coefficient dimension and the band scattering enhancement factor dimension. In the similarity calculation, a weight modulation mechanism is introduced to amplify the differences in long-band features to improve the sensitivity of long-band texture matching; this weight modulation is defined based on the following expression: in, For the number of narrowband bands, and These represent the spectral descriptors of the retrieval key and the spectral descriptor of the database entry, respectively, at the [number]th [time]. Differences in normalized eigenvalues ​​across different bands wavelength The corresponding weight function values ​​are then used. Based on the calculated multidimensional distance vector, a K-nearest neighbor sorting operation is performed across the entire database, retaining only the K fingerprint samples with the smallest distances as the candidate set. The candidate set is then further validated based on spectral cosine similarity to eliminate pseudo-matches that are Euclidean distance matches but have significant differences in spectral morphology, ensuring that the output original spectral response shift dataset possesses high fidelity and texture consistency. Through the above multidimensional neighborhood matching and multi-criteria validation process, the texture feature retrieval key values ​​from the previous step are transformed into an original spectral response shift dataset containing the baseline reflectance attenuation coefficient and band scattering enhancement factor fields, achieving accurate spectral interference pattern extraction for complex paint surface microstructures.

[0069] For example, in production line testing, when the input texture feature retrieval key value corresponds to a type of "high-gloss flow texture" paint surface microstructure, this key value is mapped to a multidimensional index of the texture-spectral response fingerprint database. The database stores historical statistical data on reflectance attenuation and scattering enhancement of this type of texture across 32 wavelength bands. Let K=5, and the wavelength weighting function in the similarity calculation... The values ​​in the 600-750nm range were increased by a factor of 1.5. Substituting these values ​​into the aforementioned distance calculation formula, and after verification using Euclidean normalized difference and cosine similarity, five sets of spectral pattern samples with the highest matching degree were finally selected. Taking the third matching sample as an example, its reflectance attenuation coefficient at λ=450nm is 0.92, and its band scattering enhancement factor at λ=700nm is 1.12. The 32-dimensional offset feature vector of this sample was aggregated with the data of other matching samples at the corresponding wavelengths using mean aggregation. The resulting original spectral response offset dataset was used for local weighted regression fitting in the subsequent S3.3 step, ensuring the accuracy of the dynamic theoretical standard spectral curve generation and demonstrating significantly improved matching stability and anti-texture interference ability in dynamic spraying color difference comparison.

[0070] S3.3: Use the local weighted regression algorithm to smooth the discrete sampling points in the original spectral response offset dataset and construct the texture-induced spectral distortion function curve.

[0071] Based on the original spectral response offset dataset output from step S3.2, which includes the reference reflectivity attenuation coefficient and band scattering enhancement factor, this sub-step uses this dataset as the input sample matrix for a local weighted regression algorithm, pairing it with the wavelength node vector. A local neighborhood window model is established for multiple discrete sampling offset points of each wavelength node, and the influence factor of each sampling point on the regression center is calculated according to a preset spectral distance weight function, forming a weight distribution matrix to achieve trend extraction within the local region. A weighted least squares fitting operation is performed on the offset value corresponding to each wavelength node and the offset values ​​of other nodes in its neighborhood to construct a local linear approximation model. The local fitting coefficient is calculated through matrix inversion and residual minimization. A Gaussian kernel weight function is used to achieve a continuous mapping between distance and weight; its calculation formula is as follows: in The physical interval between the neighborhood sampling wavelength and the regression center wavelength. The bandwidth smoothing parameter is used. Local residuals are iteratively adjusted based on the weight distribution matrix to reduce noise interference and ensure the smoothness and continuous differentiability of the fitted curve. This local weighted regression process is executed cyclically across the entire band, sequentially merging the fitted values ​​of each wavelength node and eliminating abrupt changes in tangential slope at band boundaries through boundary condition constraints. Through the above smoothing fitting process, the discrete original spectral response offset sampling is transformed into a continuous and differentiable texture-induced spectral distortion function curve across the entire band, achieving stable modeling of texture interference modes and accurate support for subsequent band-specific quantization.

[0072] For example, in the spectral response shift modeling of ABS plastic high-gloss flow textured paint, the original sampling dataset contains 32 band nodes in the range of 400nm to 750nm, with 5 repeated sampling values ​​collected for each node. The bandwidth smoothing parameter for local weighted regression is set to 15nm, the neighborhood window covers ±3 band nodes, and the weights are calculated using the aforementioned Gaussian kernel function. For instance, at the center wavelength λc = 500nm, if the sampling point at λ = 470nm in the neighborhood has a d of 30nm, then the corresponding weight is calculated as follows: Substituting the bandwidth smoothing parameter, the weights show a significant attenuation. Weighted least squares are performed using the weight distribution matrix to fit a smoothed offset value set at each node, which is then stitched together across the entire band to form a continuous curve. Validation results show that this method significantly reduces the noise offset amplitude in the strong texture interference band (shortwave 400–500 nm range), and the curve shows no obvious slope abrupt changes at band junctions. The spectral offset mode vector subsequently generated based on this curve effectively improves the alignment accuracy and stability in the dynamic standard color generation step.

[0073] S3.4: Perform band-by-band differential operation based on the texture-induced spectral distortion function curve to quantify the relative intensity deviation amplitude under each narrowband wavelength and generate an initial spectral offset vector sequence.

[0074] Using the continuous and differentiable texture-induced spectral distortion function curve output from step S3.3 as the input data object, this function curve is called for each corresponding narrowband wavelength index node, and the amplitude change rate between adjacent band reflection intensity response values ​​is calculated to extract the local perturbation characteristics of the spectral response under the influence of texture microstructure. For the wavelength sequence { Independent computational units are constructed in order of physical wavelength. For each unit, the spectral difference value with the previous band is calculated using a numerical difference operator. The specific difference calculation formula is as follows: in, This is the spectral distortion function fitted by the previous steps. Indicates at wavelength The relative intensity deviation amplitude is calculated, and the wavelength difference in the denominator is converted to a physical dimension to unify the unit system. The results of the above difference operation are absolute-valued to eliminate sign directionality, resulting in an intermediate state vector column that only reflects the intensity shift amplitude. Outlier suppression filtering is performed on the intermediate state vector column, using the three-times median absolute deviation rule to remove outlier difference values ​​caused by a few noise bands. The filtered difference amplitude sequence is reordered according to the original wavelength order and written into a fixed-length numerical buffer to ensure the consistency of data indexes for each band during subsequent encapsulation operations. Through band-by-band difference and amplitude-based processing, the continuous spectral distortion function of the previous step is transformed into a discretized initial spectral shift vector sequence, realizing the accurate quantization of the spectral change pattern caused by texture into a set of physical parameters that can directly participate in subsequent normalized encapsulation and weighted modulation operations.

[0075] For example, when performing this step on a helmet part with a high-gloss flow texture on its surface, the narrowband wavelength sequence used is 400nm to 750nm, with a wavelength interval of 10.97nm. The corresponding texture-induced spectral distortion function f(λ) is 0.842 at λ=500nm and 0.857 at λ=489.03nm. Substituting these values ​​into the above difference formula, the calculated result is -0.00136nm. -1 Taking the absolute value yields 0.00136nm. -1 The offset amplitude. The same operation was performed on all 32 wavelength nodes to obtain a 32-dimensional initial spectral offset vector sequence. After outlier removal and reordering, the values ​​of each component in the sequence remained within a reasonable range. Moreover, the offset amplitude in the long-wavelength region (600nm to 750nm) under the high-gloss flow pattern was significantly higher than that in the medium and short-wavelength regions. This physical property can be used in the subsequent weighted processing to enhance the contribution of the long-wavelength band to color difference determination, thereby achieving highly robust color difference comparison under complex texture conditions.

[0076] S3.5: Perform normalized vector encapsulation processing based on the initial spectral offset vector sequence, and output the spectral response offset mode vector.

[0077] like Figure 3 As shown, step S4 involves using the spectral response offset mode vector to perform band-by-band weighted modulation processing on the reference spectral response data under an ideal smooth surface to generate a standard spectral response curve. Specifically, this includes: S4.1: The preset ideal smooth surface reference spectral response database is indexed and read to extract the original reflectance scalar sequence of the corresponding target standard color number at each narrowband wavelength node, thereby obtaining a pure reference spectral response vector that is not affected by texture interference as the initial modulation object.

[0078] It should be noted that the spectral response offset mode vector is a numerical vector with the same dimension as the number of bands of the narrowband tunable light source. Each component represents the magnitude and direction of the deviation of the spectral response from the ideal smooth surface due to the presence of microstructures in the paint surface at a specific wavelength. It contains two types of physical information: reflectivity attenuation and scattering enhancement. After being processed by normalized vector encapsulation, it serves as a direct control variable for modulating the reference spectral response data.

[0079] For the input object being a pre-defined ideal smooth surface reference spectral response database, the retrieval index key is the target standard color number identifier, and the data organization is a reflectance scalar array arranged in order of narrowband wavelength nodes.

[0080] Based on the target standard color identifier, a hash mapping location operation is performed in the database index tree to obtain the corresponding storage address offset and lock the physical storage page frame of the target data record.

[0081] The locked physical storage page frames are read sequentially to extract the original scalar values ​​of reflectance for 32 discrete wavelength nodes that match the narrowband tunable light source band within the 400nm to 750nm range, and generate the original spectral response sequence arranged in ascending order of wavelength.

[0082] By using metadata tags embedded in the database to parse the physical meaning and measurement conditions of each wavelength node, data points marked with measurement deviations are removed to ensure that the output vector contains only valid reflectivity values ​​that have been traced and verified.

[0083] The effective reflectivity scalar values ​​are encapsulated into a one-dimensional column vector structure in order of physical wavelength, and defined as a pure reference spectral response vector. This vector serves as the initial input for subsequent texture offset mode modulation, ensuring that it is unaffected by texture interference both numerically and physically.

[0084] Through the above index reading and filtering process, the standard color number retrieval results of the previous step are transformed into reference spectral response initial data that meets the requirements of narrowband band alignment, thereby achieving the technical effect of providing a zero-interference physical reference baseline for adaptive modulation of texture environment.

[0085] For example, in a helmet coating inspection production line, a pre-set ideal smooth surface reference spectral response database contains 500 standard color codes. Each color code records the reference reflectance value at 32 wavelength nodes, from 400nm, 410nm to 750nm, with an interval of 10nm. The input target standard color code identifier is "STD-213", and its database address offset is physical block number 12045. During the index reading process, the system locates and reads the corresponding 32 data points within 0.8ms, discards 2 data points marked due to historical acquisition errors, and the remaining 30 are verified to be valid. The discarded nodes are reconstructed using the neighboring node spline interpolation method to obtain a complete 32-dimensional column vector. For example, the reflectance at the 400nm node is... The reflectance at the 700nm node is 0.62, and all values ​​are arranged in ascending order and encapsulated into a pure reference spectral response vector. This vector is numerically free of texture interference components and corresponds one-to-one with the spectral response offset mode vector output in the previous step. It provides a high-confidence initial modulation object for the subsequent construction of the texture-induced spectral distortion correction coefficient matrix in S4.2. Practical application verification shows that under online detection conditions, it can ensure stable convergence of texture correction calculation and significantly improve the target spectral matching degree.

[0086] S4.2: Based on the band scattering enhancement factor and reference reflectivity attenuation coefficient in the spectral response offset mode vector output by the previous step, construct a band-by-band linear mapping function model to quantify the modulation gain and loss ratio of the texture microstructure to each specific wavelength optical signal, thereby generating a texture-induced spectral distortion correction coefficient matrix containing thirty-two dimensions of data.

[0087] Based on the 32 narrowband scattering enhancement factors and reference reflectance attenuation coefficients already included in the spectral response shift mode vector output from the previous steps, a wavelength-dependent linear mapping relationship is constructed for the band-by-band reflectance scalar values ​​in the current ideal smooth surface reference spectral response vector. The scattering enhancement factor and the corresponding attenuation coefficient for each band are numerically calibrated before multiplication to eliminate dimensional differences from different data sources. The calibrated scattering enhancement factor is used as the positive modulation coefficient for the optical signal intensity of that band, and the attenuation coefficient is used as the negative modulation coefficient. The combined modulation ratio is calculated for each of the 32 bands using a mapping function. The formula for calculating this ratio is as follows: in, wavelength The overall modulation ratio at the location, As a scattering enhancement factor, The reflectivity attenuation coefficient is calculated as follows: The modulation ratio values ​​obtained by calculating each band are sequentially filled into a 32-dimensional vector in wavelength order, and the amplitude of each element is normalized to ensure that it conforms to the physical ratio limit in the [0,1] interval. The normalized 32-dimensional vector is then used as coefficients to fill the corresponding 32-dimensional main diagonal matrix generator to construct the texture-induced spectral distortion correction coefficient matrix, providing linear mapping parameters for the dot product operation in the next sub-step. Through this chain-like construction method, the physical meaning of the spectral response shift mode is converted into a numerical matrix that can directly participate in spectral reconstruction, achieving the technical effect of quantifying the modulation characteristics of texture microstructures into band-by-band correction factors.

[0088] For example, in the detection scenario of helmet paint surface with ABS substrate and high-gloss flow texture, the scattering enhancement factor in the 600nm band of the spectral response shift mode vector is 0.12, and the reflectivity attenuation coefficient is 0.08. After consistency calibration, substituting these values ​​into the above formula yields a result of 1.0304. This result is used as the modulation ratio for this band, and the remaining 31 bands are calculated sequentially to obtain a modulation vector containing 32 ratio values. This vector is linearly normalized to a range where the maximum value is 1.0 and the minimum value is greater than 0.9, and then sequentially filled into a 32×32 main diagonal matrix to form a texture-induced spectral distortion correction coefficient matrix. In subsequent Hadamard product operations with the pure reference spectral response vector, this matrix can effectively amplify or suppress the light signal by band, achieving the target effect of slight enhancement in long bands and slight attenuation in short bands, thereby significantly improving the accuracy and stability of texture adaptation in color difference comparison.

[0089] S4.3: The Hadamard product is performed on the pure reference spectral response vector using the texture-induced spectral distortion correction coefficient matrix to achieve adaptive spectral morphology reconstruction of the standard color theoretical value under the current paint surface microstructure environment, thereby outputting a dynamic theoretical standard spectral response sequence aligned with texture features.

[0090] Based on the texture-induced spectral distortion correction coefficient matrix and the pure reference spectral response vector output from step S4.2, matrix operations are performed to complete the morphological reconstruction of the standard color theoretical spectrum. Elements of each dimension of the pure reference spectral response vector are paired and bound to the diagonal elements of the texture-induced spectral distortion correction coefficient matrix in a one-to-one correspondence, establishing a band index mapping table for sequential consistency constraints during subsequent dot product calculations. Using Hadamard product dot product operations, scalar multiplication is performed at each narrowband wavelength node, allowing the gain or attenuation coefficient corresponding to the texture microstructure to be directly applied to the reference reflectance value of that band, achieving texture-adaptive adjustment of the spectral amplitude. To address potential rounding errors in floating-point calculations, double-precision multiplication logic is implemented, and rounding mode consistency checks are performed in each operation cycle to avoid cumulative deviations caused by quantization errors during high-precision color difference determination. After completing element-wise multiplication across all bands, the result set is assembled into a new vector according to the original wavelength index order, forming a dynamic theoretical standard spectral response sequence containing the corrected reflectance values ​​of all thirty-two bands. By using a band-wise modulation method based on the Hadamard product, the correction coefficient matrix from the previous step is effectively applied to the reference spectral data, thus achieving the goal of mapping the standard color theoretical value of an ideal smooth surface to the adaptive spectral morphology of the current microstructure state of the paint surface.

[0091] For example, under the operating conditions of a dynamic spraying production line, the pure reference spectral response vector is 32-dimensional, with units of percentage reflectance (%R) and a value range of 0 to 100; the texture-induced spectral distortion correction coefficient matrix is ​​a 32×32 real diagonal matrix, with non-zero elements distributed on the diagonal, representing the modulation gain (1) or attenuation coefficient (<1) of each narrowband band. For example, in the 600nm band, the reference reflectance value is 72.5, the correction coefficient is 1.08, and after dot product operation, the theoretical standard reflectance value of 78.3 under the current texture state is obtained. The mathematical expression for performing the Hadamard product dot product is defined as: in This is a 32-dimensional column vector of pure reference spectral response. It is a 32×32 diagonal correction coefficient matrix. This represents the Hadamard product operation. This represents the output dynamic theoretical standard spectral response column vector. During implementation, for the short-wavelength channels (400–500 nm), due to significant texture scattering interference, the correction coefficient is lower than 0.95 to attenuate the amplitude; for the long-wavelength channels (600–750 nm), an enhancement coefficient higher than 1.05 is configured to avoid scattering effects. After modulation of all bands, the output dynamic theoretical standard spectral response sequence, under the condition of a curved matte finish, shows a highly consistent curve shape with the measured spectrum. The attenuation and enhancement trends of reflectance in the low-frequency and high-frequency bands match the texture optical characteristics, effectively improving the reliability and accuracy of subsequent color difference comparison.

[0092] S4.4: Perform spline interpolation smoothing filtering on the dynamic theoretical standard spectral response sequence to eliminate high-frequency noise jitter caused by discrete sampling point matching errors and ensure the continuous differentiability of the spectral curve, thereby generating a smoothed standard spectral response curve with physical coherence.

[0093] Based on the dynamic theoretical standard spectral response sequence of the preceding output, spectral amplitude data containing thirty-two discrete wavelength sampling points are used as the input for smoothing filtering. In this sequence, high-frequency jitter signals are introduced due to slight inconsistencies in the sampling and matching process between different bands. First, a node index vector ordered by physical wavelength is constructed for this discrete sequence. Then, based on the spacing relationship of these nodes, the segmented interval parameters of spline interpolation are defined to ensure that the interpolation nodes strictly correspond to the actual excitation wavelength. For each adjacent node interval, the cubic spline interpolation basis function is called to generate fitting curve coefficients. The global smoothing function definition is obtained by solving the coefficient matrix containing continuity constraints and first and second derivative continuity equations. The global smoothing function is used to calculate the reconstructed values ​​at each original sampling wavelength, and the high-frequency components of the curve are eliminated using the filter kernel function. The energy contribution of non-physical components is limited by the frequency domain cutoff condition. The derivative calculation of the filtered output curve is performed to verify that its first derivative has no discontinuous jumps across the entire band, ensuring the differentiability of the curve, thus completing the conversion of the spectral curve from discrete data to a physically continuous curve. By combining spline interpolation and smoothing filtering, the dynamic theoretical standard spectral response sequence from the previous step is transformed into a smoothed standard spectral response curve with continuous differentiability and physical coherence, thereby stabilizing the standard color reference curve and suppressing noise under the condition of texture state adaptation.

[0094] For example, in the helmet paint standard color adaptation process, the input dynamic theoretical standard spectral response sequence covers the range of 400 to 750 nanometers, with a wavelength node spacing of 10.97 nanometers and a total of 32 sampling points. The amplitude unit of each point is the percentage of reflectance. A node index vector [n1, n] is constructed. 32Corresponding to the actual wavelength position, the endpoint conditions of the cubic spline are set as natural boundary conditions, that is, the second derivatives at both ends of the curve are zero, forming a 32×32 coefficient matrix for solution.

[0095] The reconstructed reflectance is calculated at the original wavelength node using this smoothing function, and then filtered using a low-pass window function with a cutoff frequency of 0.45 times the Nyquist frequency to reduce high-frequency jitter. The first derivative of the filtered spectral curve is calculated in each band to verify that the derivative changes continuously across the entire band without peak anomalies. A smoothed standard spectral response curve is output. This curve effectively reduces the fluctuation of ΔE value caused by sampling noise in the subsequent color difference comparison step, achieving significant stabilization of the color difference calculation results and consistency of the physical response.

[0096] S4.5: Based on the smoothed standard spectral response curve, perform structured data encapsulation processing to bind the current texture category label and timestamp metadata and form a standardized theoretical reference data package, thereby finally outputting a standard spectral response curve adapted to the current texture state that can be directly called by the subsequent color difference comparison module.

[0097] Step S5: Calculate the band-by-band difference between the spectral response sequence in the original detection dataset and the standard spectral response curve to obtain the initial spectral deviation vector. Specifically, this includes: S5.1: Perform band index alignment processing on the spectral response sequence in the original detection dataset and the standard spectral response curve to establish a one-to-one mapping relationship between each wavelength node under narrowband tunable light source excitation, and generate a benchmark comparison spectral dataset.

[0098] For the standard spectral response curve output from step S4.5 and the spectral response sequence in the original detection dataset encapsulated in S1.5, the system's band label index information is called to determine the index range and index order of the two on the 32 discrete wavelength nodes of the narrowband tunable light source.

[0099] Based on the two sets of extracted band labels, a mapping lookup table is constructed to uniquely map the reflection intensity value of each wavelength node in the original detection dataset to the theoretical reflectivity position of the corresponding wavelength node in the standard spectral response curve, thereby achieving a one-to-one band registration relationship.

[0100] Under the constraints of the mapping lookup table, the wavelength nodes are rearranged to ensure that the measured data and theoretical data are strictly consistent in the order of physical wavelengths from shortwave to longwave, eliminating the differences in band arrangement caused by acquisition trigger timing or storage structure.

[0101] Missing value detection and interpolation filling are performed on the registered band pairs. In scenarios where some bands are missing, a wavelength neighborhood smoothing estimation method based on cubic spline interpolation is used to restore the reflection intensity of missing nodes, ensuring the dimensionality of the comparison data.

[0102] The measured spectral response vectors and theoretical standard spectral response vectors, which have undergone wavelength registration, order rearrangement, and missing data repair, are stored in a unified data structure according to their band indices. This generates a benchmark comparison spectral dataset with consistent length and fully aligned wavelength nodes, ensuring data consistency and direct callability of operators for subsequent difference calculations.

[0103] By using band index alignment processing, the original spectral sequence and theoretical curve from the previous step are transformed into benchmark comparison spectral data with one-to-one correspondence between physical wavelength nodes, thus achieving unambiguous input conditions for difference calculation.

[0104] For example, in a multispectral detection platform equipped with a narrowband tunable LED array in the 400–750 nm range, the band labels recorded in the original detection dataset are [405, 420, 435, 745] nm, and the band labels stored in the standard spectral response curve are [400, 415, 430, 750] nm. During processing, a mapping lookup table containing 32 key-value pairs is first constructed, mapping the 405 nm node of the original data to the 400 nm node of the theoretical data, 420 nm to the 415 nm node, and so on. During the rearrangement process, according to the order of increasing physical wavelength, the measured and theoretical spectral vectors are arranged in the order of [400, 415, 430, 750] nm. If a 690 nm band is missing in the original detection data, the reflection intensity of the missing node is estimated using the average of the reflection intensity values ​​of the neighboring 680 nm and 700 nm bands, and a cubic spline is used to smoothly transition the neighboring bands. The final output benchmark comparison spectral dataset contains 32 wavelength nodes. The measured and theoretical reflectance values ​​of each node are matched in the same dimension, ensuring that when entering the band-by-band difference calculation in S5.2, the comparison of each band is strictly based on the physical correspondence, effectively eliminating the impact of wavelength mismatch on the accuracy of color difference calculation.

[0105] S5.2: Perform band-by-band amplitude subtraction based on the benchmark comparison spectral dataset to calculate the instantaneous difference between the measured reflection intensity value and the dynamically generated theoretical standard spectral response value, and obtain the original spectral difference sequence.

[0106] For the benchmark comparison spectral dataset after S5.1 band index alignment, the measured reflectance intensity scalars of each corresponding band are selected as the minuend, and the theoretical standard spectral response scalars of the same band are selected as the subtrahend, constructing an input pair for calculating the amplitude difference band by band. For each band node, a floating-point arithmetic unit is called to perform amplitude subtraction, using the formula... in, This represents the instantaneous difference value of the i-th band. This represents the measured reflection intensity value for this band. This represents the theoretical standard spectral response value for that band. The difference results are written to the original spectral difference sequence buffer in real time, maintaining a one-to-one correspondence with the band order. The signed value of each element in the difference sequence is retained to ensure that the color change trends corresponding to positive and negative shifts can be distinguished later. This operation is performed sequentially on all bands until all thirty-two band nodes are processed, generating an original spectral difference sequence containing positive and negative shift information as the direct input to S5.3. Through band-by-band amplitude subtraction, the measured and theoretical data after band comparison are converted into a basic vector that reflects the instantaneous spectral deviation direction and amplitude, achieving fine-grained capture of spectral deviation patterns and precise support for subsequent weight allocation.

[0107] For example, in an online detection system, the reflectance intensity value of the 10th band (corresponding to a center wavelength of 620 nm) in the measured spectral response sequence is 0.482, while the value of the standard spectral response curve for this band is 0.465. Using the aforementioned difference calculation formula, the instantaneous difference value for the 10th band is 0.017, with a positive sign, indicating that the measured reflectance of this band under the current paint texture state is higher than the theoretical standard value. For another band, such as the 25th band (center wavelength 710 nm), the measured value is 0.538, and the theoretical value is 0.552. The calculated instantaneous difference value for the 25th band is -0.014, with a negative sign, indicating that the measured reflectance is lower than the standard. The differences of all bands are stored in the original spectral difference sequence in wavelength order. Verification shows that this method, under the condition of matte, grainy paint surfaces with significant texture interference, can clearly distinguish the distribution characteristics of positive and negative offsets in different bands, providing accurate and physically interpretable difference input for the nonlinear weight adjustment of S6.

[0108] S5.3: Perform absolute value modulus conversion on the original spectral difference sequence to eliminate directional sign interference and retain the amplitude characteristics of spectral deviation, generating a set of non-negative spectral deviation amplitudes.

[0109] When processing the raw spectral difference sequence generated by S5.2, the difference value matrix containing positive and negative signs is used as input. Each band difference scalar in the matrix is ​​received, and the absolute value operator is called according to the band order to remove its sign component. A square operation is performed on each band difference scalar, followed by a square root to ensure the accuracy of the physical amplitude is preserved during the calculation. Arithmetic processing is performed using a high-precision floating-point format (at least double-precision 64-bit) to prevent the accumulation of numerical truncation errors. The amplitude-processed band data is written to a new non-negative amplitude set container according to the original band index position. During the writing process, monotonicity constraint detection is implemented to verify the physical validity of each amplitude. If invalid values ​​or infinite values ​​are found, an abnormal replacement strategy is executed to maintain the stability of the dataset. Each element in the amplitude set is processed again by a threshold pruning operator to eliminate spurious difference values ​​below the device noise floor level. After the set is constructed, a final non-negative spectral deviation amplitude set describing the color distortion amplitude of each band is generated. The formula calculation process can be expressed as: in, Let be the non-negative spectral deviation amplitude of the i-th band. This represents the original spectral difference value of the i-th band obtained through the S5.2 operation. Using this absolute value modulus conversion method, the signed difference data from the previous step is transformed into a set of non-negative physical quantities that exclude directional interference and retain only the amplitude characteristics of color distortion, thereby improving the input stability and accuracy of the subsequent color difference contribution allocation stage.

[0110] For example, in the inspection of paint finish on ABS plastic substrate helmets, the original spectral difference sequence length is 32, and the difference values ​​for each band range from... The value is between 0.045 and 0.062, implemented using double-precision floating-point. The calculation yields a set of non-negative amplitude values ​​ranging from 0 to 0.062. For band difference values ​​with amplitudes below 0.005, direct zeroing is performed to eliminate low-amplitude noise interference, and the above formula is used for calculation. For example, for a certain band... = 0.028, obtained through absolute value operation. =0.028. The set of non-negative spectral bias amplitudes formed after processing all 32 band amplitudes is directly passed to the band order reorganization module of S5.4. The processing result in this scenario is that the amplitude set structure is complete, there is no sign interference, and the physical consistency is good, thus ensuring the accuracy of the subsequent construction of the adaptive weight allocation matrix and significantly improving the robustness of color difference evaluation in complex texture environments.

[0111] S5.4: The non-negative spectral deviation amplitude set is vector-encapsulated using a preset band order recombination algorithm, and the deviation data is arranged in the order of physical wavelength from short wave to long wave to construct a structured initial spectral deviation vector.

[0112] For the set of non-negative spectral deviation amplitudes after absolute value modulus conversion, a preset band order reorganization algorithm input interface is invoked to establish a mapping index relationship for the set according to the physical wavelength calibration table of narrowband tunable light sources. Based on the data fields of the physical wavelength calibration table, each deviation amplitude in the set is bound and mapped to its corresponding center wavelength parameter, generating a temporary key-value pair list containing a one-to-one association between deviation amplitudes and center wavelengths. This temporary key-value pair list is used to perform an ascending sort operation based on the center wavelength parameter, with the sorting rule fixed to ascending from shortwave to longwave in order of physical wavelength to ensure consistency across different batches of data. A vector encapsulation operation is performed on the sorted deviation amplitude sequence, filling the amplitudes of each dimension into a one-dimensional array structure according to a fixed index order, ensuring that the index positions are strictly consistent with the physical wavelength order. During the encapsulation process, missing dimensions are padded with zero values ​​to ensure that the vector length is completely consistent with the preset number of bands and matches the standard of subsequent matrix operation interfaces. Through the above-mentioned recombination and encapsulation process, the set of non-negative spectral deviation amplitudes from the previous step is transformed into an initial spectral deviation vector with ordered and structured physical wavelengths. This achieves the technical effect of assigning stable index positions to different bands, thereby enhancing the accuracy and repeatability of subsequent weight allocation and matrix multiplication operations.

[0113] For example, in an online inspection system for a helmet painting production line, the wavelength calibration table for a narrowband tunable light source is defined as 32 discrete nodes, covering a range from 400nm to 750nm, with an actual calibration wavelength interval of 11nm for each node. After processing with S5.3, the resulting set of non-negative spectral deviation amplitudes is an unordered array of length 32, where the 5th element corresponds to an actual wavelength of 460nm, and the 1st element corresponds to an actual wavelength of 400nm. The band order reorganization algorithm interface is called to first match this set with the wavelength calibration table, generating a list of key-value pairs, such as (0.400, 0.015), (0.460, 0.027), etc., where the first value is the center wavelength in micrometers, and the second value is the deviation amplitude at that wavelength. After performing ascending sorting based on the center wavelength, an ordered sequence of deviation amplitudes with monotonically increasing wavelengths is formed. The sequence is sequentially filled into an initial spectral deviation vector of fixed length 32, with zeros filled for all wavelength nodes not present in the original set, maintaining consistency between the index and the physical wavelength while serving as placeholders. In this embodiment, the final generated vector has the following dimensions: the first dimension is the deviation magnitude of 0.015 at 400nm wavelength, the second dimension is the placeholder zeros at 411nm wavelength, and so on, up to the 32nd dimension, which is the deviation magnitude of 0.022 at 750nm wavelength. This ordered vector passes all band checks at once when entering the data integrity verification step S5.5, ensuring that the subsequent construction of the weight coefficient matrix in S6 is based on a stable and physically consistent band indexing system, thereby significantly improving the robustness and repeatability of color difference determination.

[0114] S5.5: Perform data integrity verification processing based on the structured initial spectral deviation vector to confirm that all target bands have completed the difference calculation and there is no missing data, and output the initial spectral deviation vector.

[0115] Step S6: Construct an adaptive nonlinear weighting coefficient matrix based on the texture intensity level parameters, and allocate the contribution of different bands in the initial spectral deviation vector to generate processed deviation data for each band. Specifically, this includes: S6.1: Obtain the texture intensity level parameter output from the previous step, and perform mapping transformation on the texture intensity level parameter based on the preset nonlinear decay function model to generate a basic scattering interference index that characterizes the degree of influence of the current paint surface microstructure on light scattering.

[0116] When executing this sub-step, the texture intensity level parameter output from the previous step is used as input, treated as a continuous numerical variable describing the saliency of the current paint surface microstructure. This variable is then mapped and transformed using a pre-defined nonlinear decay function model in the process database. In this process, the nonlinear function model definition module is first invoked to match the corresponding decay curve family parameter set according to the value range of the texture intensity level parameter, ensuring the smooth differentiability of the mapping relationship under different texture intensities. Subsequently, within the numerical calculation unit, the texture intensity level parameter is substituted into the pre-defined nonlinear decay function expression: in, Based on the scattering interference index, This is the model scaling factor. For texture intensity level parameters, It is a smoothing constant. The coefficients are nonlinear exponential. Next, the mapped output values ​​are pruned to ensure that the range of I is limited to the process safety range [0,1], preventing subsequent weight distortion caused by abnormal inputs. Then, in the data type standardization module, the pruned I value is converted to double-precision floating-point format and bound to a unique identifier of the current detection object to ensure data consistency when called in a multi-threaded parallel computing environment. Finally, this basic scattering interference index is stored in the weight coefficient matrix construction cache, serving as the core input factor for the next sub-step, S6.2, the wavelength-dependent scattering suppression algorithm.

[0117] Through the mapping transformation process based on the nonlinear attenuation function model, the texture intensity level parameter obtained in the previous step is transformed into a basic scattering interference index that can directly quantify the degree of scattering influence of the paint surface microstructure. This realizes the parameter domain transformation from surface geometric description to optical perturbation measurement, providing accurate and physically interpretable input for subsequent band confidence allocation calculation.

[0118] S6.2: Receive the basic scattering interference index and the predefined narrowband tunable light source band range information, and use the wavelength-dependent scattering suppression algorithm to calculate the theoretical signal-to-noise ratio attenuation value corresponding to each independent band, so as to generate the original band confidence sequence containing thirty-two dimensions of data.

[0119] Receive the basic scattering interference index output from the preceding sub-step S6.1, and synchronously load the narrowband tunable light source band range information stored in the system configuration file as the initial parameter value.

[0120] The basic scattering interference index is input into the perturbation coefficient generation module of the wavelength-dependent scattering suppression algorithm to establish a functional correlation between the interference level and the spectral wavelength. This correlation is used to characterize the scattering attenuation trend of signals in each band by a specific texture intensity.

[0121] Based on the aforementioned band range information, an independent signal-to-noise ratio (SNR) theoretical model is established for each discrete wavelength node. This model uses the fundamental scattering interference index as an input variable and outputs the corresponding SNR attenuation value through a wavelength sensitivity function. The mathematical expression of the wavelength sensitivity function is as follows: Wherein, SNR is the corrected signal-to-noise ratio value. Here, k represents the theoretical signal-to-noise ratio benchmark without texture interference, and k is the attenuation coefficient obtained by mapping the fundamental scattering interference exponent. The center wavelength of the current band. The scattering-sensitive peak wavelength, It is a wavelength-dependent attenuation index.

[0122] The theoretical signal-to-noise ratio (SNR) values ​​for each wavelength node are iteratively calculated, and the calculation results are stored in real time in the corresponding band index position to form an initial array of SNR attenuation containing all 32 narrowband bands.

[0123] The initial array is input into the outlier detection and smoothing filter module, which performs interpolation replacement and neighborhood weighted smoothing on abnormal attenuation values ​​caused by transient noise or data loss, in order to prevent extreme values ​​of a single band from distorting subsequent weight allocation.

[0124] Through the above processing, the basic scattering interference index and band range information from the previous step are transformed into a physically consistent original band confidence sequence that can be used to optimize weight allocation, thereby accurately characterizing the reliability of each band measurement data under the current texture state.

[0125] For example, when inspecting the paint surface of a high-gloss textured helmet, the measured texture intensity level parameter was 0.72, corresponding to a base scattering interference index of 0.65. A narrowband tunable light source covered 400nm to 750nm, divided into 32 equally spaced bands, with the scattering-sensitive peak wavelength set at 450nm. In the wavelength-dependent scattering suppression algorithm, the attenuation coefficient k was calculated as 0.65 / 1.0, p was set to 2, and the theoretical signal-to-noise ratio (SNR) benchmark without texture interference was uniformly set to 50dB. Substituting into the formula, when the center wavelength of the band was 400nm, the corrected SNR value was obtained as 33.875dB. After calculating the SNR values ​​of all 32 bands sequentially, a three-point weighted smoothing filter was used to suppress fluctuations. The original band confidence sequence generated by the processing results shows a significant attenuation trend in the 400-500nm range and maintains high stability in the 600-750nm range. This output will directly provide an accurate initial weight basis for the normalization and long-band priority enhancement processing of S6.3.

[0126] S6.3: Perform normalization constraint processing on the original band confidence sequence, and introduce a long-band priority enhancement factor to weight and correct the confidence values ​​in the 600 to 750 nanometer range, so as to generate an intermediate state weight distribution vector optimized by spectral characteristics.

[0127] S6.4: Construct a diagonal matrix structure based on the intermediate state weight distribution vector, fill the diagonal positions of the vector with the values ​​of each dimension in sequence, and set the off-diagonal elements to zero to generate an initial adaptive nonlinear weight coefficient matrix for linear transformation operations.

[0128] Based on the generated intermediate state weight distribution vector, the thirty-two weight coefficients arranged in wavelength order are first read one by one as the input parameter source for matrix construction, ensuring that the one-to-one correspondence between subsequent matrix elements and band indices remains strictly consistent. Based on the read weight coefficient sequence, index loop control is executed, filling the value W_i corresponding to index position i in the current sequence into the i-th row and i-th column position of the initial matrix M. This process accurately maps the weight coefficients to the diagonal elements of the matrix. For all off-diagonal elements, zero-value filling is performed, uniformly assigning zero values ​​to the data units corresponding to off-diagonal elements in matrix M, eliminating interference from nonlinear cross-weights between bands and ensuring the sparsity and positive definiteness of the matrix. A sparse matrix storage structure is used during construction, and memory compression encoding is performed on the zero element positions to optimize the matrix's access efficiency on edge computing GPUs and reduce data transmission bandwidth consumption. To verify the correctness of the matrix construction result, a diagonal element reconstruction check is performed. The coefficient vector extracted from the main diagonal is compared element-by-element with the input intermediate state weight distribution vector. If a deviation exists, a re-filling process is triggered. Through the above construction process, the intermediate state weight distribution vector generated in the previous sub-step is transformed into an initial adaptive nonlinear weight coefficient matrix that adapts to the requirements of subsequent linear transformations, realizing the matrix-based control capability for dynamic scaling of deviations in each band.

[0129] S6.5: Perform matrix multiplication using the initial adaptive nonlinear weighting coefficient matrix and the initial spectral deviation vector generated in the previous step to dynamically scale the amplitude of the deviation data for each band, so as to output the weighted spectral deviation vector that has completed the contribution allocation process.

[0130] Step S7: Based on the processed bias data of each band, perform a fusion calculation to output a comprehensive color difference judgment value with physical interpretability. Specifically, this includes: S7.1: Perform element-wise squaring on the weighted spectral deviation vector output from the previous step to eliminate directional interference of positive and negative signs and amplify the energy contribution of significant deviation components, thereby obtaining a non-negative spectral deviation energy sequence characterizing the color distortion intensity of each band.

[0131] An independent index relationship is established for the amplitude data of each band in the weighted spectral deviation vector obtained by step S6.5 to ensure that the subsequent energy calculation accurately corresponds to each spectral dimension.

[0132] The elements in the weighted spectral deviation vector are exponentially processed using the square operator to perform a second boost on the amplitude, thereby solidifying the significance of the large deviation components and forming a set of squared values ​​for each dimension. The formula is expressed as follows: in For the first Band-weighted deviation amplitude, This corresponds to the energy value.

[0133] The above set of squared values ​​is subjected to sign normalization confirmation operation. The absolute value function is used to ensure that the original positive and negative deviation directionality is eliminated, so that the energy quantization process only reflects the magnitude and is not affected by polarity.

[0134] The processing results are stored as energy sequences in the non-negative real number domain, identified as non-negative spectral deviation energy sequences, and each element is bound with a band number to maintain the traceability of its physical meaning.

[0135] By amplifying the energy contribution of significant spectral distortion through squaring operations and simultaneously achieving bias directionality shielding through positive and negative sign elimination, the weighted spectral bias vector output by S6 is transformed into a physical energy sequence that is free from directional interference and can quantify the intensity of color distortion, providing accurate and unsigned interference-free input data for the visual sensitivity weighted mapping of S7.2.

[0136] For example, in a set of weighted spectral bias vectors containing 32 dimensions, the amplitude of the 12th dimension is 0.045 W / m², which, when squared, yields 0.045² = 0.002025 W² / m². 4 The energy value is stored by binding band index 12. This operator calculation process is repeated for all dimensions, forming an energy sequence containing 32 elements. For example, the amplitude in the 5th dimension is -0.063 W / m², which, when squared, yields 0.003969 W² / m². 4 After sign normalization, the values ​​remain positive and are bound to band 5. In the final energy sequence, the values ​​of bands 12 and 5 are greater than the energy values ​​of most short bands, indicating significant color distortion. After this processing, the subsequent S7.2 can use this set of unsigned, amplitude-enhanced energy values ​​in conjunction with the visual sensitivity curve to perform spectral weighting, thereby establishing a high-precision mapping relationship between physical energy and human visual perception, achieving stable color difference determination under complex texture conditions.

[0137] S7.2: Based on the non-negative spectral deviation energy sequence, a spectral weighted mapping process is performed using a preset human visual sensitivity curve to simulate the nonlinear characteristics of the human visual system's perception of color differences at different wavelengths, thereby generating a spectral perception weight distribution vector that conforms to physiological visual response.

[0138] Based on the non-negative spectral bias energy sequence output from the preceding steps, this energy sequence is used as an input load and introduced into a predefined human visual sensitivity curve model so that the calculation process is constrained by physiological perception consistency parameters.

[0139] The multi-band sampled values ​​of the CIE1931 standard colorimetric spectral luminous efficiency function V(λ) stored in the visual characteristics database are called. Based on the actual wavelength distribution of the narrowband tunable light source, the function curve is linearly interpolated at each band node to obtain a set of matching sampling coefficients of the same dimension as the spectral deviation energy sequence.

[0140] Normalization is performed on the matching sampling coefficient set to ensure that the weight coefficients of all bands are consistent with the relative proportion of the human eye's spectral sensitivity, while ensuring that the sum of the weights is 1 to prevent abnormal energy dimensions from being caused by subsequent weighted calculations.

[0141] A spectrum weighted mapping operator is constructed based on the normalized coefficient set. The sampling coefficients of each band are multiplied sequentially with the deviation energy components of the corresponding band to achieve a dimension-wise coupling between physical measurement values ​​and visual subjective sensitivity.

[0142] S7.3: Perform a Hadamard product multiplication operation on the spectral perception weight distribution vector and the non-negative spectral deviation energy sequence to achieve coupling correction of spectral physical deviation and human subjective perception characteristics, thereby outputting a set of visually corrected perception deviation energy components.

[0143] Based on the spectral sensing weight distribution vector and the non-negative spectral deviation energy sequence output from step S7.2, these are used as the input data set for this sub-step. Their bandwidth division and band indices are strictly aligned to ensure accurate wavelength correspondence in element-wise operations. For each band index position, the Hadamard product operator is first invoked to directly multiply the weight coefficient at that position in the spectral sensing weight distribution vector with the corresponding non-negative spectral deviation energy value. The calculation formula is defined as follows: in Indicates the first Perception weighting coefficient of the band, Indicates the first Non-negative spectral bias energy value of the band, The first after visual correction Band-sensing bias energy components. During the above dot-multiplication operation, a double-buffered register strategy is introduced into the computation kernel layer to achieve parallel reading and product writing of the weight vector and energy sequence, thereby reducing the pipeline blockage caused by memory access latency. After completing the element-by-element multiplication operation across the entire band, all the results are... The components are rearranged into a column vector structure according to their original wavelength order to ensure spectral continuity and physical consistency in the subsequent full-dimensional accumulation process. Through the above band-by-band weighted-energy coupling processing based on Hadamard product, the spectral physical deviation data from the previous step is transformed into a set of perceptual deviation energy components that simultaneously conform to the characteristics of human visual sensitivity, thus achieving an effective fusion of the physical measurement dimension and the subjective perception dimension.

[0144] For example, in a weighted spectral bias energy analysis comprising 32 bands, the non-negative spectral bias energy sequence to The value ranges from 0.002 to 0.087, and the spectral sensing weight distribution vector... to The value range is from 0.65 to 1.38. In actual calculations, taking band 10 as an example, if... =0.054 and =1.22, then after Hadamard product processing The value is 0.06588. This method is used to complete the product calculation for all 32 bands and generate... to The visually corrected perceived energy component set is output to the subsequent S7.4 step for full-dimensional summation processing. The output data after this processing showed significantly improved band perception consistency in prototype verification, especially in the short-band region where the suppression effect on small spectral fluctuations caused by texture was significantly enhanced.

[0145] S7.4: Perform full-dimensional summation operation based on the set of perceived deviation energy components to aggregate discrete perceived deviation information under all bands and form a scalarized total error metric value, thereby obtaining the initial comprehensive color difference cumulative value.

[0146] S7.5: Perform a square root transformation on the initial cumulative color difference value to restore it to a linear space with the same dimensions as the original spectral intensity and in accordance with the International Commission on Illumination standard color difference calculation formula definition, thereby finally outputting a physically interpretable comprehensive color difference judgment value.

[0147] Step S8: Determine whether the comprehensive color difference judgment value exceeds a preset tolerance threshold. If it does, generate a color adjustment execution command containing compensation amount information to drive the spraying equipment to adjust the pigment ratio. Specifically, this includes: S8.1: The comprehensive color difference judgment value is compared with the preset tolerance threshold in the industrial control register to generate a binary out-of-tolerance flag bit that represents whether the current paint color state is qualified.

[0148] S8.2: Based on the triggering condition when the binarized out-of-tolerance flag is true, extract the spectral deviation component data hidden in the comprehensive color difference judgment value to form the original color error vector to be corrected.

[0149] S8.3: The original color error vector is nonlinearly inverted using a pre-trained pigment mixing inverse mapping model to calculate the specific amount of each basic pigment component to be added or reduced.

[0150] The original color error vector extracted in step S8.2 is subjected to dimensionality analysis to distinguish the spectral deviation components corresponding to each basic pigment channel and to establish a calculation task model that maps the target color difference value to the pigment ratio adjustment amount.

[0151] The spectral deviation component is used as the input vector of the pre-trained pigment mixing inverse mapping model. During the training phase, the model establishes a nonlinear function approximation relationship based on the known ratios and measured spectra of a large number of standard color sample samples, and uses a multilayer feedforward neural network or radial basis function regression structure to fit the complex mapping surface between multi-channel spectra and ratios.

[0152] Normalization and centering preprocessing are performed on the input vector to match the parameter distribution range during model training, ensuring the numerical stability and accuracy of the inversion calculation.

[0153] During the model inference process, the output prediction values ​​for each pigment channel are calculated through forward propagation. These prediction values ​​are defined as the initial estimates of the amount of each basic pigment component to be added or reduced.

[0154] Based on the output prediction value and the constraints of the spraying process, threshold truncation and sign correction operations are performed to ensure that all adjustments are within the range that the equipment can achieve, and the sign convention of positive values ​​representing addition and negative values ​​representing reduction is retained, thus forming the final output result of this step.

[0155] By solving the problem based on a nonlinear inverse mapping model, the spectral deviation information from the previous step is transformed into physically executable pigment ratio adjustment parameters, enabling high-precision, real-time color compensation input to be obtained without iterative search.

[0156] For example, on an automated helmet painting production line, the detected raw color error vector contains deviation information for the three basic channels (red, green, and blue) across 32 narrowband bands. Principal component compression yields 5-dimensional features for each channel, which are then used as model input. The pre-trained pigment mixing inverse mapping model is a three-layer fully connected network with 64 and 32 hidden layer nodes respectively. The activation function is ReLU, and the output layer is a linear mapping, outputting the adjustment amounts for the three channel ratios. The normalized input features are fed into the model, resulting in outputs of 0.12 for the red channel, -0.08 for the green channel, and 0.05 g / L for the blue channel. This indicates that the painting system needs to increase red pigment by 0.12 g / L, decrease green pigment by 0.08 g / L, and increase blue pigment by 0.05 g / L. In this scenario, the model automatically eliminates the interference of spectral distortion caused by texture on the ratio inversion through the nonlinear mapping relationship learned during the training phase. The output parameters directly meet the accuracy and response requirements of the spraying equipment. After subsequent S8.4 dynamic compensation correction, the paint surface can be effectively restored to the target standard color, and the color difference fluctuation range of the spraying quality is significantly reduced.

[0157] S8.4: Based on the specific addition or reduction parameters and the rheological characteristic curve of the current spraying equipment, perform dynamic compensation and correction processing to generate a standard color matching execution instruction package containing precise flow control instructions.

[0158] S8.5: The standard color matching execution instruction package is sent to the spraying robot controller via the industrial fieldbus protocol to drive the proportional valve group to adjust the pigment supply ratio in real time and complete the closed-loop feedback verification.

[0159] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.

[0160] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the element or object preceding “comprising” or “including” encompasses the element or object listed following “comprising” or “including” and its equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.

[0161] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A color compensation method based on online detection of helmet paint color difference, specifically including: S1: Acquire multi-band reflection intensity data and near-infrared texture morphology images of the helmet paint surface under narrowband tunable light source excitation, and generate the original detection dataset; S2: Perform convolution feature extraction on the surface geometric features in the original detection dataset to generate texture category labels and texture intensity level parameters; S3: Based on the texture category label, retrieve the preset texture-spectral response fingerprint library to obtain the spectral response offset mode vector that matches the current helmet paint microstructure; S4: Use the spectral response offset mode vector to perform band-by-band weighted modulation processing on the reference spectral response data under an ideal smooth surface to generate a standard spectral response curve; S5: Calculate the band-by-band difference between the spectral response sequence in the original detection dataset and the standard spectral response curve to obtain the initial spectral deviation vector; S6: Construct an adaptive nonlinear weighting coefficient matrix based on the texture intensity level parameters, allocate the contribution of different bands in the initial spectral deviation vector, and generate the processed deviation data for each band. S7: Based on the processed deviation data of each band, perform fusion calculation and output a comprehensive color difference judgment value with physical interpretability; S8: Determine whether the comprehensive color difference judgment value exceeds the preset tolerance threshold. If it does, generate a color adjustment execution command containing compensation amount information to drive the spraying equipment to adjust the pigment ratio.

2. The color compensation method based on online detection of helmet paint color difference according to claim 1, characterized in that, Step S3 specifically includes: The texture category labels are hashed and indexed to generate texture feature retrieval key values ​​with unique identifier attributes, which serve as input address pointers for accessing the texture-spectral response fingerprint database. Based on the texture features, the key values ​​are retrieved and a multidimensional neighborhood matching query is performed in the texture-spectral response fingerprint database to extract the original spectral response offset dataset containing the reference reflectance attenuation coefficient and the band scattering enhancement factor. The discrete sampling points in the original spectral response offset dataset are smoothed and fitted using a local weighted regression algorithm to construct a texture-induced spectral distortion function curve. Perform band-by-band differential operation based on the texture-induced spectral distortion function curve to quantify the relative intensity deviation amplitude under each narrowband wavelength and generate an initial spectral offset vector sequence. The spectral response offset mode vector is output by performing normalized vector encapsulation processing based on the initial spectral offset vector sequence.

3. The color compensation method based on online detection of helmet paint color difference according to claim 1, characterized in that, Step S5 specifically includes: The spectral response sequence in the original detection dataset is aligned with the standard spectral response curve by band indexing to establish a one-to-one mapping relationship between each wavelength node under narrowband tunable light source excitation, and a benchmark comparison spectral dataset is generated. Based on the benchmark comparison spectral dataset, perform band-by-band amplitude subtraction to calculate the instantaneous difference between the measured reflection intensity value and the dynamically generated theoretical standard spectral response value, and obtain the original spectral difference sequence; The original spectral difference sequence is subjected to absolute value modulus conversion to eliminate directional sign interference and retain the amplitude characteristics of spectral deviation, generating a set of non-negative spectral deviation amplitudes. The non-negative spectral deviation amplitude set is vector-encapsulated using a preset band order recombination algorithm, and the deviation data is arranged in the order of physical wavelength from short wave to long wave to construct a structured initial spectral deviation vector. Data integrity verification is performed based on the structured initial spectral deviation vector to confirm that all target bands have completed the difference calculation and there is no missing data, and the initial spectral deviation vector is output.

4. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that: The fingerprint entries in the texture-spectral response fingerprint database include the reference reflectance attenuation coefficient and the scattering enhancement factor for each band, and the neighborhood matching adopts a weighted modulated multidimensional distance function.

5. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that, The standard spectral response curve is generated by modulating the thirty-two-dimensional spectral offset vector with the reference spectral vector one by one using the Hadamard product, and then performing spline interpolation to make the output result continuous, differentiable and with high physical matching degree.

6. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that, The band-by-band weighted modulation process automatically adjusts the weight allocation between short-wavelength and long-wavelength bands according to the texture intensity level, with the weight of the long-wavelength range preferably increased by 10%–30%.

7. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that, The CIE1931 standard luminous efficiency function is introduced into the color difference determination process to achieve visual sensitivity spectrum weighting, so that the comprehensive color difference determination value reflects the actual physiological characteristics of the human eye.

8. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that, The driving spraying equipment adjusts the pigment ratio by constructing an inverse mapping model using neural networks or radial basis function regression, thereby achieving nonlinear calculation of the addition and reduction of pigment components in multiple channels.

9. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that, When the overall color difference exceeds the threshold, a color adjustment command is output, and compensation and correction are performed in conjunction with the rheological characteristic curve of the spraying equipment.

10. The color compensation method based on online detection of helmet paint color difference as described in claim 1, characterized in that: The texture-spectral response fingerprint library and model weights used in each step can be calibrated on-site and optimized through self-learning to improve the generalization ability of color difference determination for new texture types.