Wood color difference online detection method based on spectral reflectivity reconstruction
Based on the method of reconstruction based on spectral reflectance, combined with the characteristics of the surface roughness of the wood, the problem of low color difference test accuracy in the process of wood dyeing is solved, and higher color difference detection accuracy is achieved.
Patent Information
- Application Number
- CN202411416845.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, diffuse reflection and scattering of light due to texture and surface roughness during wood staining affect the accuracy of chromatic aberration detection, resulting in low detection accuracy.
Using a wood -based online detection method based on spectral reflectivity reconstruction, by obtaining the color response value and roughness of the color response of the wood dyeing veneer image, enter the pre -training spectral reflectivity reconstruction model, obtain the spectral reflectance, and predict LAB through the color difference calculation model LAB Value, finally use the color difference formula to calculate the color difference.
By introducing the roughness characteristics of the wood surface, the accuracy of the spectral reflectance was improved, the effect of light drill reflection and scattering on color difference detection, and the accuracy of color difference detection was increased.
Smart Images

Figure SMS_1 
Figure SMS_2 
Figure SMS_6
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of wood staining detection, in particular to an online detection method for wood color difference based on spectral reflectance reconstruction. Background Art
[0002] In color-related application fields such as wood dyeing, wood dyeing color matching, and wood dyeing result color difference detection, product color difference is an issue that must be taken seriously. Even products from the same batch may have obvious color differences. In order to better ensure production quality, color difference detection is performed during wood dyeing.
[0003] Traditional color difference detection is to observe with the naked eye. This method of color difference detection is affected by the surrounding environment and the observer's own condition, and the measurement results are not very accurate. As people's requirements for color become higher and higher, this manual detection method can no longer meet people's color detection needs.
[0004] In order to solve the above problems, people use colorimeter to detect the color difference of dyeing. The commonly used colorimeter on the market is based on the calculation method of CIE LAB standard color space, which represents and calculates the color accordingly, quantifies the color and digitizes the color to obtain the color difference. However, the texture of dyed wood and the rough surface caused by the processing process will affect the color difference detection due to the diffuse reflection and scattering of light, resulting in low accuracy of color difference detection. Summary of the invention
[0005] The purpose of the present invention is to propose an online detection method for wood color difference based on spectral reflectance reconstruction in view of the problem that the texture of dyed wood in the prior art and the rough surface caused by the processing process will affect the color difference detection due to the diffuse reflection and scattering of light, thus resulting in low color difference detection accuracy.
[0006] The technical solution adopted by the present invention to solve the above technical problems is:
[0007] The method for online detection of wood color difference based on spectral reflectance reconstruction includes the following steps:
[0008] Step 1: Obtain the image of the wood dyed veneer to be detected;
[0009] Step 2: Obtain the color response value, Lab value and roughness of the wood dyed veneer image to be detected, and input the color response value and roughness of the wood dyed veneer image to be detected into a pre-trained spectral reflectance reconstruction model to obtain the output spectral reflectance;
[0010] Step 3: Input the spectral reflectance output by the spectral reflectance reconstruction model into the pre-trained color difference calculation model to obtain the output Lab value;
[0011] Step 4: Based on the output Lab value, subtract it from the Lab value of the wood dyed veneer image to be detected, and use the color difference formula to obtain the color difference value.
[0012] Furthermore, the training process of the pre-trained spectral reflectance reconstruction model is:
[0013] Step 1: Obtain a training set and extract the color response value, roughness, and spectral reflectance of each wood dyed veneer image in the training set;
[0014] Step 2: Using the color response value as the clustering feature, cluster all the wood dyed veneer images in the training set to obtain color clusters;
[0015] Step 3: Sort the color response values in each color cluster from low to high based on brightness to obtain an ordered color cluster;
[0016] Step 4: Input the color response values and their corresponding spectral reflectances in the ordered color clusters into the dynamic XGBoost model, and dynamically adjust the model parameters according to the roughness corresponding to the color response values to obtain the spectral reflectance reconstruction model.
[0017] Furthermore, the step of dynamically adjusting the model parameters according to the roughness corresponding to the color response value in step 4 is:
[0018] When the roughness is <0.5 μm, the depth of the tree in the model is set to 4-6 and the sampling rate is set to 0.6-0.8 Hz;
[0019] When 0.5≤roughness<1.5μm, the depth of the tree in the model is set to 6-8 and the sampling rate is set to 0.7-0.9 Hz;
[0020] When the roughness was ≥1.5 μm, the depth of the tree in the model was set to 8–10 and the sampling rate was set to 0.8–1.0 Hz.
[0021] Further, the color response value of each wood dyed veneer image in step 1 is obtained by the following steps:
[0022] Step 111: obtaining a training set, and performing illumination correction on the wood dyed veneer images in the training set, wherein the illumination correction is performed by white balance correction or based on a standard color card;
[0023] Step 112: performing filtering processing on the corrected image, wherein the filtering processing is median filtering;
[0024] Step 113: Segmenting the stained part in the filtered image, wherein the segmentation is performed by edge detection algorithm or color threshold segmentation;
[0025] Step 114: converting the segmented image into Lab color space and extracting the color response value of each pixel to obtain the color response value of the wood dyed veneer image.
[0026] Furthermore, the specific steps of step 2 are:
[0027] Step 21: Define the Euclidean distance formula for color response values:
[0028]
[0029] Among them, R1 and R2 represent two points in the RGB color space, R 1,r , R 1,g , R 1,b are the color response values of the red, green, and blue channels of R1, respectively. 2,r , R 2,g , R 2,b are the color response values of the red, green, and blue channels of R2 respectively;
[0030] Step 22: Cluster the samples in the training set so that samples with similar color response values form multiple clusters, namely color clusters.
[0031] Furthermore, the roughness is obtained through a gray level co-occurrence matrix.
[0032] Further, the roughness is expressed as:
[0033] Rroughness=w1×Gavg+w2×Contrast
[0034]
[0035] Among them, w1 and w2 are weights, I(x,y) is the image, G x and G y are the gradient changes of the image in the horizontal and vertical directions respectively, P(i,j) represents the joint probability of the pixel pair with gray levels i and j in the image, is a partial derivative, which is used to calculate the rate of change of a variable. To represent the rate of change of image I at position (x, y) relative to the x direction, it reflects the gradient of the image in the horizontal direction. It represents the rate of change of image I at position (x, y) relative to the y direction, reflecting the gradient of the image in the vertical direction. Gavg represents the overall gradient intensity. Contrast represents the average gradient intensity of the entire image, which can be obtained by averaging the gradient intensity G of all pixels. It is usually used to judge the overall roughness of the surface.
[0036] Furthermore, the color difference formula is expressed as:
[0037]
[0038] Among them, ΔL, Δa, and Δb are the differences in L, a, and b values in the Lab color space, respectively.
[0039] Furthermore, the Lab value of the wood dyed veneer image to be detected is obtained by a colorimeter.
[0040] Furthermore, the brightness is expressed as:
[0041] L=0.299R+0.587G+0.114B
[0042] Among them, L is brightness, R is red channel, G is green channel, and B is blue channel.
[0043] The beneficial effects of the present invention are:
[0044] In the process of spectral reflectance reconstruction, the present application introduces the feature of wood surface roughness and trains the model at the same time while using multi-channel response values, thereby improving the accuracy of spectral reflectance reconstruction. The spectral reflectance is used to predict the Lab value, and finally the color difference value between the standard wood and the wood dyed veneer image to be detected is obtained based on the Lab value and combined with the color difference formula. In this way, the influence of diffuse reflection and scattering of light on color difference detection is avoided, and the accuracy of color difference detection is improved. DETAILED DESCRIPTION
[0045] It should be particularly noted that, in the absence of conflict, the various embodiments disclosed in this application can be combined with each other.
[0046] Specific implementation method 1: Specifically describe this implementation method. The method for online detection of wood color difference based on spectral reflectance reconstruction described in this implementation method includes the following steps:
[0047] Step 1: Obtain the image of the wood dyed veneer to be detected;
[0048] Step 2: Obtain the color response value, Lab value and roughness of the wood dyed veneer image to be detected, and input the color response value and roughness of the wood dyed veneer image to be detected into a pre-trained spectral reflectance reconstruction model to obtain the output spectral reflectance;
[0049] Step 3: Input the spectral reflectance output by the spectral reflectance reconstruction model into the pre-trained color difference calculation model to obtain the output Lab value;
[0050] Step 4: Based on the output Lab value, subtract it from the Lab value of the wood dyed veneer image to be detected, and use the color difference formula to obtain the color difference value between the standard wood and the wood dyed veneer image to be detected.
[0051] This application is not only used to detect the color difference of wood dyeing products, but also can reflect the spectral reflectance of wood products to further obtain other quality control parameters of the products. The above method of this application can be implemented based on the following devices:
[0052] Image acquisition part, this part mainly includes COMS black and white camera and camera fixing bracket and stage; filter part, mainly includes filter wheel, servo, D65 standard light source with power of 20W, etc., which are used to work together with image acquisition part to realize a multi-spectral image acquisition system. The single chip microcomputer part mainly drives the servo to rotate the filter wheel. Each rotation of the filter wheel is an acquisition cycle, which is used to obtain the multi-spectral response value of the measured color block for spectral reflectance reconstruction; the reflection reconstruction part has a pre-trained spectral reflectance reconstruction model, which can reconstruct the spectral reflectance through the response value of the camera; the color difference part, according to the obtained spectral reflectance, obtains the corresponding LAB value through the pre-trained model, and then calculates the color difference between the finished dyed wood and the standard dyed wood according to the color difference calculation formula; the output part is used to output the measured wood spectral reflectance and the corresponding color difference with the standard dyed wood.
[0053] Among them, the filter obtains camera response values in 8 bands between 400 and 750nm in the approximate range of visible light, with an interval of 50nm. Although it reduces the reconstruction accuracy of spectral reflectance, it greatly improves the efficiency of spectral reflectance reconstruction and color difference detection, mainly by reducing the time of each detection cycle. This is mainly considered at the practical application level. Too long time will lead to problems such as low production efficiency.
[0054] The spectral reflectance of the output part contains 8 bands and their corresponding spectral values.
[0055] In the process of spectral reflectance reconstruction, while using multi-channel response values, the wood surface roughness feature is introduced to train the model at the same time to improve the accuracy of spectral reflectance reconstruction. When using spectral reflectance to predict color difference, the original image is decomposed into components of different scales and frequencies using wavelet transform, and the texture features are extracted to regulate the model training.
[0056] Specific implementation method 2: This implementation method is a further explanation of specific implementation method 1. The difference between this implementation method and specific implementation method 1 is that the training process of the pre-trained spectral reflectance reconstruction model is:
[0057] Step 1: Obtain a training set and extract the color response value, roughness, and spectral reflectance of each wood dyed veneer image in the training set;
[0058] Step 2: Using the color response value as the clustering feature, cluster all the wood dyed veneer images in the training set to obtain color clusters;
[0059] Step 3: Sort the color response values in each color cluster from low to high based on brightness to obtain an ordered color cluster;
[0060] Step 4: Input the color response values and their corresponding spectral reflectances in the ordered color clusters into the dynamic XGBoost model, and dynamically adjust the model parameters according to the roughness corresponding to the color response values to obtain the spectral reflectance reconstruction model.
[0061] The spectral reflectance reconstruction model will be obtained in advance through the following training steps:
[0062] Prepare several dyed veneer samples as reference samples of standard spectral reflectance. These veneers will represent different dyeing effects for training and testing models; use a high-resolution camera to photograph the wood surface, generally using a directional light source to highlight surface details; save the photographed photos in a lossless format (such as TIFF) to retain all the detail information of the image.
[0063] Extract color response values: Convert the image into a specific color space (such as Lab) and extract the color response value of each pixel. Depending on the light source conditions, a multispectral camera can be used to capture color responses in multiple bands. These color response values will be used as input for training data, together with the standard spectral reflectance data of the single board, to form a training set.
[0064] The training set obtained above is clustered, and the color response value extracted from the dyed veneer surface image is used as the clustering feature. Commonly used clustering algorithms include K-Means clustering or hierarchical clustering.
[0065] The samples in each color cluster are sorted according to the color response value (RGB value) to form an ordered color cluster. The sorting method can be based on brightness as the sorting basis.
[0066] The color response values and corresponding spectral reflectance extracted from the processed training set are input into the dynamic XGBoost model for training. The structure of the model will be dynamically adjusted according to the roughness parameters mentioned above:
[0067] A color difference detection device provided by the present application needs to have the following technical features, wherein the spectral reflectance has a total of 8 bands and the expected number of color clusters is 3.
[0068] A color difference detection device provided by the present invention needs to have the following technical features, wherein the object to be detected is a dyed wood chip with a size of 7 cm×4 cm and a thickness between 0.1 mm and 0.2 mm.
[0069] The color difference detection device provided by the present invention needs to have the following technical features: the classified color clusters are sorted again according to the RGB values, and then different RGB response values are extracted from them according to appropriate intervals to form new color clusters in order.
[0070] Input layer: The input is the preprocessed color response value (R, G, B) and the extracted roughness features.
[0071] Feature selection and enhancement: Use roughness features for dynamic adjustment. Introduce the roughness parameter R rough , weighted combination of features, the formula is:
[0072] X = (1-α) × color response value + α × R rough
[0073] Where α is a weight parameter that is dynamically adjusted with the roughness.
[0074] Model parameter adjustment: Based on the dynamic adjustment of roughness, the following model parameters are updated:
[0075] Tree depth (max_depth): The depth of the tree will increase as the roughness increases to capture more complex patterns. It can be dynamically adjusted by the following formula:
[0076] max_depth = base_depth + β × R rough
[0077] Among them, β is the roughness influence coefficient.
[0078] At the same time, the regularization parameters (λ, α) can be increased to prevent overfitting to the noise on rough surfaces.
[0079] Subsampling rate (subsample, colsample_bytree): Dynamically adjust the feature sampling rate according to the roughness. For example, when the roughness is large, use a higher sampling rate.
[0080] Regularization: To prevent overfitting of high-noise data, increase the regularization parameters (λ, α) to enhance the robustness of the model.
[0081] Training and validation: Training is performed based on a dynamically adjusted model structure, and early stopping techniques are used to determine model convergence.
[0082] The color difference calculation model will be obtained in advance through the following training steps:
[0083] Step 1:
[0084] The spectral reflectance of the multiple ordered color clusters formed in step S5 above is used as the training spectral reflectance, and the corresponding Lab color value is used as the training Lab value, which together constitute the training set. At this time, the spectral reflectance is used as input and the Lab value is used as output for subsequent model training.
[0085] Step 2:
[0086] The training spectral reflectance and its corresponding Lab value in the training set are input into the dynamic LightGBM model and trained through deep learning. The structure of the model is dynamically adjusted according to the cross-sectional texture information. The following is a detailed description of the model improvement:
[0087] Input layer: The input is the preprocessed spectral reflectance data and cross-sectional texture features. Texture features can be extracted through image processing algorithms, such as gray level co-occurrence matrix (GLCM) or local binary pattern (LBP) of texture analysis.
[0088] Feature enhancement: Enhance the features based on the cross-sectional texture features. Set the cross-sectional texture features as Ttexture, and you can construct a weighted feature vector:
[0089] X = (1-β) × spectral reflectance + β × T texture Wherein, β is a weight parameter adjusted according to the cross-sectional texture information, and the value of β depends on the complexity or repeatability of the cross-sectional texture (for example, determined by calculating the variance or frequency of the texture).
[0090] Model parameter adjustment: Dynamically adjust the model parameters of LightGBM according to the texture information. The specific adjustments are as follows:
[0091] Number of leaf nodes (num_leaves): The higher the complexity of the cross-sectional texture, the more leaf nodes the model needs to capture the details. texture Adjust the number of leaf nodes:
[0092] num_leaves=base_leaves+γ×C texture
[0093] Among them, γ is the adjustment coefficient of texture complexity.
[0094] Learning rate (learning_rate): If the cross-sectional texture information shows more complex patterns, the learning rate can be appropriately reduced to prevent overfitting during training:
[0095] learning_rate=base_rate-δ×C texture
[0096] Among them, δ is a dynamically adjusted learning rate parameter, which depends on the complexity of the texture.
[0097] Subsample: Dynamically adjust the sampling rate based on the complexity of the texture. For complex textures, the sampling rate can be increased to capture more features:
[0098] subsample=base_subsample+∈×C texture
[0099] Among them, ∈ represents the influence coefficient of texture information on the sampling rate.
[0100] Regularization: Adjust the regularization parameters (λ, α) according to the complexity of the texture to prevent overfitting. When the texture information is more complex, the regularization strength should be increased to enhance the generalization ability of the model.
[0101] Training process: Use the dynamically adjusted LightGBM model for training. The training goal is to minimize the prediction error of spectral reflectance to Lab color space. By dynamically adjusting the model parameters, the model can adapt to the impact of different texture information on color differences.
[0102] Step 3:
[0103] In actual measurement, the standard wood chip and the wood chip to be tested are measured at the same time to obtain their respective spectral reflectance. Then the spectral reflectance of the two is subtracted, and the calculated spectral difference is input into the trained dynamic LightGBM model to obtain the Lab value difference between the standard wood chip and the wood chip to be tested.
[0104] The difference in Lab values is calculated as follows:
[0105]
[0106] Among them, ΔL, Δa, and Δb are the differences in L, a, and b values in the Lab color space, respectively. The color difference between the standard wood chip and the wood chip to be tested is calculated by applying the color difference formula based on the Lab value difference predicted by the model.
[0107] Output:
[0108] The model outputs the difference in Lab values, combined with the color difference formula, and finally outputs the final color difference between the wood chip to be tested and the standard wood chip. This process utilizes the adaptive adjustment of the dynamic LightGBM model structure to the cross-sectional texture, making the prediction of color difference more accurate.
[0109] The role of clustering: Reduce data complexity: The color response value data of dyed veneer samples is large. Clustering can be used to divide a large number of similar color samples into several clusters to reduce data redundancy and complexity; Analyze color similarity: Clustering helps to identify and group samples with similar color response values, which is convenient for further analysis and model training. The colors in the clusters after clustering are similar, which can better classify or predict colors; Construct ordered color clusters: After clustering, ordered color clusters can be formed by sorting the color response values in each color cluster. The sorted clusters can facilitate color matching or optimization during the dyeing process.
[0110] Specific implementation method three: This implementation method is a further description of specific implementation method two. The difference between this implementation method and specific implementation method two is that the step of dynamically adjusting the model parameters according to the roughness corresponding to the color response value in step 4 is:
[0111] When the roughness is <0.5 μm, the tree depth is set to 4-6 and the sampling rate is set to 0.6-0.8 Hz;
[0112] When 0.5≤roughness<1.5μm, the tree depth is set to 6-8 and the sampling rate is set to 0.7-0.9 Hz;
[0113] When the roughness was ≥ 1.5 μm, the tree depth was set to 8-10 and the sampling rate was set to 0.8-1.0 Hz.
[0114] Roughness Ra < 0.5 μm (very smooth): For very smooth wood surfaces, the complexity of the model can be kept low, as the surface features have less influence on the color, the depth of the tree (max_depth) can be set to a low value (4-6), and the sampling rate can be kept at 0.6-0.8.
[0115] Roughness 0.5 ≤ Ra < 1.5 μm (medium roughness): For wood surfaces with a certain degree of roughness, the model requires a higher tree depth (max_depth can be set to 6-8), and the sampling rate can also be appropriately increased (0.7-0.9) to capture more surface details.
[0116] Roughness Ra ≥ 1.5 μm (rough surface): When the roughness is larger, the model needs to handle more complexity. The tree depth should be increased to 8-10, and the subsampling rate and feature sampling rate should also be increased to between 0.8-1.0.
[0117] Specific implementation method 4: This implementation method is a further description of specific implementation method 3. The difference between this implementation method and specific implementation method 3 is that the color response value of each wood dyed veneer image in step 1 is obtained by the following steps:
[0118] Step 111: obtaining a training set, and performing illumination correction on the wood dyed veneer images in the training set, wherein the illumination correction is performed by white balance correction or based on a standard color card;
[0119] Step 112: performing filtering processing on the corrected image, wherein the filtering processing is median filtering;
[0120] Step 113: Segmenting the stained part in the filtered image, wherein the segmentation is performed by edge detection algorithm or color threshold segmentation;
[0121] Step 114: converting the segmented image into Lab color space and extracting the color response value of each pixel to obtain the color response value of the wood dyed veneer image.
[0122] Image Correction: The captured stained veneer images are corrected for lighting to ensure that the light source has minimal effect on the color. This can be done using a white balance correction or based on a standard gray card.
[0123] Image denoising: Use filtering methods (such as median filtering) to remove noise from the image to ensure that the extracted color response values are not affected by noise.
[0124] Image segmentation: Segment the stained part of the image and extract only the response value of the valid area, which is completed through color threshold segmentation.
[0125] Specific implementation mode 5: This implementation mode is a further description of specific implementation mode 4. The difference between this implementation mode and specific implementation mode 4 is that the specific steps of step 2 are:
[0126] Step 21: Define the Euclidean distance formula for color response values:
[0127]
[0128] Among them, R1 and R2 represent two points in the RGB color space, R 1,r , R 1,g , R 1,b are the color response values of the red, green, and blue channels of R1, respectively. 2,r , R 2,g , R 2,b are the color response values of the red, green, and blue channels of R2 respectively;
[0129] Step 22: Cluster the samples in the training set so that samples with similar color response values form multiple clusters, namely color clusters.
[0130] Specific implementation method 6: This implementation method is a further description of specific implementation method 5. The difference between this implementation method and specific implementation method 5 is that the roughness is obtained through a gray level co-occurrence matrix.
[0131] Specific implementation method 7: This implementation method is a further description of specific implementation method 5. The difference between this implementation method and specific implementation method 5 is that the roughness is expressed as:
[0132] Rroughness=w1×Gavg+w2×Contrast
[0133]
[0134] Among them, w1 and w2 are weights, I(x,y) is the image, Gx and G y are the gradient changes of the image in the horizontal and vertical directions respectively, P(i,j) represents the joint probability of the pixel pair with gray levels i and j in the image, is a partial derivative, which is used to calculate the rate of change of a variable. To represent the rate of change of image I at position (x, y) relative to the x direction, it reflects the gradient of the image in the horizontal direction. It represents the rate of change of image I at position (x, y) relative to the y direction, reflecting the gradient of the image in the vertical direction. Gavg represents the overall gradient intensity. Contrast represents the average gradient intensity of the entire image, which can be obtained by averaging the gradient intensity G of all pixels. It is usually used to judge the overall roughness of the surface.
[0135] The Sobel operator is used to detect edges and highlight the uneven areas on the surface. The gradient changes in the horizontal and vertical directions are calculated.
[0136]
[0137] Gradient Strength:
[0138]
[0139] The edge image can reflect the texture characteristics of the rough surface.
[0140] Gx and Gy represent the gradient changes of the image in the horizontal and vertical directions, respectively obtained by taking the derivative of the image I(x,y) in the x and y directions, reflecting the degree of brightness change in the image. G: This is the calculation result of the comprehensive gradient strength, indicating the gradient strength at a certain point. It is obtained by calculating the square root of the sum of the squares of the horizontal and vertical gradients, reflecting the edge clarity and texture characteristics of the image.
[0141] Roughness calculation: Gray Level Co-occurrence Matrix (GLCM): Extracts the statistical characteristics of roughness from edge images. GLCM can describe the spatial relationship between pixel gray values, from which multiple texture features can be extracted.
[0142] Contrast: Rough surfaces usually have high contrast, the formula is:
[0143]
[0144] P(i,j): represents the joint probability of a pair of pixels with gray levels i and j in a specific direction and distance in the image. GLCM is used to describe the spatial relationship between pixels and helps extract texture features. i and j: These are grayscale values that represent different brightness values in the image. In contrast calculations, they are used to measure the square of the grayscale difference between pixels.
[0145] Texture analysis: extract specific statistical features (such as average gradient, grayscale variance, etc.) to quantify roughness.
[0146] Surface fluctuation analysis: Use frequency domain analysis techniques (such as Fourier transform) to extract surface periodic fluctuations and further quantify the surface roughness.
[0147] Specific implementation eight: This implementation is a further description of specific implementation seven. The difference between this implementation and specific implementation seven is that the color difference formula is expressed as:
[0148]
[0149] Among them, ΔL, Δa, and Δb are the differences in L, a, and b values in the Lab color space, respectively.
[0150] Specific implementation method 9: This implementation method is a further description of specific implementation method 8. The difference between this implementation method and specific implementation method 8 is that the Lab value of the wood dyed veneer image to be detected is obtained by a colorimeter.
[0151] Specific implementation method 10: This implementation method is a further description of specific implementation method 2. The difference between this implementation method and specific implementation method 2 is that the brightness is expressed as:
[0152] L=0.299R+0.587G+0.114B
[0153] Among them, L is brightness, R is red channel, G is green channel, and B is blue channel.
[0154] Define a sorting criterion,
[0155] L=0.299R+0.587G+0.114B
[0156] The color response values in each cluster are sorted from low to high according to brightness to form orderly color clusters.
[0157] It should be noted that the specific implementation is only an explanation and description of the technical solution of the present invention, and cannot be used to limit the scope of protection of the rights. Any partial changes made according to the claims and description of the present invention should still fall within the scope of protection of the present invention.
Claims
1. An online detection method for wood color difference based on spectral reflectance reconstruction, characterized in that The following steps are involved: Step 1: Obtain the image of the wood dyed veneer to be detected; Step 2: Obtain the color response value, Lab value and roughness of the wood dyed veneer image to be detected, and input the color response value and roughness of the wood dyed veneer image to be detected into a pre-trained spectral reflectance reconstruction model to obtain the output spectral reflectance; Step 3: Input the spectral reflectance output by the spectral reflectance reconstruction model into the pre-trained color difference calculation model to obtain the output Lab value; Step 4: Based on the output Lab value, subtract it from the Lab value of the wood dyed veneer image to be detected, and use the color difference formula to obtain the color difference value.
2. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 1, characterized in that The training process of the pre-trained spectral reflectance reconstruction model is: Step 1: Obtain a training set and extract the color response value, roughness, and spectral reflectance of each wood dyed veneer image in the training set; Step 2: Using the color response value as the clustering feature, cluster all the wood dyed veneer images in the training set to obtain color clusters; Step 3: Sort the color response values in each color cluster from low to high based on brightness to obtain an ordered color cluster; Step 4: Input the color response values and their corresponding spectral reflectances in the ordered color clusters into the dynamic XGBoost model, and dynamically adjust the model parameters according to the roughness corresponding to the color response values to obtain the spectral reflectance reconstruction model.
3. The method for detecting wood color difference based on spectral reflectance reconstruction according to claim 2, characterized in that The step of dynamically adjusting the model parameters according to the roughness corresponding to the color response value in step 4 is: When the roughness is <0.5 μm, the depth of the tree in the model is set to 4-6 and the sampling rate is set to 0.6-0.8 Hz; When 0.5≤roughness<1.5μm, the depth of the tree in the model is set to 6-8 and the sampling rate is set to 0.7-0.9 Hz; When the roughness was ≥1.5 μm, the depth of the tree in the model was set to 8–10 and the sampling rate was set to 0.8–1.0 Hz.
4. The method for detecting wood color difference based on spectral reflectance reconstruction according to claim 3, characterized in that The color response value of each wood dyed veneer image in step 1 is obtained by the following steps: Step 111: obtaining a training set, and performing illumination correction on the wood dyed veneer images in the training set, wherein the illumination correction is performed by white balance correction or based on a standard color card; Step 112: performing filtering processing on the corrected image, wherein the filtering processing is median filtering; Step 113: segmenting the stained part in the filtered image, wherein the segmentation is performed by edge detection algorithm or color threshold segmentation; Step 114: converting the segmented image into Lab color space and extracting the color response value of each pixel to obtain the color response value of the wood dyed veneer image.
5. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 4 is characterized in that The specific steps of step 2 are: Step 21: Define the Euclidean distance formula for color response values: Among them, R1 and R2 represent two points in the RGB color space, R 1,r , R 1,g , R 1,b are the color response values of the red, green, and blue channels of R1, respectively. 2,r , R 2,g , R 2,b are the color response values of the red, green, and blue channels of R2 respectively; Step 22: Cluster the samples in the training set so that samples with similar color response values form multiple clusters, namely color clusters.
6. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 5, characterized in that The roughness is obtained through a gray level co-occurrence matrix.
7. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 5 is characterized in that The roughness is expressed as: Rroughness=w1×Gavg+w2×Contrast Among them, w1 and w2 are weights, I(x,y) is the image, G x and G y are the gradient changes of the image in the horizontal and vertical directions respectively, P(i,j) represents the joint probability of the pixel pair with gray levels i and j in the image, is a partial derivative, which is used to calculate the rate of change of a variable. To represent the rate of change of image I at position (x, y) relative to the x direction, it reflects the gradient of the image in the horizontal direction. It represents the rate of change of image I at position (x, y) relative to the y direction, reflecting the gradient of the image in the vertical direction. Gavg represents the overall gradient intensity. Contrast represents the average gradient intensity of the entire image, which can be obtained by averaging the gradient intensity G of all pixels. It is usually used to judge the overall roughness of the surface.
8. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 7 is characterized in that The color difference formula is expressed as: Among them, ΔL, Δa, and Δb are the differences in L, a, and b values in the Lab color space, respectively.
9. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 8, characterized in that The Lab value of the wood dyed veneer image to be detected is obtained by a colorimeter.
10. The method for online detection of wood color difference based on spectral reflectance reconstruction according to claim 2, characterized in that The brightness is expressed as: L=0.299R+0.587G+0.114B Among them, L is brightness, R is red channel, G is green channel, and B is blue channel.
Citation Information
Cited By
Intelligent detection method and system for color difference of color silk based on image analysis
CN120976567A
A colored yarn color difference intelligent detection method and system based on image analysis
CN120976567B
Pattern color difference identification method and system
CN121120511A
A method and system for identifying color differences in patterns
CN121120511B