Method and system for electronic component soldering inspection on a bga substrate
By converting color images to the YUV color space, extracting luminance and blue chromaticity components to calculate color difference, and adaptively adjusting the threshold, the problem of misjudgment caused by color difference fluctuations in BGA substrate soldering inspection is solved, achieving stable and reliable inspection under different conditions.
Patent Information
- Application Number
- CN202511648818.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-11-12
AI Technical Summary
In existing technologies for BGA substrate soldering inspection, substrate color difference fluctuations make it difficult to accurately distinguish between red electronic components and the blue substrate background, resulting in misjudgment of soldering position detection, especially with decreased model recognition accuracy under different batches and lighting conditions.
By converting a color image to the YUV color space, extracting the luminance component Y and the blue chromaticity component U, calculating the color difference value, and adaptively adjusting the threshold, the accurate extraction of the red electronic component area and the determination of the welding position are achieved.
Under conditions of substrate color difference and illumination variation, it can accurately separate the red electronic component area from the blue substrate background, maintain the stability and reliability of soldering position detection, and avoid misjudgment.
Smart Images

Figure CN121120631B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of welding detection, in particular to a method and system for welding detection of electronic components on a BGA substrate. BACKGROUND
[0002] In the production of BGA (Ball Grid Array) packaging electronic assembly, chip welding position detection is an important link to ensure the accuracy of mounting and product quality. The detection usually identifies and determines the position of the electronic components (such as capacitors, resistors, etc.) mounted on the BGA substrate to determine whether the welding position is offset. The typical BGA substrate is usually blue, and the capacitors, resistors and other electronic components to be welded are mostly red, so the detection task is mainly to distinguish the blue substrate background and the red mounted electronic components through image analysis to determine the correctness of the welding position.
[0003] In the prior art, the common detection methods mainly include two categories: one is a deep learning method based on neural network, that is, a convolutional neural network model is constructed and trained to extract features and classify and identify the collected images to determine whether the position of the red electronic component is offset. However, this kind of method has high dependence on the number and diversity of training samples, and a large number of samples need to be collected under different batches, different lighting conditions and different camera parameters to ensure the detection accuracy of the model; if there is a lack of sufficient sample support, the recognition accuracy and generalization ability of the model will decrease significantly, which is difficult to meet the real-time detection needs of the production line. The other is a gray-scale and threshold determination method based on traditional image processing, which converts the collected color image to grayscale, and distinguishes different color regions with a preset threshold, and then determines whether the red electronic component region is offset according to the detected red electronic component region.
[0004] However, in the actual detection process, since the BGA substrate is mostly blue, there are differences in material formula, coating thickness, surface reflection characteristics and lighting conditions of different batches of substrates, resulting in inconsistent blue tone and saturation of the substrate in the imaging result, that is, there is a significant color difference fluctuation. When the color difference changes greatly, the image gray value distribution changes, thereby affecting the determination result of the fixed threshold, causing the red electronic component and the blue background to be unable to be accurately distinguished, and thus the welding position detection is misjudged. SUMMARY
[0005] The present application provides a method and system for welding detection of electronic components on a BGA substrate, which can accurately separate the red electronic component welding area and the blue substrate background in the presence of color difference, thereby maintaining the stability and reliability of the welding position detection. The present application provides the following technical solutions:
[0006] In a first aspect, the present application provides a method for electronic component soldering detection on a BGA substrate, the method comprising:
[0007] obtaining a color target image and performing color space conversion thereon to extract luminance component Y and chrominance components U and V of the color target image;
[0008] calculating a color difference value of the BGA substrate in the color target image compared with a standard BGA substrate based on the luminance component Y and the chrominance component U;
[0009] adjusting a standard threshold corresponding to the standard BGA substrate based on the color difference value of the BGA substrate in the color target image compared with the standard BGA substrate to obtain an adaptive threshold corresponding to the BGA substrate in the color target image;
[0010] extracting the electronic component soldering position in the color target image using the adaptive threshold corresponding to the BGA substrate in the color target image and performing detection on the soldering position to output a detection result.
[0011] In a specific implementation, the obtaining a color target image and performing color space conversion thereon to extract luminance component Y and chrominance components U and V of the color target image comprises:
[0012] converting the image from RGB color space to YUV color space according to a linear matrix transformation formula:
[0013] Y = 0.299R + 0.587G + 0.114B;
[0014] U = 0.492(B-Y);
[0015] V = 0.877(R-Y);
[0016] wherein Y is the luminance component, the chrominance component U represents the blue chrominance component, the chrominance component V represents the red chrominance component, and R, G and B represent the red, green and blue channel intensity values of each pixel in the image, respectively.
[0017] In a specific implementation, the calculating a color difference value of the BGA substrate in the color target image compared with a standard BGA substrate based on the luminance component Y and the chrominance component U comprises:
[0018] calculating the difference between the luminance component Y of each pixel in the BGA substrate in the color target image and the standard BGA substrate ;
[0019] calculating the difference between the chrominance component U of each pixel in the BGA substrate in the color target image and the standard BGA substrate ;
[0020] The color difference value is obtained by combining the differences between the luminance component Y and the chrominance component U. The calculation formula is as follows:
[0021] ;
[0022] in, To adjust the coefficient, These are global adjustment parameters.
[0023] In one specific implementation, the calculation involves the difference between the luminance component Y of each pixel in the BGA substrate and the standard BGA substrate in the color target image. include:
[0024] The calculation formula is as follows:
[0025] ;
[0026] in, The sign function is used to distinguish the direction of brightness differences. It is the adjustment coefficient. For the substrate region in the target image The brightness value of each pixel. This represents the brightness value of the standard BGA substrate image at the corresponding location. This represents the total number of pixels within the substrate area.
[0027] In one specific implementation, the calculation involves the difference between the chromaticity component U of each pixel in the BGA substrate and the standard BGA substrate in the color target image. include:
[0028] The calculation formula is as follows:
[0029] ;
[0030] in, It is the adjustment coefficient. Indicates the BGA substrate region in the color target image. The chromaticity component U value of each pixel, This represents the chromaticity component U value of the corresponding pixel in a standard BGA substrate image. This represents the total number of pixels within the substrate area.
[0031] In a specific implementation, the adjusting of the standard threshold value corresponding to the standard BGA substrate based on the color difference value of the BGA substrate in the color target image compared with the standard BGA substrate to obtain the adaptive threshold value corresponding to the BGA substrate in the color target image includes:
[0032] The adaptive threshold value calculation formula is as follows:
[0033]
[0034] wherein, is the adaptive threshold value corresponding to the BGA substrate in the target image, is the standard threshold value corresponding to the standard BGA substrate, is the color difference value, is the maximum allowable color difference reference value, is the adjustment coefficient, is a constant.
[0035] In a specific implementation, the extracting of the electronic component soldering position in the color target image using the adaptive threshold value corresponding to the BGA substrate in the color target image and the detection of the soldering position to output the detection result include:
[0036] Converting the color target image into a gray-scale image, comparing the gray-scale value of each pixel in the gray-scale image with the adaptive threshold value to achieve the binary extraction of the red electronic component soldering area:
[0037]
[0038] wherein, represents the judgment result of whether the pixel belongs to the red electronic component soldering area, represents the gray-scale value of the corresponding pixel point in the gray-scale image.
[0039] After the binary is completed, the offset between the actual position of each electronic component and the template position is calculated according to the preset soldering position template of the electronic component, and the offset is compared with the allowable offset tolerance to determine whether the soldering position is abnormal.
[0040] According to the judgment result, a detection result is generated and output to a control system or a production management system.
[0041] In a second aspect, the present application provides an electronic component soldering detection system for a BGA substrate, which adopts the following technical solution:
[0042] An electronic component soldering detection system for a BGA substrate includes:
[0043] an image component extraction module configured to acquire a color target image and perform color space conversion on the color target image, and extract a luminance component Y and chrominance components U and V of the color target image;
[0044] a color difference value calculation module configured to calculate a color difference value of a BGA substrate in the color target image compared with a standard BGA substrate based on the luminance component Y and the chrominance components U and V;
[0045] a threshold adjustment module configured to adjust a standard threshold corresponding to the standard BGA substrate based on the color difference value of the BGA substrate in the color target image compared with the standard BGA substrate, to obtain an adaptive threshold corresponding to the BGA substrate in the color target image;
[0046] a detection result output module configured to extract an electronic component welding position in the color target image and perform detection on the welding position by using the adaptive threshold corresponding to the BGA substrate in the color target image, and output a detection result.
[0047] In a third aspect, the present application provides an electronic device, which comprises a processor and a memory; the memory stores a program, which is loaded and executed by the processor to implement the method for detecting welding of an electronic component on a BGA substrate according to the first aspect.
[0048] In a fourth aspect, the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the method for detecting welding of an electronic component on a BGA substrate according to the first aspect.
[0049] By converting the color target image from the RGB color space to the YUV color space, the luminance component Y and the chrominance components U and V are extracted respectively, the color difference of the BGA substrate in the color image compared with the standard BGA substrate is quantitatively calculated, and the standard threshold corresponding to the standard BGA substrate is adjusted based on the color difference to generate an adaptive threshold for the current target image. Finally, the adaptive threshold is used for gray-scale processing of the color target image to realize accurate extraction of the red electronic component region and welding position determination, thereby outputting an accurate detection result. In this method, by introducing joint analysis of the luminance component Y and the chrominance component U, the luminance variation and blue chrominance offset of the substrate can be quantified, so that the adaptive threshold can reflect the color difference of the actual image, and the red electronic component region is not dependent on the fixed threshold for determination, thereby significantly improving the recognizability of the red electronic component region in the presence of color difference fluctuations. In actual application scenarios, the BGA substrate is usually blue, and different batches of substrates have differences in material formula, coating thickness, surface reflection characteristics and lighting conditions, resulting in inconsistent blue hue and saturation in the imaging result, and obvious color difference fluctuations. In the traditional method, the fixed threshold cannot adapt to such color difference changes, and the image gray value distribution changes accordingly, making it difficult to distinguish the red electronic component from the blue substrate background, thereby causing misjudgment of the welding position determination. The present application calculates the color difference of the target image relative to the standard BGA substrate, and adjusts the threshold based on the color difference, so that each image has an adaptive threshold for its own color difference characteristics, which can accurately separate the red electronic component region from the blue substrate background. Even in the case of large substrate color difference or lighting condition changes, the stability and reliability of the welding position detection can be maintained, and the misjudgment problem caused by the fixed threshold method in the color difference fluctuation scenario is fundamentally solved.
[0050] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, and to implement the content of the description, the following will be described in detail with the preferred embodiments of the present application and with the help of the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 is a flowchart of the electronic component welding detection method for the BGA substrate in the embodiments of the present application.
[0052] Figure 2 is a schematic diagram of the overall flow of the electronic component welding detection method for the BGA substrate in the embodiments of the present application.
[0053] Figure 3 is a structural block diagram of the electronic component welding detection system for the BGA substrate in the embodiments of the present application.
[0054] Figure 4is a block diagram of an electronic device for electronic component soldering detection on a BGA substrate in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The specific embodiments of the present application are described in further detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not used to limit the scope of the present application.
[0056] Optionally, the electronic device for electronic component soldering detection method for BGA substrates provided in various embodiments of the present application is described by way of example, which is a terminal or a server, and the terminal can be a computer, a tablet computer, etc. The type of the electronic device is not limited in the present embodiment.
[0057] REFERENCE Figure 1 is a flowchart of the electronic component soldering detection method for BGA substrates provided in an embodiment of the present application. The method comprises at least the following steps:
[0058] In step S101, a color target image is acquired and color space conversion is performed thereon to extract the luminance component Y and the chrominance components U and V of the color target image.
[0059] In step S101, an RGB format color target image containing a BGA substrate to be detected and electronic components mounted thereon is acquired, and the target image is converted from the RGB color space to the YUV color space, thereby extracting Y, U, and V components reflecting luminance and chrominance characteristics. The purpose of this step is to obtain basic data that can independently represent image luminance and color offset.
[0060] Specifically, an industrial camera is arranged on a detection station as an image acquisition device. When acquiring, the luminance, incident angle, and exposure time of the light source are controlled to ensure the consistency of different batches of BGA substrates in imaging conditions, so as to reduce the interference of external environmental light on color characteristics. The acquired color image is represented in RGB mode, in which the blue region corresponds to the substrate background, and the red region corresponds to the mounted electronic components such as capacitors and resistors. Since there is a strong coupling relationship between the three channels of RGB, directly using the gray value for threshold judgment is easily affected by the color difference fluctuation of the substrate, resulting in a decrease in threshold stability. In order to separate the luminance and chrominance information, the image is converted from the RGB color space to the YUV color space. The conversion can be realized according to the linear matrix transformation formula:
[0061] Y = 0.299R + 0.587G + 0.114B;
[0062] U = 0.492(B-Y);
[0063] V = 0.877(R-Y).
[0064] Y, U, V = RGB2YUV(R, G, B) where Y is the luminance component, used to reflect the light and dark degree of the image, that is, the overall gray scale information; the U component represents the blue chrominance component, and the V component represents the red chrominance component; R, G, and B represent the red, green, and blue channel intensity values of each pixel point in the image. Through the conversion, three independent component images can be obtained respectively, which are used to represent the distribution of different color components in the overall image.
[0065] Through the above processing, the luminance information and the chrominance information in the color image are effectively separated, so that when there is a batch color difference or illumination fluctuation in the blue substrate, the luminance change and the blue chrominance offset degree of the substrate area can still be stably represented based on Y and U components, thereby providing more stable color feature input for adaptive threshold calculation.
[0066] In step S102, the color difference value between the BGA substrate in the color target image and the standard BGA substrate is calculated based on the luminance component Y and the chrominance component U in the color target image, and the color difference feature of the image is quantified.
[0067] In step S102, the color difference value between the BGA substrate in the color target image and the standard BGA substrate is calculated based on the luminance component Y and the chrominance component U in the color target image, and the color difference feature of the image is quantified.
[0068] In implementation, first, the difference between the luminance component Y of each pixel in the BGA substrate in the color target image and the standard BGA substrate is calculated. The standard BGA substrate in the present application refers to a blue BGA substrate used as a reference after the illumination, material, coating, and imaging conditions are uniformly calibrated, and its color and luminance characteristics are regarded as the standard basis for threshold setting and color difference calculation. The luminance component Y reflects the light and dark degree of the image, and is usually used to distinguish the light intensity change of the image. In the detection of the BGA substrate, the luminance difference is the most direct feature, and the luminance change of the substrate may be caused by the color difference of the substrate, the illumination difference, and other environmental factors. Since the color difference of the BGA substrate fluctuates greatly, small changes in the surface of the substrate and the image acquisition conditions may affect the luminance value, so when calculating the luminance color difference, it is necessary to ensure high sensitivity to small luminance differences, while suppressing large differences to avoid excessive response.
[0069] In order to avoid excessive influence of large luminance difference on the overall calculation, a progressive penalty function is introduced to adjust the influence on the calculation result according to the size of the luminance difference. Specifically, when the luminance difference is small, the penalty function enhances its weight in the final color difference value; when the difference is large, the penalty function reduces the influence on the final calculation result by smoothing the value.
[0070] Based on the luminance difference A nonlinear function is designed that gradually strengthens or smooths the response based on the magnitude of the brightness difference, representing the difference in the brightness component Y between each pixel on the BGA substrate and the standard BGA substrate in the color target image. The calculation formula is as follows:
[0071] ;
[0072] in, The sign function is used to distinguish the direction (positive or negative) of brightness differences. It is an adjustment coefficient that controls the intensity of the influence of brightness differences on the calculation results. For the substrate region in the target image The brightness value of each pixel. This represents the brightness value of the standard BGA substrate image at the corresponding location. The total number of pixels within the substrate area is denoted as Y. The reason why the above formula for calculating the difference in brightness components adopts a progressive penalty function structure is mainly based on the physical meaning of the brightness component Y in image feature representation and its role in BGA substrate inspection tasks. The brightness component Y directly reflects the overall brightness of the image and is the component most significantly affected by external light intensity, reflectivity, and surface roughness. In actual BGA substrate inspection scenarios, different batches of blue substrates may experience slight fluctuations in brightness values during imaging due to minor changes in coating thickness, material reflectivity, or shooting angle. Although such fluctuations do not cause color differences that are perceptible to the naked eye, they can cause the traditional grayscale thresholding method to mistakenly classify normal areas as abnormal areas. Therefore, in the calculation of brightness color difference, it is necessary to balance the high sensitivity to small brightness changes with the ability to suppress large brightness differences. To this end, the ΔY formula designed in this application uses a progressive penalty function structure in the brightness difference term. Introducing the denominator term A progressive penalty structure is constructed so that when the brightness difference is small, the denominator approaches 1, and the overall ratio is close to the true difference value, thus maintaining a high-resolution response to subtle brightness fluctuations. As the brightness difference gradually increases, the linear growth of the denominator smooths the output result, limiting the amplification effect of sudden brightness changes on the overall calculation result. Simultaneously, a sign function is used... By preserving the directional information of brightness differences, it is possible to distinguish whether the substrate area is too bright (positive value) or too dark (negative value), thus providing a directional basis for subsequent threshold adjustments. Overall, this nonlinear function achieves sensitive detection of small brightness shifts and smooth suppression of large brightness anomalies in the dimension of the brightness component Y, effectively offsetting the interference caused by ambient light and imaging reflection, and improving the stability and robustness of color difference measurement.
[0073] The difference between the color target image and the standard BGA substrate is calculated for each pixel in the BGA substrate, and the chrominance component U, which reflects the blue component of the image, is particularly important in BGA substrate detection, as it is used to express the blue chrominance variation of the substrate. Unlike brightness, the perception of chrominance difference has a strong directionality. For BGA substrates, chrominance variation can be more susceptible to environmental light and other color interference, so a color difference calculation method needs to be designed that not only has high sensitivity to subtle color difference changes but also avoids excessive response to large color differences.
[0074] A weighted variation function is designed that adjusts the contribution to the final result according to the size of the chrominance component U difference. In practical applications, smaller chrominance differences should be enhanced, while larger differences should be moderately suppressed, so as to better reflect the influence of small color differences. The formula for calculating the difference between the chrominance component U of each pixel in the BGA substrate region of the color target image and the standard BGA substrate is as follows:
[0075]
[0076] wherein, is an adjustment coefficient used to control the sensitivity of the chrominance difference to the calculation. The exponential decay function is used to suppress large color difference differences, so that the influence of large color differences is moderately reduced, while small color differences are enhanced. represents the chrominance component U value of the first pixel in the BGA substrate region of the color target image, represents the chrominance component U value of the corresponding pixel in the standard BGA substrate image, is the total number of pixels in the substrate region. The formula processes the chrominance difference value of each pixel by multiplying it by a non-linear weighting function so that the calculation result can take into account both the enhancement of small color differences and the suppression of large color differences. In this structure, when the pixel color difference is small, the exponential decay term approaches 1, and the value of approaches 0, so that the contribution of small color differences in the cumulative summation is amplified, and subtle blue or light phenomena are effectively captured; when the pixel color difference is large, the exponential term tends to 0, tends to 1, avoiding excessive influence of local extreme color differences on the overall color difference calculation. At the same time, the color difference term itself retains the positive and negative signs, ensuring that the final not only quantifies the color difference magnitude, but also reflects the directionality of the blue or light bias. Through this design, the characteristics of the chrominance component U are fully utilized: small blue chrominance variations can be sensitively captured, while abnormal large color differences are smoothed out, thereby ensuring the stability of the color difference value under different batches and different lighting conditions.
[0077] Finally, to comprehensively consider the color difference in both luminance and chromaticity, the following method is used to calculate the final color difference value. This method, based on the results of the first two steps, adaptively integrates the luminance and chromaticity differences, while ensuring that the color difference value can be either positive or negative to accurately reflect the direction of color shift. Color difference value The calculation formula is as follows:
[0078] ;
[0079] in, To adjust the coefficients and control the weight of chromaticity differences in the overall color difference, a non-linear correction term is used. The contribution of chromaticity differences is adjusted based on luminance differences to ensure that areas with significant luminance variations have higher weights. This is a global adjustment parameter used to control the degree of coupling between luminance differences and chrominance components.
[0080] It should be noted that the chromaticity component V is not used in the color difference calculation in this embodiment. The V component in the YUV color space mainly reflects the chromaticity intensity in the red direction. However, in the object to be detected, the red area typically corresponds to electronic components (such as resistors and capacitors) mounted on the BGA substrate, not the main substrate area of interest in this application. Including the V component in the color difference calculation would introduce red information from the electronic component area during the calculation process, causing the overall color difference value to be affected by the component's distribution location, size, and quantity, thereby masking or interfering with the substrate's own color shift characteristics. Conversely, the substrate's primary color is blue, and its color characteristics are mainly reflected in the luminance component Y and the blue chromaticity component U. Therefore, this application only retains the Y and U components in the color difference calculation to characterize the changes in substrate luminance and blue chromaticity, eliminating the V component information related to red electronic components, thereby avoiding interference from non-target areas and ensuring the specificity and stability of the color difference calculation.
[0081] Step S103: Adjust the standard threshold corresponding to the standard BGA substrate based on the color difference value between the BGA substrate and the standard BGA substrate in the color target image to obtain the adaptive threshold corresponding to the BGA substrate in the color target image.
[0082] In step S103, the color difference value between the BGA substrate and the standard BGA substrate in the color target image obtained in step S102 is used. And the preset standard threshold corresponding to the standard BGA substrate. The standard threshold is adjusted to obtain an adaptive threshold suitable for the current color target image. The purpose of this step is to dynamically adjust the threshold value according to the color difference feature, so that it can adapt to the color deviation of different batches of BGA substrates, ensure the reliable distinction between the blue substrate area and the red electronic component area, and thus provide a basis for accurate detection of the welding position.
[0083] Specifically, the threshold value of the standard BGA substrate is a fixed threshold value obtained by experiment, that is, it is obtained by experimental statistics and verification on multiple batches of standard substrate images. In the case of small color difference and consistent lighting conditions, it can accurately distinguish the blue substrate area and the red electronic component area. For a color target image, since the substrate may have color difference , directly using may lead to inaccurate separation of blue substrates and red components, so it is necessary to adaptively adjust the standard threshold value based on . To this end, the present application designs the following adaptive threshold calculation formula:
[0084] ;
[0085] Wherein, is the adaptive threshold value of the BGA substrate in the target image, is the color difference value calculated in step S102, is the maximum allowable color difference reference value, which can be obtained by statistical color difference of different batches of standard substrates, is an adjustment coefficient for controlling the influence of color difference on the threshold value, is a minimum value constant to avoid a zero denominator. The design idea of the formula is: when the color difference is large, the adaptive threshold value will decrease accordingly to enhance the sensitivity to the blue substrate deviation area; when the color difference is small, the threshold value is close to the standard value , ensuring the stability of the judgment under small color difference. By this linear scaling and the introduction of and parameters, the threshold value adjustment is smooth and reasonable, avoiding excessive deviation from the standard value.
[0086] Through the above processing, the adaptive threshold value of the BGA substrate in the color target image can be dynamically adjusted according to the actual color difference of the substrate, overcoming the misjudgment problem caused by the fixed threshold value under different batches and different color difference conditions, and improving the distinction accuracy of the blue substrate and the red electronic component. At the same time, this adaptive threshold method takes into account the sensitivity to small color difference and the smooth suppression effect of large color difference abnormalities, providing a reliable and stable basis for subsequent welding deviation detection, and realizing high-robustness welding detection under the condition of batch color difference.
[0087] Step S104: Extract the welding positions of electronic components in the color target image using the adaptive threshold corresponding to the BGA substrate in the color target image, detect the welding positions, and output the detection results.
[0088] In step S104, the adaptive threshold corresponding to the BGA substrate in the obtained color target image is adjusted. This method is applied to color target image processing to extract the red electronic component area and further determine whether the welding position deviates from the preset template position, ultimately outputting the detection result. The purpose of this step is to accurately identify the welding area of the red electronic component in the presence of substrate color difference and reliably determine the welding offset, providing stable and operable detection results for the production line.
[0089] Specifically, the color target image is first converted to a grayscale image. Grayscale values can effectively reflect the difference in brightness between the red electronic component soldering area and the blue substrate area. Then, the grayscale value of each pixel in the grayscale image is... With adaptive threshold By comparison, the welding area of the red electronic component is extracted using binarization:
[0090] ;
[0091] in, Represents pixels The determination of whether it belongs to the red electronic component soldering area. This represents the grayscale value of the corresponding pixel in the grayscale image. After binarization, based on the preset welding position template of the electronic components, the offset between the actual position of each electronic component and the template position is calculated, and the offset is compared with the allowable offset tolerance to determine whether the welding position is abnormal. Finally, an inspection report is generated based on the judgment result, including the offset of each electronic component and whether the overall welding is qualified, and the result is output to the control system or production management system.
[0092] Through the above processing, the adaptive threshold combined with grayscale images enables the stable extraction of the soldering area of red electronic components under different batches of BGA substrates with varying color differences and lighting conditions, ensuring the accuracy of soldering position determination. This method can complete electronic component soldering inspection without using neural networks, achieving real-time, efficient, and reliable inspection output on the production line, providing direct data support for process control and quality management.
[0093] In summary, combining Figure 2, based on RGB→YUV color space conversion on the collected color target image, the luminance component Y and the chrominance component U (not using V component) are extracted to quantify the color difference of the target image relative to a set of standard BGA substrates, and then the standard threshold value obtained by experiment is adjusted adaptively with the color difference as input, to obtain the adaptive threshold value for subsequent binary segmentation. Finally, the red electronic component welding area is extracted on the gray image with the adaptive threshold value, and the welding position judgment and result output are completed. The present application is first to separate the luminance and chrominance through YUV conversion, so that the luminance change (Y) and the blue chrominance change (U) can be quantified independently, avoiding the interference caused by RGB channel coupling from the source; secondly, based on Y and U, a color difference value is designed which is sensitive to small deviations and smooth to large abnormalities, so that the small color difference of the substrate can be responded sensitively without being dominated by extreme values; thirdly, the standard threshold value determined by experiment is adjusted with the color difference value, so that the threshold value is automatically contracted or enlarged with the substrate color difference, ensuring that the distinction of the substrate background is enhanced when the color difference is large, and the judgment stability is maintained when the color difference is small. The scheme is limited to blue BGA substrate and red component mounting element scene (i.e. the color difference source is mainly the substrate rather than the component), and does not rely on neural network or learning model, so it not only retains the real-time and interpretability of the threshold-based method, but also overcomes the judgment failure problem of fixed threshold under multiple batches and multiple lighting conditions through color difference-driven threshold adaptation. It can accurately separate the red electronic component welding area and the blue substrate background, thereby maintaining the stability and reliability of the welding position detection.
[0094] Figure 3 is a structural block diagram of an electronic component welding detection system on a BGA substrate provided by an embodiment of the present application, which at least includes the following modules:
[0095] An image component extraction module is used to obtain a color target image and perform color space conversion thereon, and extract the luminance component Y and the chrominance components U and V of the color target image;
[0096] A color difference value calculation module is used to calculate the color difference value of the BGA substrate in the color target image relative to the standard BGA substrate based on the luminance component Y and the chrominance component U;
[0097] A threshold adjustment module is used to adjust the standard threshold value corresponding to the standard BGA substrate based on the color difference value of the BGA substrate in the color target image relative to the standard BGA substrate, to obtain the adaptive threshold value corresponding to the BGA substrate in the color target image;
[0098] A detection result output module is used to extract the electronic component welding position in the color target image using the adaptive threshold value corresponding to the BGA substrate in the color target image, and detect the welding position, and output the detection result.
[0099] Further details are described in the above method embodiments.
[0100] Figure 4 is a block diagram of an electronic device provided by an embodiment of the present application. The device includes at least a processor 401 and a memory 402.
[0101] The processor 401 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 401 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 401 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 can also include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.
[0102] The memory 402 can include one or more computer-readable storage media that can be non-transitory. The memory 402 can also include a high-speed random access memory, and a non-volatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction for being executed by the processor 401 to implement the electronic component soldering detection method on a BGA substrate provided by the method embodiments of the present application.
[0103] In some embodiments, the electronic device can also optionally include a peripheral device interface and at least one peripheral device. The processor 401, the memory 402, and the peripheral device interface can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface through a bus, a signal line, or a circuit board. Illustratively, the peripheral devices include, but are not limited to, a radio frequency circuit, a touch display screen, an audio circuit, a power supply, etc.
[0104] Of course, the electronic device can also include fewer or more components, and the present embodiments are not limited in this respect.
[0105] Optionally, the present application also provides a computer readable storage medium, the computer readable storage medium stores a program, the program is loaded and executed by a processor to realize the electronic component welding detection method for BGA substrate of the above-mentioned method embodiment.
[0106] Optionally, the present application also provides a computer product, the computer product includes a computer readable storage medium, the computer readable storage medium stores a program, the program is loaded and executed by a processor to realize the electronic component welding detection method for BGA substrate of the above-mentioned method embodiment.
[0107] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.
[0108] The above embodiments only express several implementation manners of the present application, and the description is specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for inspecting the soldering of electronic components on a BGA substrate, characterized in that, The method includes: Acquire a color target image and perform color space conversion on it, then extract the luminance component Y and chrominance components U and V from the color target image; The calculation of the color difference value between the BGA substrate and the standard BGA substrate in the color target image based on the luminance component Y and the chrominance component U includes: calculating the difference between the luminance component Y of each pixel in the BGA substrate and the standard BGA substrate in the color target image. ; Calculate the difference in chromaticity component U between each pixel in a BGA substrate and a standard BGA substrate in a color target image. The color difference value is obtained by combining the differences between the luminance component Y and the chrominance component U. The calculation formula is as follows: ; in, To adjust the coefficient, These are global adjustment parameters; The calculation formula is as follows: ; in, The sign function is used to distinguish the direction of brightness differences. It is the adjustment coefficient. For the substrate region in the target image The brightness value of each pixel. This represents the brightness value of the standard BGA substrate image at the corresponding location. This represents the total number of pixels within the substrate area. The calculation formula is as follows: ; in, It is the adjustment coefficient. Indicates the BGA substrate region in the color target image. The chromaticity component U value of each pixel, This represents the chromaticity component U value of the corresponding pixel in a standard BGA substrate image. This represents the total number of pixels within the substrate area. Based on the color difference value between the BGA substrate and the standard BGA substrate in the color target image, the standard threshold corresponding to the standard BGA substrate is adjusted to obtain the adaptive threshold corresponding to the BGA substrate in the color target image, including: The adaptive threshold calculation formula is as follows: ; in, The adaptive threshold corresponding to the BGA substrate in the target image. This refers to the standard threshold corresponding to a standard BGA substrate. This is the color difference value. As a reference value for the maximum permissible color difference, For adjustment coefficients, It is a constant; The welding positions of electronic components in the color target image are extracted using an adaptive threshold corresponding to the BGA substrate in the color target image, and the welding positions are detected, and the detection results are output.
2. The method for inspecting the soldering of electronic components on a BGA substrate according to claim 1, characterized in that, The step of acquiring a color target image and performing color space conversion on it, and extracting the luminance component Y and chrominance components U and V of the color target image includes: Convert the image from RGB color space to YUV color space using the linear matrix transformation formula: Where Y is the luminance component, U represents the blue chrominance component, V represents the red chrominance component, and R, G, and B represent the red, green, and blue channel intensity values of each pixel in the image, respectively.
3. The method for inspecting the soldering of electronic components on a BGA substrate according to claim 1, characterized in that, The process involves extracting the soldering positions of electronic components in the color target image using an adaptive threshold corresponding to the BGA substrate, detecting the soldering positions, and outputting the detection results, including: Convert a color target image to a grayscale image, and then convert the grayscale value of each pixel in the grayscale image. With adaptive threshold By comparison, the welding area of the red electronic component is extracted using binarization: ; in, Represents pixels The determination of whether it belongs to the red electronic component soldering area. This represents the grayscale value of the corresponding pixel in a grayscale image. After binarization, the offset between the actual position of each electronic component and the template position is calculated based on the preset welding position template of the electronic component. The offset is then compared with the allowable offset tolerance to determine whether the welding position is abnormal. The test results are generated based on the judgment results and then output to the control system or production management system.
4. A system for inspecting the soldering of electronic components on a BGA substrate, characterized in that, include: The image component extraction module is used to acquire a color target image and perform color space conversion on it, and extract the luminance component Y and chrominance components U and V of the color target image; The color difference calculation module is used to calculate the color difference value between the BGA substrate and the standard BGA substrate in the color target image based on the luminance component Y and the chrominance component U, including: calculating the difference between the luminance component Y of each pixel in the BGA substrate and the standard BGA substrate in the color target image. ; Calculate the difference in chromaticity component U between each pixel in a BGA substrate and a standard BGA substrate in a color target image. The color difference value is obtained by combining the differences between the luminance component Y and the chrominance component U. The calculation formula is as follows: ; in, To adjust the coefficient, These are global adjustment parameters; The calculation formula is as follows: ; in, The sign function is used to distinguish the direction of brightness differences. It is the adjustment coefficient. For the substrate region in the target image The brightness value of each pixel. This represents the brightness value of the standard BGA substrate image at the corresponding location. This represents the total number of pixels within the substrate area. The calculation formula is as follows: ; in, It is the adjustment coefficient. Indicates the BGA substrate region in the color target image. The chromaticity component U value of each pixel, This represents the chromaticity component U value of the corresponding pixel in a standard BGA substrate image. This represents the total number of pixels within the substrate area. A threshold adjustment module is used to adjust the standard threshold corresponding to the standard BGA substrate based on the color difference value between the BGA substrate and the standard BGA substrate in the color target image, to obtain an adaptive threshold corresponding to the BGA substrate in the color target image, including: The adaptive threshold calculation formula is as follows: ; in, The adaptive threshold corresponding to the BGA substrate in the target image. This refers to the standard threshold corresponding to a standard BGA substrate. This is the color difference value. As a reference value for the maximum permissible color difference, For adjustment coefficients, It is a constant; The detection result output module is used to extract the welding positions of electronic components in the color target image using the adaptive threshold corresponding to the BGA substrate in the color target image, detect the welding positions, and output the detection results.
5. An electronic device, characterized in that, The device includes a processor and a memory; the memory stores a program that is loaded and executed by the processor to implement a method for inspecting the soldering of electronic components on a BGA substrate as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, is used to implement a method for inspecting the soldering of electronic components on a BGA substrate as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Printing image-text defect detection method based on machine vision
CN120765662A