Color ring element appearance detection device and detection system based on machine vision

By dynamically optimizing the detection of light source wavelength and correcting the minimum allowable wavelength, combined with risk index calculation, the technical bottlenecks of the existing color ring element detection system in the optimization of light source parameters and the explicit expression of defect characteristics are solved, and efficient and accurate detection results are achieved.

CN120177368AActive Publication Date: 2025-06-20DONGGUAN CHUANGSHI AUTOMATION TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing color ring element detection system has technical bottlenecks in the optimization of light source parameters and the explicit expression of defect characteristics, resulting in low detection efficiency, high missed detection rate and difficulty in adapting to batch differences.

Method used

By fusion color ring element main color wavelength calculation and surface roughness modeling, the detection light source wavelength is dynamically optimized, and the surface roughness evaluation factor is introduced to correct the minimum allowable wavelength to improve the contrast between defects and background. At the same time, the risk index is calculated to prioritize wavelengths that are sensitive to high-risk defects.

Benefits of technology

A multi-dimensional adaptive matching of detection wavelengths with component characteristics and defect risks is achieved, which significantly reduces the leakage detection rate and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120177368A_ABST
    Figure CN120177368A_ABST
Patent Text Reader

Abstract

The invention relates to the field of color ring element detection, in particular to a color ring element appearance detection device and system based on machine vision. The color ring element appearance detection device based on machine vision comprises a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module and an appearance detection module. According to the invention, the dynamic optimization of the wavelength of the detection light source is realized by fusing the calculation of the main color wavelength of the color ring element and the modeling of the surface roughness; meanwhile, a surface roughness evaluation factor is introduced, and the minimum allowable detection wavelength is corrected to avoid high-reflection interference; the mechanism can dynamically adapt to batch differences, improve the contrast ratio of defects and backgrounds, and significantly reduce the omission ratio; on the basis, the system calculates a risk index, and preferentially selects the wavelength with the highest sensitivity to the high-risk defect; on the premise that the cost of the light source is controllable, the multi-dimensional self-adaptive matching of the detection wavelength, the element characteristics and the defect risk is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of color ring component detection, and particularly to an appearance detection device and a detection system for color ring components based on machine vision. Background Art

[0002] With the improvement of the manufacturing precision requirements for electronic components, the appearance defect detection of color ring components has gradually become the core link of quality control; manual visual inspection has problems such as low efficiency, strong subjectivity, and insufficient stability, and it is difficult to meet the requirements of high-speed automated production lines; although existing machine vision detection systems achieve partial automation through image processing technology, they still face many technical bottlenecks, restricting their large-scale application in industrial scenarios.

[0003] In terms of light source parameter optimization, most detection systems use light sources with fixed wavelengths or preset ranges, and cannot dynamically adjust according to the batch characteristics of color ring components; due to raw material differences or process fluctuations in different batches of color ring components, there are significant changes in their surface color and roughness; for example, when the main color wavelength shifts, a fixed light source may cause the contrast between the defect area and the background to decrease, especially for scratches or microbubbles under light-colored coatings, and the miss rate increases significantly; existing technologies ignore the influence of surface roughness on the minimum allowable wavelength and do not establish a quantitative model for wavelength adjustment, making it difficult to avoid overexposure or shadow interference in high-reflectivity areas, affecting the consistency of imaging quality.

[0004] The explicit expression of defect features is another key challenge. Different defect types have significant differences in their responses to light wavelengths. Traditional systems rely on a single light source to collect images, resulting in insufficient highlighting of some defect features; existing methods mostly use image enhancement algorithms to improve contrast, but they are not combined with the optical wavelength characteristics, easily leading to noise amplification or detail loss; some studies have tried to use multispectral imaging, but the equipment cost is high and there is a lack of a wavelength optimization mechanism for specific defects, and the complexity of data processing limits the real-time performance, making it difficult to meet the production line beat requirements.

[0005] The static nature of the detection strategy further restricts the system adaptability. Most systems use preset defect priorities or fixed detection processes and fail to dynamically evaluate risks by combining historical data; for example, when a certain type of defect appears frequently in consecutive batches, existing technologies cannot automatically adjust the light source parameters to preferentially enhance its explicit features, resulting in insufficient sensitivity for detecting key defects. Traditional defect scoring methods do not incorporate dark current correction and reflectivity normalization, and the scoring results are significantly affected by environmental noise and equipment differences, and the stability is poor during cross-batch detection.

[0006] Therefore, in view of the above problems, the present invention proposes an appearance detection device and a detection system for color ring components based on machine vision, realizing high-precision, high-efficiency, and strong adaptability appearance detection. Summary of the Invention

[0007] By integrating the calculation of the dominant wavelength of the color ring element and the surface roughness modeling, the present invention realizes the dynamic optimization of the detection light source wavelength. At the same time, the 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 missed detection rate. On this basis, the system calculates the risk index and preferentially selects the wavelength with the highest sensitivity to high-risk defects. Compared with the traditional fixed-wavelength scheme, the present invention realizes the multi-dimensional adaptive matching of the detection wavelength with the component characteristics and defect risks on the premise of controllable light source cost.

[0008] An appearance detection device for color ring components based on machine vision, the detection device is used for appearance detection of color ring components, and the detection device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module and an appearance detection module; The wavelength range adjustment module is used to randomly select several representative samples of color ring components from the current batch of color ring components, and obtain the representative sample images of all the representative samples of color ring components under the white light reference light source; obtain the average dominant color H value and the average gray standard deviation of all the representative sample images, and then adjust the preset initial wavelength range to obtain the available wavelength range of the detection illumination of the current batch of color ring components; The significant score calculation module is used to calculate the significant scores of each defect type under different wavelength detection illuminations; 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 current batch of color ring components, and select the defect type with the largest risk index as the key concern defect type of the current batch; the detection wavelength confirmation unit is used to use the key concern defect type of the current batch and the significant scores of this key concern type under different wavelength detection illuminations, and take the wavelength with the highest significant score within the available wavelength range of the current batch as the best detection wavelength; The appearance detection module is used to collect the reference image of any color ring component of the current batch under the white light reference light source and the feature enhancement image under the best detection wavelength light source respectively; use the reference image and the feature enhancement image of the current color ring component as the input of the appearance detection model, and output the defect detection result, and the defect detection result is the probability distribution of each defect type.

[0009] Preferably, in the wavelength range adjustment module, to obtain the average dominant color H value and the average gray standard deviation of all the representative sample images, and then adjust the preset initial wavelength range to obtain the available wavelength range of the detection illumination of the current batch of color ring components, the specific operation is as follows: Based on the CIE 1931 chromaticity diagram and the HSV hue circle model, obtain the mapping relationship table of color - dominant wavelength range - dominant color H value; Set the initial wavelength range for the color ring component to detect light as ; For any representative sample image, convert the RGB pixel values of the current representative sample image to HSV, statistically analyze the histogram of H values in the current representative sample image, and select the H value with the highest occurrence 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 through the mapping relationship table, use the dominant wavelength range corresponding to the average dominant color H value as the band to be blocked ; For any representative sample image, convert the current representative sample image into a grayscale image, calculate the grayscale standard deviation of the grayscale image, and map the grayscale standard deviation within the range of to obtain the normalized grayscale standard deviation, where is the preset maximum grayscale standard deviation; calculate the average value of the normalized grayscale standard deviations of all representative sample images to obtain the average grayscale standard deviation ; Use the formula to calculate and obtain the minimum allowable wavelength ; where represents the minimum wavelength limit when approaches 0; is the attenuation rate coefficient, used to adjust the steepness of the curve as changes, and the value of is obtained through the particle swarm optimization algorithm; Based on the band to be blocked and the minimum allowable wavelength , obtain the available wavelength range for detecting light as .

[0010] Preferably, in the significant score calculation module, calculate the significant scores of each defect type under different wavelength detection lights, and the specific operations are as follows: For any one defect type, obtain several color ring component defect samples of the same material with this defect type, and each color ring component defect sample is marked with the defect area and the normal area; For any one color ring component defect sample, turn off all light sources, and under the condition of keeping the environment light - shielded, take a 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 values of all color ring component defect samples to obtain the comprehensive dark current mean value ; Turn on the light source to wavelength , Located within the initial wavelength range with an interval of 10 nm; photograph the white standard plate at wavelength to obtain the white plate image corresponding to the wavelength , and then calculate the average gray value of the white plate image at wavelength ; Photograph any defective sample of the color ring component at wavelength to obtain the defective sample image corresponding to the current defective sample of the color ring component at wavelength , and then calculate the average gray value of the normal area of the current defective sample image at wavelength and the average gray value of the defective area; subsequently, use the formula to calculate and obtain the reflectance of the normal area of the current defective sample image; use the formula to calculate and obtain the reflectance of the defective area of the current defective sample image; For any type of defect, calculate the average reflectance of the normal areas of all defective sample images corresponding to the current defect type at wavelength and the average reflectance of the defective areas, and then calculate the absolute difference , and take as the significant score of the current defect type at wavelength .

[0011] Preferably, in the detection wavelength selection module, calculate the risk index of each defect type of the current batch of color ring components, and the specific operation is as follows: Based on the material of the current batch of color ring components, respectively obtain the defect quantities of the color ring components in the nearest batches of the same material ; use the formula to calculate and obtain the average defect rate , where represents the number of color ring components in a batch; use the formula to calculate and obtain the first score which is the defect quantity of the color ring components in the nearest 1 batch; For any one of the batches, record the specific times of each defect type in the defect quantity of this batch; use the formula The average proportion of each defect type in each batch ; Using the formula Calculate and obtain the second score of each defect type , where represents the specific number of times of each defect type in the most recent 1 batch; Finally, use the formula Calculate and obtain the risk index of each defect type in the current batch .

[0012] Preferably, in the appearance detection module, the appearance detection model is established based on the CNN model, including: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer; The input layer is used to receive the reference image and the feature enhancement image of the current color ring component; The parallel feature extraction layer includes a parallel reference image branch and a feature enhancement image branch. The reference image branch is used to extract reference features from the reference image and output a reference 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; The global feature fusion layer is used to perform global average pooling on the reference feature map and the defect response feature map, and then splice them along the channel dimension to output a fused feature vector; The fully connected layer is used to further extract features from the fused feature vector and output hidden layer features; The output layer is used to output the probability distribution of defect types by using the Softmax activation function.

[0013] Preferably, in the appearance detection module, for the training of the appearance detection model, the specific operations are as follows: Obtain a number of defect detection training samples with labeled defect detection results. Each defect detection training sample contains a reference image and a feature enhancement image of a color ring component; Divide all defect detection training samples into a training set and a validation set. Use the training set to train the appearance detection model with initialized parameters, and then verify the appearance detection model through the validation set to obtain a verification result; set training conditions, and determine whether the verification result meets the training conditions. If so, output the trained appearance detection model; if not, continue to train the appearance detection model using the training set.

[0014] A color ring component appearance detection system based on machine vision, the detection system includes the above-mentioned color ring component appearance detection device based on machine vision.

[0015] The present invention has the following advantages: 1. By integrating the calculation of the dominant wavelength of the color ring component and the surface roughness modeling, the present invention realizes the dynamic optimization of the detection light source wavelength. At the same time, 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 missed detection rate. On this basis, the system calculates the risk index and preferentially selects the wavelength with the highest sensitivity to high-risk defects. Compared with the traditional fixed-wavelength scheme, the present invention realizes the multi-dimensional adaptive matching of the detection wavelength with the component characteristics and defect risks on the premise of controllable light source cost.

[0016] 2. The present invention proposes a multi-modal feature fusion architecture based on a dual-branch convolutional neural network, which effectively improves the detection robustness of complex defects. This model extracts the spatial-spectral features of the white-light reference image and the optimal wavelength feature image through parallel branches respectively. 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic structural diagram of an appearance detection device for color ring components based on machine vision adopted in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0019] Embodiment 1, an appearance detection device for color ring components based on machine vision, as Figure 1 shown, the detection device is used for appearance detection of color ring components, and the detection device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance detection module; The wavelength range adjustment module is used to randomly select several color ring component representative samples from the current batch of color ring components, and obtain the representative sample images of all color ring component representative samples under the white-light reference light source; obtain the average dominant H value and the average gray standard deviation of all representative sample images, and then adjust the preset initial wavelength range to obtain the available wavelength range of the detection illumination for the current batch of color ring components. The function of this module is to optimize the wavelength range of the detection illumination by analyzing the color characteristics and surface reflection characteristics of the samples, excluding wavelengths that are not suitable for detection, so as to improve the accuracy and efficiency of subsequent defect detection; The significant score calculation module is used to calculate the significant scores of each defect type under different wavelengths of detection light. The function of the significant score calculation module is to calculate the reflectance difference between the defect area and the normal area for each defect type under different wavelengths of detection light, and quantify the "significant score" of the defect type at a specific wavelength. The higher the significant score, the more obvious the gray difference between the defect area and the normal area at that wavelength, and the easier the defect is to be identified. This module can provide a basis for the selection of subsequent detection wavelengths, ensure detection at the optimal wavelength, and thus improve the accuracy and efficiency of defect detection. 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 current batch of color ring components, and select the defect type with the largest risk index as the key defect type to be focused on in the current batch. The detection wavelength confirmation unit is used to take the key defect type of the current batch and the significant scores of this key type under different wavelengths of detection light, and take the wavelength with the highest significant score within the available wavelength range of the current batch as the optimal detection wavelength. The function of this module is to dynamically optimize the selection of detection wavelengths, ensure that the detection system can detect the most important defect type in the current batch at the most sensitive wavelength, and thus improve the accuracy and efficiency of detection.

[0020] The appearance detection module is used to collect the reference image of the current color ring component under the white light reference light source and the feature enhanced image under the optimal detection wavelength light source for any color ring component in the current batch. The reference image and the feature enhanced image of the current color ring component are used as the input of the appearance detection model, and the defect detection result is output. The defect detection result is the probability distribution of each defect type.

[0021] In the wavelength range adjustment module, the average main color H value and the average gray standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the available wavelength range of the detection light for the current batch of color ring components. The specific operations are as follows: Based on the CIE 1931 chromaticity diagram and the HSV hue ring model, the mapping relationship table of color - dominant wavelength range - main color H value is obtained as follows: This table is a practical empirical reference framework that combines the distribution of optical dominant wavelengths with the HSV color model. There is currently no universally applicable international unified standard for the correspondence between color names and parameters. The mapping range of dominant wavelengths and H values ​​is mainly derived from the color rendering data statistics and practical engineering summary of various types of materials in industrial detection scenarios, reflecting the industry's periodic summary of the consensus on color classification. For example, the dominant wavelength of red may actually cover 610-750nm (even as wide as about 630-780nm in CIE standard colorimetry), and the H value range of similar colors is also defined differently in the Adobe RGB and sRGB color models. Although the parameter range does not have the absolute authority of international standards, it can be used as a reliable technical starting point for developing industrial visual classification algorithms because it follows the basic theoretical model of color science. In practical applications, a linear shift of ±5%~10% of the parameters based on variables such as light source color temperature and lens transmittance can adapt to most scenarios. Set the initial wavelength range of the color ring element to detect light. ; For any representative sample image, convert the RGB pixel value of the current representative sample image into HSV, count the histogram of the H value in the current representative sample image, and select the H value with the highest frequency as the main color H value of the current representative sample image; calculate the average main color H value of all representative sample images, and use the mapping relationship table to take the main wavelength range corresponding to the average main color H value as the band to be shielded ; For any representative sample image, convert the current representative sample image into a grayscale image, calculate the grayscale standard deviation of the grayscale image, and map the grayscale standard deviation to In the range of , get the standardized grayscale standard deviation, is the preset maximum grayscale standard deviation; calculate the average of the standardized grayscale standard deviations of all representative sample images to obtain the average grayscale standard deviation ; Using the formula Calculate the minimum allowable wavelength ;in, express When it approaches 0 (i.e. the roughness of the color ring element surface is close to that of a mirror), the minimum wavelength limit can be set to 620nm; is the attenuation rate coefficient, used to adjust Follow The steepness of the changing curve, The value of is obtained through the particle swarm optimization algorithm; Based on the band to be shielded and the minimum permissible wavelength , the available wavelength range for obtaining detection light is .

[0022] In the significant score calculation module, calculate the significant scores of each defect type under different wavelength detection illuminations. The specific operations are as follows: For any one defect type, obtain a number of defective samples of color ring components made of the same material with this defect type. Each defective sample of color ring component is marked with the defective area and the normal area. For any one defective sample of color ring component, turn off all light sources, and under the condition of keeping the environment light-shielded, take a dark current image, and obtain the average dark current of the current dark current image; calculate the average value of the average dark currents of all defective samples of color ring components to obtain the comprehensive average dark current. ; Turn on the light source to wavelength , within the initial wavelength range , and the interval is 10 nm; take a picture of the white standard plate at wavelength , obtain the white board image corresponding to wavelength , and then calculate the gray-scale average value of the white board image at wavelength ; ; Take a picture of any one defective sample of color ring component at wavelength , obtain the defective sample image corresponding to the current defective sample of color ring component at wavelength , and then calculate the gray-scale average value of the normal area of the current defective sample image at wavelength and the gray-scale average value of the defective area ; Subsequently, use the formula to calculate and obtain the reflectivity of the normal area of the current defective sample image; use the formula to calculate and obtain the reflectivity of the defective area of the current defective sample image; ; For any one defect type, calculate the average reflectivity of the normal areas of all defective sample images corresponding to the current defect type at wavelength and the average reflectivity of the defective areas, and then calculate the absolute difference , and take as the significant score of the current defect type at wavelength .

[0023] In the detection wavelength selection module, calculate the risk index of each defect type of the current batch of color ring components. The specific operations are as follows: Based on the material of the current batch of color ring components, respectively obtain the most recent The number of defects in batches of color ring components , ; Calculate and obtain the average defect rate using the formula , where represents the number of color ring components in a batch; Calculate and obtain the first score using the formula is the number of defects in the most recent 1 batch of color ring components; The first score is the ratio of the defect rate in the most recent 1 batch to the average defect rate of batches; For any one of the batches, record the specific number of times of each defect type in the number of defects in this batch ; Calculate and obtain the average proportion of each defect type in the batches using the formula ; Calculate and obtain the second score of each defect type using the formula , where represents the specific number of times of each defect type in the most recent 1 batch; The second score is the ratio of the proportion of each defect type in the most recent 1 batch to the average proportion of each defect type in the batches; Finally, calculate and obtain the risk index of each defect type in the current batch using the formula .

[0024] In the appearance detection module, the appearance detection model is established based on the CNN model, including: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer; The input layer is used to receive the reference image and the feature enhanced image of the current color ring component; The parallel feature extraction layer includes parallel reference image branches and feature enhanced image branches. The reference image branch is used to extract reference features from the reference image and output a reference feature map; The feature enhanced image branch is used to extract defect response features from the feature enhanced image and output a defect response feature map; The global feature fusion layer is used to perform global average pooling on the reference feature map and the defect response feature map, and then splice them along the channel dimension to output a fused feature vector; The fully connected layer is used to further extract features from the fused feature vector and output hidden layer features; The output layer is used to output the probability distribution of defect types using the Softmax activation function.​​​​

[0025] In the appearance detection module, for the training of the appearance detection model, the specific operations are as follows: Obtain a number of defect detection training samples with labeled defect detection results. Each defect detection training sample contains a reference image and a feature-enhanced image of a color ring component; Divide all defect detection training samples into a training set and a validation set. Use the training set to train the appearance detection model with initialized parameters, and then use the validation set to verify the appearance detection model to obtain a verification result. Set training conditions and determine whether the verification result meets the training conditions. If so, output the trained appearance detection model; if not, continue to train the appearance detection model using the training set.

[0026] Example 2, a color ring component appearance detection system based on machine vision. The detection system includes the above-mentioned color ring component appearance detection device based on machine vision.

[0027] It should be understood that for those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention. The parts not described in detail in this specification belong to the prior art well-known to those skilled in the art.

Claims

1. A color ring component appearance detection device based on machine vision, characterized in that: The detection device is used to perform appearance detection on the color ring element, and the detection device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module and an appearance detection module; The wavelength range adjustment module is used to randomly select a number of representative samples of color ring elements from the current batch of color ring elements, and obtain representative sample images of all representative samples of color ring elements under a white light reference light source; The average main color H value and the 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 of the detection light of the current batch of color ring components; The significant score calculation module is used to calculate the significant score of each defect type under different wavelength detection light; 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 current batch of color ring components, and select the defect type with the largest risk index as the key defect type of the current batch; The detection wavelength confirmation unit is used to use the key defect type of the current batch and the significance score of the key defect type under different wavelength detection illumination to select the wavelength with the highest significance score within the available wavelength range of the current batch as the optimal detection wavelength; The appearance inspection module is used to collect, for any color ring component in the current batch, a reference image of the current color ring component under a white light reference light source and a feature enhanced image under a light source with an optimal detection wavelength; use the reference image and feature enhanced image of the current color ring component as inputs of an appearance inspection model, and output defect detection results, which are probability distributions of various defect types.

2. The color ring component appearance detection device based on machine vision according to claim 1, characterized in that: In the wavelength range adjustment module, the average main color H value and the 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 of the current batch of color ring components for detection illumination. The specific operations are as follows: Based on the CIE 1931 chromaticity diagram and the HSV color wheel model, obtain the mapping relationship table of color-dominant wavelength range-dominant color H value; Set the initial wavelength range of the color ring element to detect light. ; For any representative sample image, convert the RGB pixel value of the current representative sample image into HSV, calculate the histogram of the H value in the current representative sample image, and select the H value with the highest frequency as the main color H value of the current representative sample image; Calculate the average main color H value of all representative sample images, and use the mapping table to set the main wavelength range corresponding to the average main color H value as the band to be shielded ; For any representative sample image, convert the current representative sample image into a grayscale image, calculate the grayscale standard deviation of the grayscale image, and map the grayscale standard deviation to In the range of , get the standardized grayscale standard deviation, is the preset maximum grayscale standard deviation; Calculate the average of the standardized grayscale standard deviations of all representative sample images to obtain the average grayscale standard deviation ; Using the formula Calculate the minimum allowable wavelength ;in, express The minimum wavelength limit when it approaches 0; is the attenuation rate coefficient, used to adjust Follow The steepness of the changing curve, The value of is obtained through the particle swarm optimization algorithm; Based on the band to be shielded and the minimum permissible wavelength , the available wavelength range for obtaining detection light is .

3. The color ring component appearance detection device based on machine vision according to claim 2, characterized in that: In the significant score calculation module, the significant scores of each defect type under different wavelengths of detection light are calculated. The specific operations are as follows: For any defect type, obtain several color ring component defect samples of the same material with the defect type, and each color ring component defect sample is marked with a defect area and a normal area; For any color ring component defect sample, turn off all light sources, and take a dark current image while maintaining ambient light shielding, and obtain the dark current mean value of the current dark current image; calculate the average of the dark current mean values ​​of all color ring component defect samples to obtain the comprehensive dark current mean value. ; Turn on the light source to the wavelength , In the initial wavelength range within, and the interval is 10nm; at wavelength Take a photo of the white standard plate and obtain the wavelength The corresponding whiteboard image is then calculated at wavelength The grayscale mean of the whiteboard image under ; In wavelength Take a picture of any color ring component defect sample and obtain the wavelength of the current color ring component defect sample. The corresponding defect sample image is then calculated at wavelength The grayscale mean of the normal area of ​​the current defect sample image and the mean grayscale value of the defect area ; Then use the formula Calculate and obtain the reflectivity of the normal area of ​​the current defect sample image ; Using the formula Calculate and obtain the reflectivity of the defect area of ​​the current defect sample image ; For any defect type, calculate the wavelength The average reflectivity of the normal area of ​​all defect sample images corresponding to the current defect type and the average reflectivity of the defect area , then calculate The absolute difference ,Will As the current defect type at wavelength Significant rating below.

4. The color ring component appearance detection device based on machine vision according to claim 3, characterized in that: In the detection wavelength selection module, calculate the risk index of each defect type of the current batch of color ring components. The specific operations are as follows: Based on the material of the current batch of color ring components, obtain the most recent The number of defects in the color ring components of a batch , ; Using the formula Calculate the average defect rate ,in, Indicates the number of color ring components in a batch; using the formula Calculate and obtain the first score , is the number of defects in the most recent batch of color ring components; against Any batch among the batches, record the number of defects in this batch The specific number of each defect type in ,; Using the formula Calculation acquisition The average proportion of each defect type in batches ; Using the formula Calculate the second score for each defect type ,in, Indicates the specific number of each defect type in the most recent batch; Finally, using the formula Calculate and obtain the risk index of each defect type in the current batch .

5. The color ring component appearance detection device based on machine vision according to claim 4, characterized in that: In the appearance detection module, the appearance detection model is established based on the CNN model, including: input layer, parallel feature extraction layer, global feature fusion layer, fully connected layer and output layer; The input layer is used to receive the reference image and 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 to extract reference features from the reference image and output a reference feature map. The feature enhanced image branch is used to extract defect response features from the feature enhanced image and output a defect response feature map. 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 a fused feature vector; The fully connected layer is used to further extract features from the fused feature vector and output the hidden layer features; The output layer is used to output the probability distribution of defect types using the Softmax activation function.

6. The color ring component appearance detection device based on machine vision according to claim 5, characterized in that: In the appearance detection module, the specific operations for training the appearance detection model are as follows: Obtain a number of defect detection training samples with labeled defect detection results, each defect detection training sample including a reference image and a feature enhanced image of a color ring component; All defect detection training samples are divided into a training set and a validation set. The appearance detection model with initialized parameters is trained using the training set. The appearance detection model is then validated using the validation set to obtain the validation results. Set the training conditions and determine whether the verification results meet the training conditions. If so, output the trained appearance detection model; if not, continue to use the training set to train the appearance detection model.

7. The color ring component appearance detection system based on machine vision is characterized by: The detection system includes a color ring component appearance detection device based on machine vision as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Ceramic defect detection system based on machine vision

    CN118671312A

  • Plate surface defect detection system and method based on machine vision

    CN119048472A

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

    CN119438225A

  • Persimmon quality detection method and system based on machine vision

    CN119810100A

  • Die-casting die defect detection method and system based on image recognition

    CN119904431A

Cited By

  • Product quality control method and system based on artificial intelligence and computer vision

    CN121147594A