Electronic component welding detection method and system for BGA substrate
By converting color images to the YUV color space, extracting luminance and 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
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-11-12
AI Technical Summary
In existing technologies for BGA substrate soldering inspection, substrate color difference fluctuations can lead to misjudgments of soldering positions, making it difficult to maintain accuracy, especially when considering different batches and lighting conditions.
By converting a color image to the YUV color space, extracting the luminance component Y and chromaticity component U, calculating the color difference value, and adaptively adjusting the threshold, accurate separation of red electronic components from the blue substrate is achieved.
Under conditions of substrate color difference and light variation, it can stably and reliably detect the welding position, improving the accuracy and robustness of detection and avoiding misjudgment in traditional methods.
Smart Images

Figure CN121120631A_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: In a first aspect, this application provides a method for inspecting the soldering of electronic components on a BGA substrate, the method comprising: 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 color difference value between the BGA substrate and the standard BGA substrate in the color target image is calculated based on the luminance component Y and the chrominance component U. 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. 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.
[0006] In one specific implementation, 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: Y = 0.299R + 0.587G + 0.114B; U=0.492(BY); V=0.877(RY); 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.
[0007] In one specific implementation, calculating 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: Calculate the difference in luminance component Y between each pixel on a BGA substrate and a standard BGA substrate in a color target image. ; Calculate the difference in chromaticity component U between each pixel on 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.
[0008] 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: 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.
[0009] 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: 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.
[0010] In one specific implementation, adjusting 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 includes: 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.
[0011] In one specific implementation, the step of extracting the electronic component welding positions in the color target image using an adaptive threshold corresponding to the BGA substrate in the color target image and detecting the welding positions, and outputting the detection results includes: 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.
[0012] Secondly, this application provides a system for inspecting the soldering of electronic components on a BGA substrate, employing the following technical solution: A system for inspecting the soldering of electronic components on a BGA substrate, comprising: 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 value 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. The 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, so as to obtain the adaptive threshold corresponding to the BGA substrate in the color target image. 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.
[0013] Thirdly, this application provides an electronic device, the device including a processor and a memory; the memory stores a program, the program being loaded and executed by the processor to implement a method for inspecting the soldering of electronic components on a BGA substrate as described in the first aspect.
[0014] Fourthly, this application provides a computer-readable storage medium storing 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 the first aspect.
[0015] By converting the color target image from the RGB color space to the YUV color space, the luminance component Y and chromaticity components U and V are extracted respectively. The color difference between the BGA substrate and the standard BGA substrate in the color image is quantified and calculated. Based on this color difference, the standard threshold corresponding to the standard BGA substrate is adjusted to generate an adaptive threshold for the current target image. Finally, the color target image is grayscaled using this adaptive threshold to accurately extract the red electronic component area and determine the soldering position, thereby outputting accurate detection results. In this method, by introducing joint analysis of the luminance component Y and the chromaticity component U, the brightness changes and blue chromaticity shifts of the substrate can be quantified. This allows the adaptive threshold to reflect the actual color difference of the image, rather than relying on a fixed threshold for judgment, thus significantly improving the identifiability of the red electronic component area in the presence of color difference fluctuations. In practical applications, BGA substrates are usually blue. Different batches of substrates differ in material formulation, coating thickness, surface reflectivity, and lighting conditions, resulting in inconsistent blue hue and saturation in the imaging results, producing obvious color difference fluctuations. In traditional methods, fixed thresholds cannot adapt to such color difference variations, causing changes in the image grayscale distribution and making it difficult to distinguish between red electronic components and the blue substrate background, leading to misjudgments in soldering position detection. This application calculates the color difference between the target image and the standard BGA substrate and adjusts the threshold based on this color difference, giving each image an adaptive threshold tailored to its own color difference characteristics. This accurately separates the red electronic component area from the blue substrate background, maintaining the stability and reliability of soldering position detection even under conditions of significant substrate color difference or changing lighting conditions. This fundamentally solves the misjudgment problem caused by fixed threshold methods in scenarios with fluctuating color differences.
[0016] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0017] Figure 1 This is a schematic flowchart of a method for inspecting the soldering of electronic components on a BGA substrate, as described in this application.
[0018] Figure 2 This is a schematic diagram of the overall process of the electronic component soldering inspection method on a BGA substrate in the embodiments of this application.
[0019] Figure 3 This is a structural block diagram of an electronic component soldering inspection system for BGA substrates, as described in this application.
[0020] Figure 4 This is a block diagram of an electronic device used for inspecting the soldering of electronic components on a BGA substrate, as described in this application. Detailed Implementation
[0021] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0022] Optionally, this application uses the electronic component soldering inspection method for BGA substrates provided in various embodiments as an example for application in electronic devices. The electronic device is a terminal or server. The terminal can be a computer, tablet computer, etc. This embodiment does not limit the type of electronic device.
[0023] Reference Figure 1 This is a flowchart illustrating a method for inspecting the soldering of electronic components on a BGA substrate according to an embodiment of this application. The method includes at least the following steps: Step S101: Acquire a color target image and perform color space conversion on it, extracting the luminance component Y and chrominance components U and V from the color target image.
[0024] In step S101, a color target image containing the BGA substrate to be detected and the electronic components mounted on it in RGB format is acquired, and the target image is converted from the RGB color space to the YUV color space, thereby extracting the Y, U, and V components that reflect the brightness and chromaticity characteristics. The purpose of this step is to obtain basic data that can independently characterize the brightness and color shift of the image.
[0025] Specifically, an industrial camera is deployed at the inspection station as an image acquisition device. During acquisition, the brightness of the light source, the angle of incidence, and the exposure time are controlled to ensure consistency in imaging conditions across different batches of BGA substrates, thereby reducing interference from differences in external ambient lighting on color characteristics. The acquired color images are represented in RGB mode, where the blue areas correspond to the substrate background and the red areas correspond to mounted electronic components such as capacitors and resistors. Due to the strong coupling between the three RGB channels, directly using their grayscale values for threshold determination is easily affected by substrate color difference fluctuations, leading to decreased threshold stability. To separate brightness and chromaticity information, the image is converted from the RGB color space to the YUV color space. The conversion can be achieved using the linear matrix transformation formula: Y = 0.299R + 0.587G + 0.114B; U=0.492(BY); V=0.877(RY).
[0026] In this model, Y represents the luminance component, reflecting the brightness of the image, i.e., the overall grayscale information; the U component represents the blue chromaticity component; the V component represents the red chromaticity component; and R, G, and B represent the red, green, and blue channel intensity values of each pixel in the image, respectively. This transformation yields three independent component images, representing the distribution of different color components within the overall image.
[0027] Through the above processing, the brightness information and chromaticity information in the color image are effectively separated, so that when there are batch color differences or light fluctuations in the blue substrate, the brightness changes and blue chromaticity shift of the substrate area can still be stably characterized based on the Y and U components, thereby providing a more stable color feature input for adaptive threshold calculation.
[0028] Step S102: 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.
[0029] In step S102, the color difference value between the BGA substrate and the standard BGA substrate in the color target image is calculated based on the luminance component Y and chrominance component U in the color target image, thereby quantifying the color difference characteristics of the image.
[0030] In practice, the difference in luminance component Y between each pixel in the BGA substrate and the standard BGA substrate in the color target image is first calculated. The standard BGA substrate in this application refers to a blue BGA substrate used as a reference after its illumination, material, coating, and imaging conditions have been uniformly calibrated. Its color and luminance characteristics are considered the standard basis for threshold setting and color difference calculation. The luminance component Y reflects the brightness of the image and is usually used to distinguish changes in image light intensity. In the detection of BGA substrates, luminance difference is the most direct feature. Brightness changes in the substrate may originate from color difference, illumination differences, and other environmental factors. Because the color difference of BGA substrates fluctuates significantly, small changes in the substrate surface and image acquisition conditions may affect the luminance value. Therefore, when calculating luminance color difference, it is necessary to ensure high sensitivity to small luminance differences while suppressing larger differences to avoid over-response.
[0031] To avoid large brightness differences from excessively impacting the overall calculation, a progressive penalty function is introduced, adjusting its influence on the calculation results based on the magnitude of the brightness difference. Specifically, when the brightness difference is small, the penalty function increases its weight in the final color difference value; while when the difference is large, the penalty function reduces its impact on the final calculation result by smoothing its value.
[0032] Based on brightness 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: ; 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.
[0033] Subsequently, the difference in chromaticity component U between each pixel in the BGA substrate and the standard BGA substrate in the color target image is calculated. Chromaticity component U reflects the blue component of the image and is particularly important in BGA substrate inspection because it represents the substrate's blue chromaticity variations. Unlike brightness, the perception of chromaticity differences is highly directional. For BGA substrates, chromaticity changes may be more easily affected by ambient light and other color interferences; therefore, a chromaticity difference calculation method needs to be designed that is highly sensitive to subtle chromaticity differences while avoiding over-response to large chromaticity differences.
[0034] Design a weighted variation function that adjusts the contribution of the chromaticity component U to the final result based on the magnitude of the difference. In practical applications, smaller chromaticity differences should be amplified, while larger differences should be moderately suppressed to better reflect the influence of subtle chromatic differences. The difference between the chromaticity component U of each pixel in a BGA substrate and a standard BGA substrate in a color target image is described. The calculation formula is as follows: ; in, This is an adjustment coefficient used to control the sensitivity of the calculation to chromaticity differences. (Exponential decay function) It is used to suppress large color differences, so that the influence of larger color differences is moderately reduced, while small color differences are enhanced. 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. The formula is derived by considering the chromaticity difference of each pixel. Multiplied by a nonlinear weighting function Processing is performed to ensure that the calculation results balance the enhancement of minor color differences with the suppression of major color differences. In this structure, when the pixel color difference is small, the exponential decay term... Approaching 1, The value of the exponent is close to 0, thus amplifying the contribution of minute color differences in the cumulative summation, effectively capturing subtle bluish or pale colors; while when the pixel color difference is large, the exponent term approaches 0. The color difference is shifted towards 1 to avoid excessive influence of extreme local color differences on the overall color difference calculation. At the same time, the color difference term itself retains its positive and negative signs to ensure the final result... It not only quantifies the range of color difference but also reflects the directionality of blue or lightness. Through this design, the characteristics of the chromaticity component U are fully utilized: minute changes in blue chromaticity can be sensitively captured, while interference from abnormally large color differences is smoothed out, thereby ensuring the stability of color difference values across different batches and under different lighting conditions.
[0035] 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: ; 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.
[0036] 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.
[0037] 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.
[0038] 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 based on the color difference characteristics, so that it can adapt to the color shift of different batches of BGA substrates, ensuring reliable differentiation between the blue substrate area and the red electronic component area, thereby providing a basis for accurate detection of the soldering position.
[0039] Specifically, the threshold of a standard BGA substrate This is a fixed threshold obtained through experimentation, specifically by statistical analysis and verification on multiple batches of standard substrate images. Under conditions of minimal color difference and consistent lighting, it accurately distinguishes between blue substrate areas and red electronic component areas. For color target images, color differences may exist in the substrate itself. Use directly This could lead to inaccurate separation between the blue substrate and the red components, therefore it is necessary to base it on... The standard threshold is adaptively adjusted. To this end, this application designs the following adaptive threshold calculation formula: ; in, The adaptive threshold corresponding to the BGA substrate in the target image. The color difference value calculated in step S102 The maximum permissible color difference reference value can be obtained by statistically analyzing the color differences of different batches of standard substrates. This is an adjustment coefficient used to control the intensity of the effect of color difference on the threshold. To minimize the constant value, the denominator should be kept constant to avoid zero. The formula design is based on the following principle: when the color difference... When the color difference is large, the adaptive threshold will decrease accordingly to enhance sensitivity to the blue substrate offset region; when the color difference... When the value is small, the threshold is close to the standard value. This ensures stable judgment even with minute color differences. This is achieved through linear scaling and the introduction of... and The parameters are designed to ensure that the threshold adjustment is smooth and reasonable, avoiding excessive deviation from the standard value.
[0040] Through the above processing, the adaptive threshold 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 that may be caused by a fixed threshold under different batches and different color difference conditions, and improving the differentiation accuracy between blue substrates and red electronic components. At the same time, this adaptive threshold method takes into account both the sensitivity to small color differences and the smoothing and suppression effect of large color differences, providing a reliable and stable foundation for subsequent solder offset detection, and realizing highly robust solder detection under the condition of batch color difference.
[0041] 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.
[0042] 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.
[0043] 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: ; 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.
[0044] 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.
[0045] In summary, combining Figure 2This invention utilizes RGB to YUV color space conversion on acquired color target images to extract the luminance component Y and chrominance component U (excluding the V component) to quantify the color difference of the target image relative to a set of standard BGA substrates. This color difference is then used as input to adaptively adjust a pre-determined standard threshold obtained through experiments, resulting in an adaptive threshold for subsequent binarization segmentation. Finally, the welding area of red electronic components is extracted from the grayscale image using the adaptive threshold, completing the welding position determination and outputting the result. This application achieves three key advantages: First, it separates luminance and chrominance through YUV transformation, allowing luminance changes (Y) and blue chrominance changes (U) to be quantified independently, avoiding interference from RGB channel coupling. Second, it designs color difference values for Y and U that are sensitive to small deviations and suppress large abnormal smoothing, enabling sensitive responses to minute color differences in the substrate without being dominated by extreme values. Third, it adjusts the experimentally determined standard threshold using the color difference value, allowing the threshold to automatically shrink or expand with the substrate color difference, ensuring enhanced differentiation of the substrate background when the color difference is large and maintaining judgment stability when the color difference is small. This solution is limited to scenarios involving blue BGA substrates and red-characterized mounted components (i.e., the color difference primarily originates from the substrate rather than the components). It does not rely on neural networks or learning models, thus retaining the real-time performance and interpretability of threshold-based methods while overcoming the failure issue of fixed thresholds under multiple batches and lighting conditions through color difference-driven threshold adaptation. It can accurately separate the soldering area of red electronic components from the blue substrate background even when color differences exist on the substrate, thereby maintaining the stability and reliability of soldering position detection.
[0046] Figure 3 This is a structural block diagram of an electronic component soldering inspection system on a BGA substrate according to an embodiment of this application. The system includes at least the following modules: The image component extraction module is used to acquire a color target image and perform color space conversion on it, extracting the luminance component Y and chrominance components U and V from 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. The 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, so as to obtain the adaptive threshold corresponding to the BGA substrate in the color target image. The detection result output module is used to extract the welding positions of electronic components in the color target image using an adaptive threshold corresponding to the BGA substrate in the color target image, detect the welding positions, and output the detection results.
[0047] For relevant details, please refer to the above method implementation examples.
[0048] Figure 4 This is a block diagram of an electronic device provided in one embodiment of this application. The device includes at least a processor 401 and a memory 402.
[0049] Processor 401 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0050] Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 402 is used to store at least one instruction, which is executed by processor 401 to implement the electronic component soldering inspection method on a BGA substrate provided in the method embodiments of this application.
[0051] In some embodiments, the electronic device may also optionally include: a peripheral device interface and at least one peripheral device. The processor 401, memory 402, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Indicatively, peripheral devices include, but are not limited to: radio frequency circuits, touch displays, audio circuits, and power supplies.
[0052] Of course, electronic devices may also include fewer or more components, and this embodiment does not limit this.
[0053] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the above-described method embodiment for inspecting the soldering of electronic components on a BGA substrate.
[0054] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the above-described method embodiment for inspecting the soldering of electronic components on a BGA substrate.
[0055] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0056] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by 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 color difference value between the BGA substrate and the standard BGA substrate in the color target image is calculated based on the luminance component Y and the chrominance component U. 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. 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: Y = 0.299R + 0.587G + 0.114B; U=0.492(BY); V=0.877(RY); 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 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: Calculate the difference in luminance component Y between each pixel on a BGA substrate and a standard BGA substrate in a color target image. ; Calculate the difference in chromaticity component U between each pixel on 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.
4. The method for inspecting the soldering of electronic components on a BGA substrate according to claim 3, characterized in that, The calculation involves the difference in the luminance component Y of each pixel in the BGA substrate and the standard BGA substrate in the color target image. include: 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.
5. The method for inspecting the soldering of electronic components on a BGA substrate according to claim 3, characterized in that, 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: 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.
6. The method for inspecting the soldering of electronic components on a BGA substrate according to claim 1, characterized in that, The step of adjusting 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 includes: 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.
7. The method for inspecting the soldering of electronic components on a BGA substrate according to claim 6, 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.
8. 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 value 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. The 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, so as to obtain the adaptive threshold corresponding to the BGA substrate in the color target image. 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.
9. 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 7.
10. 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 7.
Citation Information
Patent Citations
Character color difference defect detection method and device and computer readable storage medium
CN117710326A
Industrial weld defect detection method based on semantic segmentation
CN119515793A
Spooling color tube detection method and system based on image analysis
CN120298274A
Visual image-based welding seam defect detection method
CN120352432A
Printing image-text defect detection method based on machine vision
CN120765662A