Machine vision-based color ring element appearance inspection device and system

By dynamically optimizing the detection light source wavelength and multimodal feature fusion architecture, the problems of static light source parameters and insufficient explicit expression of defect features in the appearance inspection of color ring components are solved, thus achieving efficient and stable appearance inspection of color ring components.

CN120177368BActive Publication Date: 2026-03-06DONGGUAN CHUANGSHI AUTOMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510581607.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2026-03-06
Estimated Expiration
2045-05-07

AI Technical Summary

Technical Problem

Existing machine vision inspection systems suffer from problems such as the inability to dynamically adjust light source parameters, insufficient explicit expression of defect features, and static inspection strategies in the appearance inspection of color ring components. These issues result in low inspection efficiency and poor stability, making it difficult to meet the needs of high-speed automated production lines.

Method used

By integrating the calculation of the primary color wavelength of the color ring element with surface roughness modeling, the wavelength of the detection light source is dynamically optimized. Combined with the surface roughness evaluation factor, the risk index is calculated. A multi-modal feature fusion architecture based on CNN is adopted to achieve multi-dimensional adaptive matching of light source and element characteristics and defect risks.

Benefits of technology

It significantly reduces the false negative rate, improves detection accuracy and efficiency, can dynamically adapt to batch differences, ensures controllable light source cost, and has strong adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120177368B_ABST
    Figure CN120177368B_ABST
Patent Text Reader

Abstract

This invention relates to the field of color ring component inspection, specifically to a machine vision-based color ring component appearance inspection device and system. The machine vision-based color ring component appearance inspection device includes: a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance inspection module. This invention achieves dynamic optimization of the detection light source wavelength by integrating the calculation of the primary color wavelength of the color ring component with surface roughness modeling; simultaneously, it introduces a surface roughness evaluation factor to correct the minimum allowable detection wavelength to avoid high reflectivity interference; this mechanism can dynamically adapt to batch differences, improve the contrast between defects and background, and significantly reduce the false negative rate; based on this, the system calculates a risk index and prioritizes the wavelength with the highest sensitivity to high-risk defects; while ensuring controllable light source costs, it achieves multi-dimensional adaptive matching between the detection wavelength and component characteristics and defect risk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of color ring component inspection, and more specifically to a color ring component appearance inspection device and inspection system based on machine vision. Background Technology

[0002] With the increasing precision requirements of electronic component manufacturing, the detection of appearance defects in color ring components has gradually become a core part of quality control. Manual visual inspection suffers from low efficiency, strong subjectivity, and insufficient stability, making it difficult to meet the needs of high-speed automated production lines. Although existing machine vision inspection systems have achieved partial automation through image processing technology, they still face many technical bottlenecks, which restrict their large-scale application in industrial scenarios.

[0003] Regarding the optimization of light source parameters, most detection systems use light sources with fixed wavelengths or preset ranges, which cannot be dynamically adjusted according to the batch characteristics of color ring components. Due to differences in raw materials or process fluctuations, the surface color and roughness of color ring components from different batches vary significantly. For example, when the main color wavelength shifts, a fixed light source may lead to a decrease in the contrast between the defect area and the background, especially for scratches or micro-bubbles under light-colored coatings, which significantly increases the false negative rate. Existing technologies ignore the influence of surface roughness on the minimum allowable wavelength and have not established a quantitative model for wavelength adjustment, making it difficult to avoid overexposure or shadow interference in highly reflective areas, thus affecting the consistency of imaging quality.

[0004] The explicit representation of defect features is another key challenge. Different defect types respond significantly to different wavelengths of light. Traditional systems rely on a single light source to acquire images, which results in some defect features not being fully highlighted. Existing methods mostly improve contrast through image enhancement algorithms, but they are not combined with optical wavelength characteristics, which can easily lead to noise amplification or loss of detail. Some studies have attempted to use multispectral imaging, but the equipment is expensive and lacks wavelength optimization mechanisms for specific defects. The complexity of data processing limits real-time performance and makes it difficult to meet the production line cycle time requirements.

[0005] The static nature of detection strategies further restricts system adaptability. Most systems employ preset defect priorities or fixed detection procedures, failing to dynamically assess risks based on historical data. For example, when a certain type of defect appears frequently in consecutive batches, existing technologies cannot automatically adjust light source parameters to prioritize enhancing its visible characteristics, resulting in insufficient sensitivity for detecting critical defects. Traditional defect scoring methods do not incorporate dark current correction and reflectivity standardization, making scoring results significantly affected by environmental noise and equipment differences, and exhibiting poor stability when detecting across batches.

[0006] Therefore, in order to address the above problems, this invention proposes a machine vision-based color ring element appearance inspection device and system to achieve high-precision, high-efficiency and highly adaptable appearance inspection. Summary of the Invention

[0007] This invention achieves dynamic optimization of the detection light source wavelength by integrating the calculation of the primary color wavelength of the color ring element with surface roughness modeling. Simultaneously, a surface roughness evaluation factor is introduced to correct the minimum permissible detection wavelength to avoid high reflectivity interference. This mechanism can dynamically adapt to batch differences, improve the contrast between defects and the background, and significantly reduce the false negative rate. Based on this, the system calculates a risk index and prioritizes the wavelength with the highest sensitivity to high-risk defects. Compared with traditional fixed-wavelength schemes, this invention achieves multi-dimensional adaptive matching of the detection wavelength with element characteristics and defect risk while ensuring controllable light source costs.

[0008] A machine vision-based color ring element appearance inspection device is used to inspect the appearance of color ring elements. The device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance inspection module.

[0009] The wavelength range adjustment module is used to randomly select several representative samples of color wheel elements from the current batch of color wheel elements, obtain representative sample images of all representative samples of color wheel elements under a white light reference light source; obtain the average primary color H value and average grayscale standard deviation of all representative sample images, and then adjust the preset initial wavelength range to obtain the available wavelength range of the detection light for the current batch of color wheel elements.

[0010] The significant score calculation module is used to calculate the significant score of each defect type under different wavelength detection illumination.

[0011] The detection wavelength selection module includes a defect type confirmation unit and a detection wavelength confirmation unit. The defect type confirmation unit is used to calculate the risk index of each defect type of the color ring element in the current batch and select the defect type with the highest risk index as the key defect type of the current batch. The detection wavelength confirmation unit is used to select the wavelength with the highest significant score in the available wavelength range of the current batch as the optimal detection wavelength based on the key defect type of the current batch and the significant score of the key defect type under different wavelength detection illumination.

[0012] The appearance inspection module is used to acquire, for any color ring element in the current batch, a reference image of the current color ring element under a white light reference light source and a feature-enhanced image under an optimal detection wavelength light source; the reference image and feature-enhanced image of the current color ring element are used as input to the appearance inspection model, and the defect detection results are output as the probability distribution of each defect type.

[0013] Preferably, in the wavelength range adjustment module, the average primary color H value and average grayscale standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the usable wavelength range for the current batch of color ring element detection illumination. The specific operation is as follows:

[0014] Based on the CIE 1931 chromaticity diagram and HSV color wheel model, a mapping table of color-dominant wavelength range-dominant color H value is obtained;

[0015] Set the initial wavelength range of the light detected by the color ring element to be: ;

[0016] For any representative sample image, convert the RGB pixel values ​​of the current representative sample image to HSV, calculate the histogram of H values ​​in the current representative sample image, and select the H value with the highest frequency as the dominant color H value of the current representative sample image; calculate the average dominant color H value of all representative sample images, and use a mapping table to select the dominant wavelength range corresponding to the average dominant color H value as the band to be shielded. ;

[0017] For any representative sample image, convert the current representative sample image into a grayscale image, calculate the standard deviation of the grayscale image, and map the grayscale standard deviation onto... Within the range, obtain the standardized gray standard deviation. The maximum grayscale standard deviation is preset; the average grayscale standard deviation is obtained by calculating the mean of the standardized grayscale standard deviations of all representative sample images. ;

[0018] Using formula Calculate and obtain the minimum allowable wavelength ;in, express Minimum wavelength limit when approaching 0; This is the decay rate coefficient, used to adjust... Follow The changing curve steepness, The value is obtained through particle swarm optimization algorithm; the minimum allowable wavelength and minimum wavelength limit All values ​​are in nm.

[0019] Based on the band to be shielded and minimum permissible wavelength The available wavelength range for obtaining the detection illumination is: .

[0020] Preferably, in the saliency score calculation module, the saliency score of each defect type under different wavelength detection illumination is calculated, and the specific operation is as follows:

[0021] For any type of defect, obtain several color ring element defect samples of the same material that have that defect type. Each color ring element defect sample is marked with the defect area and the normal area.

[0022] For any defective color ring component sample, turn off all light sources and, while maintaining ambient light blocking, capture a dark current image and obtain the average dark current value of the current image. Calculate the average of the dark current values ​​of all defective color ring component samples to obtain the comprehensive average dark current value. ;

[0023] Turn on the light source to wavelength , Located in the initial wavelength range Within, and spaced 10nm apart; at wavelength The white standard plate was photographed to obtain the wavelength. The corresponding whiteboard image is then used to calculate the wavelength. Mean grayscale value of the whiteboard image below ;

[0024] At wavelength The following image is taken of a defect sample of any color ring element, and the wavelength of the current defect sample of the color ring element is obtained. The corresponding defect sample image is then used to calculate the wavelength. The mean gray value of the normal area in the current defect sample image and the average gray value of the defect area Then use the formula Calculate and obtain the reflectance of the normal area in the current defect sample image. Using formulas Calculate and obtain the reflectance of the defect region in the current defect sample image. ;

[0025] For any type of defect, calculate at wavelength The average reflectance of the normal region in all defect sample images corresponding to the current defect type. and the average reflectivity of the defect area Then calculate and absolute difference ,Will As a current defect type, in wavelength The significant score below.

[0026] Preferably, in the detection wavelength selection module, the risk index of each defect type of the current batch of color ring components is calculated, and the specific operation is as follows:

[0027] Based on the material of the current batch of color wheel components, obtain the most recent data for that material. Number of defects in each batch of color ring components , ,2,…, Using formulas Calculate and obtain the average defect rate ,in, This indicates the quantity of color ring components in a batch; using the formula... Calculate and obtain the first score , This represents the number of defects in the most recent batch of color-coded components.

[0028] against For any one of the batches, record the number of defects in that batch. The specific number of times each defect type is included. , , 2, ..., 5; using the formula Calculation and acquisition The average percentage of each defect type in each batch Using formulas Calculate and obtain the second score for each defect type. ,in, This indicates the specific number of times each defect type occurred in the most recent batch;

[0029] Finally, use the formula Calculate and obtain the risk index for each defect type in the current batch. .

[0030] Preferably, in the appearance detection module, the appearance detection model is based on a CNN model and includes: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer;

[0031] The input layer is used to receive the reference image and feature enhancement image of the current color wheel element;

[0032] The parallel feature extraction layer includes a parallel baseline image branch and a feature enhancement image branch. The baseline image branch is used to extract baseline features from the baseline image and output a baseline feature map; the feature enhancement image branch is used to extract defect response features from the feature enhancement image and output a defect response feature map.

[0033] The global feature fusion layer is used to perform global average pooling on the baseline feature map and the defect response feature map, and then concatenate them along the channel dimension to output the fused feature vector.

[0034] Fully connected layers are used to further extract features from the fused feature vectors and output hidden layer features;

[0035] The output layer is used to output the probability distribution of defect types using the Softmax activation function.

[0036] Preferably, in the appearance inspection module, the specific operations for training the appearance inspection model are as follows:

[0037] Obtain several defect detection training samples with labeled defect detection results. Each defect detection training sample contains a base image and a feature enhancement image of a color ring element.

[0038] All defect detection training samples are divided into training set and validation set. The appearance detection model with initialized parameters is trained using the training set, and then the appearance detection model is validated using the validation set to obtain the validation results. Training conditions are set, and it is determined whether the validation results meet the training conditions. If yes, the trained appearance detection model is output; otherwise, the appearance detection model is trained again using the training set.

[0039] A machine vision-based color wheel component appearance inspection system, the inspection system including the aforementioned machine vision-based color wheel component appearance inspection device.

[0040] The present invention has the following advantages:

[0041] 1. This invention achieves dynamic optimization of the detection light source wavelength by integrating the calculation of the primary color wavelength of the color ring element with surface roughness modeling. Simultaneously, a surface roughness evaluation factor is introduced to correct the minimum allowable detection wavelength to avoid high reflectivity interference. This mechanism can dynamically adapt to batch differences, improve the contrast between defects and the background, and significantly reduce the false negative rate. Based on this, the system calculates a risk index and prioritizes the wavelength with the highest sensitivity to high-risk defects. Compared with traditional fixed-wavelength schemes, this invention achieves multi-dimensional adaptive matching of the detection wavelength with element characteristics and defect risk while ensuring controllable light source costs.

[0042] 2. This invention proposes a multimodal feature fusion architecture based on a dual-branch convolutional neural network, which effectively improves the robustness of complex defect detection. The model extracts spatial-spectral features from the white light reference image and the optimal wavelength feature image through parallel branches. This architecture enables the model to simultaneously utilize the stable semantic information of the reference image and the defect-sensitive features of the wavelength-enhanced image, thereby improving the detection accuracy. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the structure of the color ring element appearance inspection device based on machine vision used in an embodiment of the present invention. Detailed Implementation

[0044] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this invention.

[0045] Example 1: A machine vision-based color ring element appearance inspection device, such as... Figure 1 As shown, the detection device is used to perform appearance inspection on color ring components. The detection device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance inspection module.

[0046] The wavelength range adjustment module is used to randomly select several representative samples of color ring elements from the current batch of color ring elements, obtain representative sample images of all representative samples of color ring elements under a white light reference light source; obtain the average primary color H value and average grayscale standard deviation of all representative sample images, and then adjust the preset initial wavelength range to obtain the usable wavelength range of the detection light for the current batch of color ring elements; the function of this module is to analyze the color characteristics and surface reflectivity of the samples, eliminate wavelengths that are not suitable for detection, optimize the wavelength range of the detection light, and thus improve the accuracy and efficiency of subsequent defect detection;

[0047] The significant score calculation module is used to calculate the significant score of each defect type under different wavelengths of detection light. The function of the significant score calculation module is to quantify the "significance score" of each defect type at a specific wavelength by calculating the difference in reflectivity between the defect area and the normal area under different wavelengths of detection light. The higher the significant score, the more obvious the grayscale difference between the defect area and the normal area is at that wavelength, and the easier it is for the defect to be identified. This module can provide a basis for the selection of subsequent detection wavelengths, ensuring that detection is carried out at the optimal wavelength, thereby improving the accuracy and efficiency of defect detection.

[0048] The detection wavelength selection module includes a defect type confirmation unit and a detection wavelength confirmation unit. The defect type confirmation unit calculates the risk index of each defect type of the color ring components in the current batch and selects the defect type with the highest risk index as the key defect type of the current batch. The detection wavelength confirmation unit selects the wavelength with the highest significant score within the available wavelength range of the current batch as the optimal detection wavelength based on the key defect type of the current batch and the significant score of the key defect type under different wavelength detection illumination. The function of this module is to dynamically optimize the selection of detection wavelengths, ensuring that the detection system can detect the most important defect type in the current batch at the most sensitive wavelength, thereby improving the accuracy and efficiency of detection.

[0049] The appearance inspection module is used to acquire, for any color ring element in the current batch, a reference image of the current color ring element under a white light reference light source and a feature-enhanced image under an optimal detection wavelength light source; the reference image and feature-enhanced image of the current color ring element are used as input to the appearance inspection model, and the defect detection results are output as the probability distribution of each defect type.

[0050] In the wavelength range adjustment module, the average primary color H value and average grayscale standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the available wavelength range for the current batch of color ring element detection illumination. The specific operation is as follows:

[0051] Based on the CIE 1931 chromaticity diagram and the HSV color wheel model, the mapping relationship table between color, dominant wavelength range, and dominant color H value is obtained as follows: This table serves as a practical, empirical reference framework combining the distribution of dominant optical wavelengths with the HSV color model. Currently, there is no universally applicable international standard for the correspondence between color names and parameters. The mapping range between dominant wavelengths and H values ​​primarily stems from statistical analysis of color rendering data for various materials in industrial inspection scenarios and practical engineering summaries, reflecting a phased summary of industry consensus on color classification. For example, the dominant wavelength of red may actually cover 610-750nm (and even as wide as approximately 630-780nm in CIE standard colorimetry), while the definition of H value ranges for the same color differs between Adobe RGB and sRGB color models. Although the parameter range lacks the absolute authority of international standards, it serves as a reliable starting point for developing industrial visual classification algorithms because it adheres to the fundamental theoretical model of color science. In practical applications, a linear offset of ±5% to 10% of the parameters based on variables such as light source color temperature and lens transmittance can adapt to most scenarios.

[0052] Set the initial wavelength range of the light detected by the color ring element to be: ;

[0053] For any representative sample image, convert the RGB pixel values ​​of the current representative sample image to HSV, calculate the histogram of H values ​​in the current representative sample image, and select the H value with the highest frequency as the dominant color H value of the current representative sample image; calculate the average dominant color H value of all representative sample images, and use a mapping table to select the dominant wavelength range corresponding to the average dominant color H value as the band to be shielded. ;

[0054] For any representative sample image, convert the current representative sample image into a grayscale image, calculate the standard deviation of the grayscale image, and map the grayscale standard deviation onto... Within the range, obtain the standardized gray standard deviation. The maximum grayscale standard deviation is preset; the average grayscale standard deviation is obtained by calculating the mean of the standardized grayscale standard deviations of all representative sample images. ;

[0055] Using formula Calculate and obtain the minimum allowable wavelength ;in, express The minimum wavelength limit when it approaches 0 (i.e., the surface roughness of the color ring element is close to that of a mirror) can be set to 620nm; This is the decay rate coefficient, used to adjust... Follow The changing curve steepness, The value is obtained through particle swarm optimization algorithm; the minimum allowable wavelength and minimum wavelength limit All values ​​are in nm.

[0056] Based on the band to be shielded and minimum permissible wavelength The available wavelength range for obtaining the detection illumination is: .

[0057] In the saliency score calculation module, the saliency score of each defect type is calculated under different wavelength detection illumination. The specific operation is as follows:

[0058] For any type of defect, obtain several color ring element defect samples of the same material that have that defect type. Each color ring element defect sample is marked with the defect area and the normal area.

[0059] For any defective color ring component sample, turn off all light sources and, while maintaining ambient light blocking, capture a dark current image and obtain the average dark current value of the current image. Calculate the average of the dark current values ​​of all defective color ring component samples to obtain the comprehensive average dark current value. ;

[0060] Turn on the light source to wavelength , Located in the initial wavelength range Within, and spaced 10nm apart; at wavelength The white standard plate was photographed to obtain the wavelength. The corresponding whiteboard image is then used to calculate the wavelength. Mean grayscale value of the whiteboard image below ;

[0061] At wavelength The following image is taken of a defect sample of any color ring element, and the wavelength of the current defect sample of the color ring element is obtained. The corresponding defect sample image is then used to calculate the wavelength. The mean gray value of the normal area in the current defect sample image and the average gray value of the defect area Then use the formula Calculate and obtain the reflectance of the normal area in the current defect sample image. Using formulas Calculate and obtain the reflectance of the defect region in the current defect sample image. ;

[0062] For any type of defect, calculate at wavelength The average reflectance of the normal region in all defect sample images corresponding to the current defect type. and the average reflectivity of the defect area Then calculate and absolute difference ,Will As a current defect type, in wavelength The significant score below.

[0063] In the detection wavelength selection module, the risk index of each defect type of the current batch of color ring components is calculated. The specific operation is as follows:

[0064] Based on the material of the current batch of color wheel components, obtain the most recent data for that material. Number of defects in each batch of color ring components , ,2,…, Using formulas Calculate and obtain the average defect rate ,in, This indicates the quantity of color ring components in a batch; using the formula... Calculate and obtain the first score , The number of defects in the most recent batch of color-coded components; first rating. That is, the defect rate of the most recent batch and Average defect rate per batch The ratio;

[0065] against For any one of the batches, record the number of defects in that batch. The specific number of times each defect type is included. , , 2, ..., 5; using the formula Calculation and acquisition The average percentage of each defect type in each batch Using formulas Calculate and obtain the second score for each defect type. ,in, Indicates the specific number of times each defect type occurred in the most recent batch; Second score That is, the proportion of each defect type in the most recent batch and The average percentage of each defect type in each batch The ratio;

[0066] Finally, use the formula Calculate and obtain the risk index for each defect type in the current batch. .

[0067] In the appearance detection module, the appearance detection model is based on a CNN model and includes: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer.

[0068] The input layer is used to receive the reference image and feature enhancement image of the current color wheel element;

[0069] The parallel feature extraction layer includes a parallel baseline image branch and a feature enhancement image branch. The baseline image branch is used to extract baseline features from the baseline image and output a baseline feature map; the feature enhancement image branch is used to extract defect response features from the feature enhancement image and output a defect response feature map.

[0070] The global feature fusion layer is used to perform global average pooling on the baseline feature map and the defect response feature map, and then concatenate them along the channel dimension to output the fused feature vector.

[0071] Fully connected layers are used to further extract features from the fused feature vectors and output hidden layer features;

[0072] The output layer is used to output the probability distribution of defect types using the Softmax activation function.

[0073] In the appearance detection module, the specific operations for training the appearance detection model are as follows:

[0074] Obtain several defect detection training samples with labeled defect detection results. Each defect detection training sample contains a base image and a feature enhancement image of a color ring element.

[0075] All defect detection training samples are divided into training set and validation set. The appearance detection model with initialized parameters is trained using the training set, and then the appearance detection model is validated using the validation set to obtain the validation results. Training conditions are set, and it is determined whether the validation results meet the training conditions. If yes, the trained appearance detection model is output; otherwise, the appearance detection model is trained again using the training set.

[0076] Example 2: A machine vision-based color ring component appearance inspection system, wherein the inspection system includes the aforementioned machine vision-based color ring component appearance inspection device.

[0077] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Parts not described in detail in this specification are prior art known to those skilled in the art.

Claims

1. A color ring element appearance inspection apparatus based on machine vision, characterized by, The detection device is used for appearance detection of the color ring element, and comprises a wavelength range adjusting module, a saliency score calculating module, a detection wavelength selecting module and an appearance detection module. The wavelength range adjusting module is used for randomly selecting a plurality of color ring element representative samples from the current batch of color ring elements, and acquiring representative sample images of all the color ring element representative samples under a white light reference light source. The average dominant color H value and the average gray scale standard deviation of all the representative sample images are acquired, and then the initial wavelength range is adjusted to acquire the available wavelength range of the detection light for the current batch of color ring elements. The saliency score calculating module is used for calculating the saliency scores of each defect type under different wavelength detection light. The detection wavelength selecting module comprises a defect type confirming unit and a detection wavelength confirming unit. The defect type confirming unit is used for calculating the risk indexes of each defect type of the current batch of color ring elements, and selecting the defect type with the largest risk index as the key defect type of the current batch. The detection wavelength confirming unit is used for selecting the wavelength with the highest saliency score in the available wavelength range of the current batch as the best detection wavelength through the key defect type of the current batch and the saliency scores of the key defect type under different wavelength detection light.

2. The machine vision-based color ring element appearance detection apparatus according to claim 1, characterized in that, The appearance detection module is used for acquiring a reference image and a feature enhanced image of each color ring element in the current batch under the white light reference light source and the best detection wavelength light source respectively. In the wavelength range adjusting module, the average dominant color H value and the average gray scale standard deviation of all the representative sample images are acquired, and then the initial wavelength range is adjusted to acquire the available wavelength range of the detection light for the current batch of color ring elements. The initial wavelength range of the color ring element detection light is set to ; Based on the CIE 1931 chromaticity diagram and the HSV hue ring model, a mapping relationship table of color-dominant wavelength range-dominant color H value is acquired. Calculate all representative sample image average H value of the main color, and through the mapping relationship table, the main wavelength range corresponding to the average H value of the main color is taken as the shielding wave band ; For any one representative sample image, the current representative sample image is converted into a gray image, a gray standard deviation of the gray image is calculated, and the gray standard deviation is mapped in the range of 0 to 1 to obtain a normalized gray standard deviation. The normalized gray standard deviation is a preset maximum gray standard deviation. The normalized gray standard deviation is a preset maximum gray standard deviation. calculating the average of all normalized gray scale standard deviations representing the sample images, obtaining the average gray scale standard deviation ; Using formula Calculate and obtain the minimum allowable wavelength ;in, express Minimum wavelength limit when approaching 0; This is the decay rate coefficient, used to adjust... Follow The changing curve steepness, The value is obtained through particle swarm optimization algorithm; the minimum allowable wavelength and minimum wavelength limit The values ​​are all in As a unit; based on the waveband to be shielded and the minimum allowed wavelength , the available wavelength range for the detection light is .

3. The machine vision-based color ring element appearance detection apparatus according to claim 2, characterized in that, For any representative sample image, the RGB pixel value of the current representative sample image is converted into HSV, the histogram of the H value in the current representative sample image is counted, and the H value with the highest frequency is selected as the dominant color H value of the current representative sample image. In the saliency score calculating module, the saliency scores of each defect type under different wavelength detection light are calculated. For any one color ring element defect sample, turn off all light sources, and under the condition of keeping the environment light shielding, shoot the dark current image, and obtain the dark current mean value of the current dark current image; calculate the average value of the dark current mean value of all color ring element defect samples, and obtain the comprehensive dark current mean value ; Turning on the light source to the wavelength , Located in the initial wavelength range , and the interval is 10nm; at the wavelength , the white standard plate is shot, and the white plate image corresponding to the wavelength is obtained, and then the white plate image gray mean value at the wavelength is calculated ; At wavelength The current color ring element defect sample is photographed to obtain the corresponding defect sample image at wavelength At wavelength The normal area gray mean value of the current defect sample image is calculated And the defect area gray mean value ; Then the formula is used to calculate the reflectivity of the normal area of the current defect sample image ; The formula is used to calculate the reflectivity of the defect area of the current defect sample image ; For any one defect type, the average reflectivity of normal regions of all defect sample images corresponding to the current defect type at wavelength and the average reflectivity of defect regions are calculated , and then the absolute difference between is calculated , and is taken as the saliency score of the current defect type at wavelength .

4. The machine vision-based color ring element appearance detection apparatus according to claim 3, characterized in that, For any defect type, a plurality of color ring element defect samples of the same material with the defect type are acquired, and each color ring element defect sample is labeled with a defect area and a normal area. Based on the material of the color ring element of the current batch, the number of defects of the color ring element of the last batch of the material is obtained respectively , ;​ The average defect rate is calculated using the formula The average defect rate is calculated using the formula wherein represents the number of color ring elements in a batch; the first score is calculated using the formula The average defect rate is calculated using the formula , is the number of defects of the color ring elements in the last batch; against For any one of the batches, record the number of defects in that batch. The specific number of times each defect type is included. , 2, ..., 5; using the formula Calculation and acquisition The average percentage of each defect type in each batch Using formulas Calculate and obtain the second score for each defect type. ,in, This indicates the specific number of times each defect type occurred in the most recent batch; Finally, the risk index of each defect type in the current batch is calculated by using the formula .​ 5. The machine vision-based color ring element appearance detection apparatus according to claim 4, characterized in that, In the detection wavelength selecting module, the risk indexes of each defect type of the current batch of color ring elements are calculated. In the appearance detection module, the appearance detection model is established based on a CNN model, and comprises an input layer, a parallel feature extraction layer, a global feature fusion layer, a full connection layer and an output layer. The input layer is used for receiving the reference image and the feature enhanced image of the current color ring element. The parallel feature extraction layer includes a parallel reference image branch and a feature enhanced image branch, the reference image branch is used for extracting reference features from the reference image and outputting a reference feature map, and the feature enhanced image branch is used for extracting defect response features from the feature enhanced image and outputting a defect response feature map; The global feature fusion layer is used for performing global average pooling on the reference feature map and the defect response feature map, and then concatenating along the channel dimension to output a fusion feature vector; The full connection layer is used for further extracting features of the fusion feature vector to output a hidden layer feature; The output layer is used for outputting a defect type probability distribution by using a Softmax activation function.

6. The machine vision-based color ring element appearance detection apparatus according to claim 5, wherein, In the appearance detection module, for training of the appearance detection model, the following specific operations are performed: A plurality of defect detection training samples with labeled defect detection results are obtained, each of the defect detection training samples including a reference image and a feature enhanced image of a color ring element; All the defect detection training samples are divided into a training set and a validation set, the appearance detection model initialized by the training set is trained, then the appearance detection model is verified by the validation set to obtain a verification result; A training condition is set, whether the verification result meets the training condition is determined, if yes, the trained appearance detection model is output, and if no, the appearance detection model is continuously trained by using the training set.

7. A machine vision based color ring element appearance detection system characterized by, The detection system includes the machine vision-based color ring element appearance detection device according to any one of claims 1-6.

Citation Information

Patent Citations

  • Ceramic defect detection system based on machine vision

    CN118671312A

  • Nondestructive testing method for internal defects of rubber plate based on light transmission detection

    CN119438225A