PCB panel solder joint defect detection method and system based on machine vision

By introducing gradient-weighted geometric center and curvature energy density indices into the phase consistency algorithm, and dynamically adjusting the frequency domain filter parameters, a high-light immune filter is constructed, which solves the adaptability problem of solder joint detection under different packaging forms and improves the accuracy and robustness of solder joint defect detection.

CN122222969APending Publication Date: 2026-06-16HENAN HAILE ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENAN HAILE ELECTRONICS TECH
Filing Date
2026-03-17
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing automated optical inspection equipment, when inspecting solder joints on printed circuit boards, suffers from problems such as missed micro-defects or macro-contour breakage due to the strong mirror-like high-frequency reflection phenomenon generated by the lead-free solder surface. This makes it impossible for traditional phase consistency algorithms to adapt to different package forms.

Method used

By acquiring the gradient-weighted geometric center and morphological reference span index of the local image of the solder joint, and combining the second derivative to evaluate the curvature energy density index, the frequency domain filter parameters of the phase consistency algorithm are dynamically adjusted to construct a high-light immune filter, thereby achieving adaptive detection of solder joints of different sizes.

Benefits of technology

It effectively reduces the interference of high-gloss reflection of metal on the solder joint surface on edge extraction, improves the feature expression ability of the phase consistency response map under complex lighting conditions, and improves the accuracy of solder joint defect identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122222969A_ABST
    Figure CN122222969A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of image processing and machine vision, and particularly relates to a PCB panel solder joint defect detection method and system based on machine vision, which comprises the following steps: acquiring a PCB panoramic image and extracting a solder joint local image; determining a weighted geometric center based on the gradient amplitude distribution of the solder joint local image, and calculating a morphology reference span index; extracting a second-order derivative by using a Laplace operator, combining the span index to construct a curvature energy density index; performing logarithmic decay operation on the curvature energy density index to generate a dynamic wavelength adjustment factor; performing scale calibration on the frequency domain filter parameters of a calibration phase consistency algorithm according to the dynamic wavelength adjustment factor, and constructing a highlight immunity filter; and finally performing adaptive scale filtering and inverse Fourier transform by using the filter to acquire a phase consistency response graph, and realizing accurate identification of solder joint offset defects by calculating a center offset amount. The application enhances multi-package adaptive high-precision detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of image processing and machine vision technology. More specifically, this invention relates to a machine vision-based method and system for detecting solder joint defects on PCB panels. Background Technology

[0002] In modern electronic manufacturing surface mount technology and dual in-line package production lines, the solder joint quality of printed circuit board assemblies directly determines the reliability of electronic products. Current mainstream automatic optical inspection equipment often uses ring light sources to illuminate images. Due to the smooth metallic curved surface characteristics of lead-free solder, it is very easy to generate strong specular high-frequency reflections and light spot overflow under the light source. This strong reflection phenomenon will seriously obscure the true physical contour of the solder joint, causing conventional edge extraction and morphological analysis algorithms that rely on spatial grayscale gradients to completely fail, resulting in missed or misjudged defects such as cracks and cold solder joints.

[0003] To overcome the failure of morphological feature extraction caused by highlights, the phase consistency algorithm is an effective technical means. The phase consistency algorithm abandons the gray-level gradient in the spatial domain and instead finds points in the Fourier frequency domain where the phases of each frequency component are the same to locate image features. Since local illumination changes and drastic contrast fluctuations do not change the frequency domain phase features of the underlying physical contours, the phase consistency algorithm is naturally immune to high-frequency reflections generated by metal surfaces and can directly penetrate highlights to extract the underlying structure.

[0004] However, in actual printed circuit board inspection scenarios, components typically exhibit a mixed form of multiple packages, ranging from micron-sized ultra-small chips to giant connectors several centimeters in size, coexisting on the same board surface. This results in a huge range of solder joint size and contour curvature in different areas. Traditional phase consistency algorithms use a fixed center wavelength and fixed filter scale parameters internally to extract frequency domain features. Faced with the data distribution of drastic scale changes caused by different package forms, the fixed-parameter filter cannot dynamically adapt, resulting in the omission of microscopic defect features due to the excessively large scale when inspecting ultra-small solder joints, and the breakage of continuous contour features due to the excessively small scale when inspecting large solder joints. Summary of the Invention

[0005] To address the technical problem of the inability to properly extract multiple packaging forms with a fixed scale, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a machine vision-based method for detecting solder joint defects on PCB panels. The process includes: acquiring a panoramic image of the PCB panel; extracting local solder joint images from the panoramic image based on component coordinate data and dimensional boundary parameters; determining the gradient-weighted geometric center based on the gradient magnitude distribution of each pixel in the local solder joint image; using the gradient magnitude as a weight to perform a weighted calculation on the distance from each pixel to the gradient-weighted geometric center to obtain a morphological reference span index; extracting the second derivative of the local solder joint image using the Laplacian operator; performing a ratio calculation between the second derivative and the morphological reference span index to obtain a curvature energy density index reflecting the structural complexity per unit physical span; performing a logarithmic decay operation based on the curvature energy density index to obtain a dynamic wavelength adjustment factor for driving filter scaling; performing scale calibration on the frequency domain filter parameters in the phase consistency algorithm based on the dynamic wavelength adjustment factor to obtain an adaptive multi-package form hyper-light immune filter; and using the hyper-light immune filter to perform frequency domain adaptive scaling filtering and inverse Fourier transform response processing on the local solder joint image to obtain a phase consistency response map, calculate the center offset, and identify offset defects.

[0007] This invention determines the gradient-weighted geometric center and obtains the morphological reference span index by utilizing the gradient magnitude of each pixel in the local image of the solder joint. It also evaluates the curvature energy density index using the second derivative to obtain the dynamic wavelength adjustment factor. This enables the scaling calibration of the frequency domain filter parameters in the phase consistency algorithm, allowing the obtained specular immune filter to adapt to solder joint packaging shapes of different sizes. This reduces the interference of specular reflection from the solder joint surface on edge extraction and improves the feature representation capability of the phase consistency response map under complex lighting conditions.

[0008] Preferably, the formula for calculating the morphological reference span index is: ; As a morphological benchmark span index; For pixels Feature weights; This is a local image of the solder joint; x represents the horizontal coordinate of any pixel in the local image of the solder joint; y represents the vertical coordinate of any pixel in the local image of the solder joint. The lateral coordinates of the gradient-weighted geometric center point representing the local image of the solder joint; The vertical coordinates of the gradient-weighted geometric center point of the local image of the solder joint.

[0009] This invention uses the feature weights of pixels to perform weighted calculations on the distance of each pixel relative to the gradient weighted geometric center to obtain a morphological reference span index. This can accurately assess the physical distribution breadth of solder joints in the image space, allowing subsequent parameter adjustments to be evaluated based on the actual pixel distribution density. This reduces the interference caused by solder joint edge burrs or isolated noise points on the overall scale determination.

[0010] Preferably, the curvature energy density index is calculated using the following formula: In the formula, Curvature energy density index; As a morphological benchmark span index; Coordinates in a local image of a solder joint The second derivative; R(D) is the derivative of the second derivative of the second derivative of the second derivative of the second derivative of the third derivative of the second derivative of the third derivative of the fourth ... Centered on the morphological reference span A circular constraint region with radius [radius value]. This is a local image of the solder joint; a represents the horizontal coordinate of any pixel within the circular constraint region; b represents the vertical coordinate of any pixel within the circular constraint region. The lateral coordinates of the gradient-weighted geometric center point representing the local image of the solder joint; The vertical coordinates of the gradient-weighted geometric center point of the local image of the solder joint.

[0011] This invention obtains the curvature energy density index by calculating the ratio of the second derivative of the effective area of ​​the local image of the solder joint to the morphological reference span index. This can assess the structural complexity per unit physical span, enabling the subsequently generated dynamic wavelength adjustment factor to accurately reflect the microscopic morphological changes on the solder joint surface and reducing the inconsistency in characteristic response caused by differences in solder joint size.

[0012] Preferably, the formula for calculating the dynamic wavelength adjustment factor is: In the formula, This is a dynamic wavelength adjustment factor; The wavelength constant of the basic filter response; E is the energy density normalization reference coefficient; E is the curvature energy density index. It is a non-zero positive constant reference value determined by the optical resolution of the system hardware.

[0013] This invention achieves nonlinear dynamic compensation for the center frequency of the filter by performing logarithmic attenuation calculation on the curvature energy density index and obtaining the dynamic wavelength adjustment factor in combination with the optical resolution of the system hardware. This enables the filter to automatically adjust the perceived spatial scale according to the energy distribution of the solder joint structure, reducing the feature omissions that occur when fixed parameter filters are faced with small solder joints or large pads.

[0014] Preferably, the calculation formula for the high-light immune filter is: In the formula, For high-light immune filters; It is the angular frequency variable; This is a dynamic wavelength adjustment factor; To maintain a constant ratio for controlling the bandwidth of the filter; For natural logarithm operations; It is an exponential function.

[0015] This invention utilizes a dynamic wavelength adjustment factor to construct a high-brightness immune filter. By combining an angular frequency variable with a constant ratio constant that controls the filter's bandwidth for exponential calculation, the filter exhibits excellent selectivity in the frequency domain. This suppresses extremely high-frequency noise generated by specular reflection from the solder surface and reduces the negative impact of bright spots on the determination of the physical contour of the solder joint.

[0016] Preferably, the high-light immune filter is implemented using a logarithmic Gaussian filter.

[0017] Preferably, the step of obtaining the phase consistency response map includes: mapping the local image of the solder joint to the frequency domain through a two-dimensional fast Fourier transform, and then performing convolution response processing with a specular immune filter; subsequently, performing an inverse Fourier transform to extract the amplitude and phase information of each frequency component, and calculating the convergence degree of the phases of all effective frequency components to obtain the final phase consistency response map.

[0018] This invention converts the local image of the solder joint to the frequency domain for convolutional response processing and performs inverse Fourier transform to extract phase information to calculate the degree of phase convergence. This enables feature extraction using phase consistency information rather than simply gray-level gradients, and can obtain feature expressions that are insensitive to changes in illumination, reducing the situation where the solder joint contour is not clearly extracted due to varying ambient light intensity.

[0019] Preferably, the center offset is the Euclidean distance between the centroid coordinates of the region where the pixel grayscale value in the phase consistency response map is significantly higher than that of the background and the design reference coordinates.

[0020] Preferably, the defect identification means that if the center offset exceeds the maximum offset threshold, the system determines it as an offset defect and marks it.

[0021] In a second aspect, the present invention provides a PCB panel solder joint defect detection system based on machine vision, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned PCB panel solder joint defect detection method based on machine vision is implemented.

[0022] By adopting the above technical solution, the above-mentioned machine vision-based PCB panel solder joint defect detection method is generated into a computer program and stored in a memory so that it can be loaded and executed by a processor. In this way, a terminal device can be made based on the memory and processor for convenient use.

[0023] The beneficial effects of this invention are as follows: This invention determines the gradient-weighted geometric center and obtains the morphological reference span index by utilizing the gradient magnitude of each pixel in the local image of the solder joint. It also evaluates the curvature energy density index using the second derivative to obtain the dynamic wavelength adjustment factor. This enables the scaling calibration of the frequency domain filter parameters in the phase consistency algorithm, allowing the obtained specular immune filter to adapt to solder joint packaging shapes of different sizes. This reduces the interference of specular reflection from the solder joint surface on edge extraction and improves the feature representation capability of the phase consistency response map under complex lighting conditions. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the PCB panel solder joint defect detection method based on machine vision in this invention; Figure 2 These are original images of a localized area of ​​a PCB affected by strong specular reflection. Figure 3 This is the result of processing using a traditional phase consistency algorithm with fixed scale parameters; Figure 4 This is the phase consistency response diagram after processing by the adaptive multi-encapsulation high-light immune filter proposed in this invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0027] This invention discloses a machine vision-based method for detecting solder joint defects on PCB panels, referring to... Figure 1 This includes steps S1-S5: S1: Obtain a panoramic view of the PCB and extract local images of solder joints.

[0028] In this embodiment, an initial panoramic image of the PCB panel to be inspected is acquired using an automated optical inspection device. The initial panoramic image contains a mixture of components with various package types. Subsequently, the system reads the PCB design file corresponding to the PCB panel and obtains the known PCB coordinate data. Based on the component center coordinates and package size boundary parameters in the PCB coordinate data, a region of interest is delineated on the initial panoramic image, using the center coordinates of each component as a reference. Finally, each region of interest is cropped from the panoramic image and subjected to grayscale conversion and Gaussian smoothing noise reduction processing, thereby accurately segmenting and generating multiple independent local images of solder joints.

[0029] S2: Determine the weighted geometric center based on the gradient magnitude distribution of the local image of the weld point, and calculate the morphological reference span index.

[0030] Because strong metallic reflections disrupt edge continuity, it's impossible to rely on extracting the complete solder joint outline to calculate its actual size. Therefore, it's necessary to utilize the dispersion of discrete pixels with significant brightness variation rates within the local image of the solder joint to characterize its true physical duty cycle. The formula for calculating the morphological reference span index is as follows:

[0031] It serves as a morphological reference span index, characterizing the physical extension scale of the weld joint in two-dimensional image space; For pixels The feature weights, i.e., points The gradient magnitude; strong metallic reflections can produce false edges, by introducing The system assigns high weights only to points with significant brightness change rates, while ignoring noise in smooth background areas; This is a local image of the solder joint; x represents the horizontal coordinate of any pixel in the local image of the solder joint; y represents the vertical coordinate of any pixel in the local image of the solder joint. The lateral coordinates of the gradient-weighted geometric center point representing the local image of the solder joint; The vertical coordinates of the gradient-weighted geometric center point of the local image of the solder joint.

[0032] It should be noted that this formula is essentially a spatial divergence weighted calculation; the morphological benchmark span index The squared physical distance of discrete gradient pixels from the gradient weighted geometric center changes positively and dynamically. When the detected solder joint package size is larger and spreads wider outwards, the proportion of gradient amplitude distributed in the region far from the center increases accordingly. As shown in the formula, the squared physical distance term in the numerator increases significantly at this time, leading to a significant increase in the calculated morphological reference span index. The larger the value, the more effectively and accurately it reflects the spatial extension of a specific solder joint.

[0033] S3: The second derivative is extracted using the Laplace operator, and the curvature energy density index is constructed by combining the span index.

[0034] Considering that the tiny pins of small devices are typically accompanied by steep and abrupt changes in solder curvature, while the pads of large through-hole components exhibit a gentle and sparse curvature transition, it is necessary to evaluate the structure frequency within the constraints of the form factor span; the formula for calculating the curvature energy density index is as follows:

[0035] In the formula, Curvature energy density is an index used to evaluate the structural complexity of the weld joint surface within a unit space. It serves as a morphological reference span index, characterizing the physical extension scale of the weld joint in two-dimensional image space; Coordinates in a local image of a solder joint The second derivative; by capturing the second-order changes in image brightness, it highly sensitively highlights the curvature extrema and structural abrupt change regions in three-dimensional climbing; R(D) is the second derivative of the curve within the region Ω. Centered on the morphological reference span A circular constraint region with radius [radius value]. This is a local image of the solder joint; a represents the horizontal coordinate of any pixel within the circular constraint region; b represents the vertical coordinate of any pixel within the circular constraint region. The lateral coordinates of the gradient-weighted geometric center point representing the local image of the solder joint; The vertical coordinates of the gradient-weighted geometric center point of the local image of the solder joint.

[0036] For example, the second derivative obtained based on the Laplacian operator can highly sensitively highlight the curvature change region in 3D climbing, while the distance decay weight function with Gaussian distribution is used to effectively suppress edge-irrelevant noise interference far from the gradient weighting geometric center.

[0037] Specifically, within a defined effective integration region, if the object being detected has a fine and complex structure, its local curvature changes drastically and are concentrated, leading to a significant increase in the second derivative. The cumulative value rises rapidly; due to The smaller the value, the weaker the average effect on the denominator, ultimately leading to... The value has increased significantly.

[0038] It should be noted that when dealing with large solder joints with a very large span but a smooth surface, although the integral terms accumulate, high-frequency abrupt changes are rare, and the area squared term is pre-loaded. A large average; the resulting The indicators will decrease significantly, thus accurately distinguishing the broad and flat macro structure.

[0039] S4: Perform logarithmic attenuation calculation on the curvature energy density index to generate a dynamic wavelength adjustment factor.

[0040] In order for the Log-Gabor filter in the phase consistency algorithm to extract complete morphological features, the wavelength of the frequency domain filter must be precisely matched with the actual spatial geometric frequency of the solder joint. Therefore, the formula for calculating the dynamic wavelength adjustment factor is as follows:

[0041] In the formula, The dynamic wavelength adjustment factor is a core scale parameter directly embedded in the frequency domain filter, used to match the geometric frequency of different package solder joints in real time. The wavelength constant of the basic filter response represents the initial scale reference preset by the system. If this constant is set too low, the filter will be too sensitive to small reflective noise, generating a large number of invalid pseudo-features; if it is set too high, the basic resolution of the system will decrease, making it easy to miss microscopic defect features. Therefore, the reasonable value range of this constant is 3 to 5. In this embodiment, it is preferably set to 4. This value balances noise suppression and feature recognition, ensuring both the ability to capture the underlying structure and the stability of the reference scale. In other embodiments, the implementer can flexibly adjust it within the range according to the pixel accuracy of the vision hardware. The reference coefficient for energy density normalization is used to eliminate the influence of dimensions and keep the logarithmic function dimensionless. Its value is determined by the system during the calibration phase based on the average curvature energy density of the standard pads. E is the curvature energy density index, used to evaluate the complexity of the three-dimensional physical structure of the solder joint surface and the frequency of curvature abrupt changes within a unit space. The reference value is a non-zero positive constant determined by the optical resolution of the system hardware. If this value is set too small, the denominator may approach zero when the curvature energy density index is high, causing calculation value jitter or system crash. If it is set too large, the sensitivity of the dynamic adjustment factor will be excessively diluted, resulting in the wavelength not being able to accurately match the geometric frequency of the solder joint. Therefore, the reasonable range of this value is 0.1 to 0.3. In this embodiment, it is preferably set to 0.2. This value, while taking into account the stability of the algorithm value and the hardware resolution compensation, prevents calculation abnormalities and ensures the linear smoothness of parameter adjustment. In other embodiments, the implementer can adjust this reference value within the range according to the specific optical performance of the vision hardware.

[0042] It should be noted that when the system detects that the curvature energy density index is caused by micro-packaged components... When the value increases sharply, the reciprocal term inside the formula The value shrinks and approaches zero; at this point, the overall ratio of the logarithmic terms decreases, causing the output dynamic wavelength adjustment factor to... The energy density index is simultaneously reduced to a smaller value to precisely match the detection requirements of high-frequency microstructures; conversely, when facing large packages with gently sloping solder joints, the curvature energy density index is reduced. When decreasing, the reciprocal term The significant increase, coupled with the improvement of several internal ratios, promotes the dynamic wavelength adjustment factor. This expansion ensures that the filter can fully cover and extract a wide range of low-frequency smooth contour features, effectively preventing the normal contour from breaking.

[0043] S5: Based on the dynamic wavelength adjustment factor, the frequency domain filter parameters of the calibration phase consistency algorithm are scaled to construct a high-light immune filter; finally, the filter is used for adaptive scaling filtering and inverse Fourier transform to obtain the phase consistency response map, and the accurate identification of solder joint offset defects is achieved by calculating the center offset.

[0044] The generated dynamic wavelength adjustment factor is fully integrated into the core phase consistency algorithm to construct a hyper-light immune filter with adaptive multi-encapsulation characteristics. This filter performs adaptive scaling filtering on the input signal in the frequency domain. The hyper-light immune filter is implemented using a logarithmic Gaussian filter, and its calculation formula is as follows:

[0045] In the formula, As a high-light immune filter, its transfer function determines the gain distribution of the frequency domain signal, and it can penetrate the high-frequency metal reflection on the surface of lead-free solder to extract the underlying physical structure. Angular frequency is a variable representing the frequency coordinates of a local image of a solder joint after being mapped to the frequency domain via a two-dimensional Fast Fourier Transform (FFT). As a dynamic wavelength adjustment factor, it directly controls the offset of the filter response center, so that the filter scale is precisely aligned with the actual spatial geometric frequency of the current solder joint; A constant ratio is used to control the bandwidth of the filter. If the ratio is too small, the filter bandwidth will be too narrow, resulting in insufficient overlap between adjacent bandwidths and potentially causing distortion or missing contours in the reconstructed image signal. If the ratio is too large, the bandwidth will be too wide, easily introducing irrelevant high-frequency noise and weakening the accuracy of feature extraction. Therefore, the reasonable range for this constant ratio is 0.5 to 0.65. In this embodiment, it is set to 0.55. This value balances signal integrity and noise robustness, ensuring appropriate overlap between bandwidths to prevent distortion while also ensuring accurate focusing of morphological features. In other embodiments, the implementer can flexibly adjust the ratio within the range according to the hardware precision. The natural logarithm operation is used to define the log-normal distribution characteristics of the Log-Gabor filter on a logarithmic scale. As an exponential function, an envelope feature was constructed in which the filter amplitude decays in a Gaussian manner with frequency shift.

[0046] The calculation formula introduces a dynamic wavelength adjustment factor. Replacing the fixed parameters in traditional algorithms, the response center of the Gaussian filter envelope can be determined according to... The product relationship automatically aligns with the critical structural frequencies of the solder joints; for micro-devices, smaller... The driving filter employs a compact high-frequency envelope to precisely target micro-cracks; for macroscopic devices, larger... The driving filter is directed to the low-frequency envelope, ensuring the continuity of the large-size pad outline; the phase convergence of the frequency components is calculated by frequency domain dot product and inverse Fourier transform, and the resulting phase consistency response map shows the strong specular reflection of the natural immune metal surface.

[0047] After mapping the local image of the solder joint to the frequency domain through a two-dimensional fast Fourier transform, it is convolved with a high-light immune filter for response processing. Then, an inverse Fourier transform is performed to extract the amplitude and phase information of each frequency component, and the convergence of the phases of all effective frequency components is calculated to obtain the final phase consistency response map.

[0048] After obtaining the final phase consistency response map, the system makes a final judgment on defects by comparing the deviation between the feature gradient weighted geometric center of the solder joint and the design reference coordinates. Using the phase consistency response map output in the previous step, the actual physical contour of the solder joint is extracted through image binarization processing, and the centroid coordinates of the area with a pixel gray value significantly higher than the background are automatically calculated. The system compares the centroid coordinates of the extracted area with a pixel gray value significantly higher than the background with the PCB design reference coordinates stored in the system in advance, and calculates the Euclidean distance between the two, which is the center offset.

[0049] Specifically, the calculated center offset is correlated with the actual width of the component pin. If the center offset exceeds the maximum offset threshold of the component pin width, the system determines that the solder joint has an offset defect. The maximum offset threshold is used to define whether the solder joint position accuracy has the physical boundary of reliable electrical connection and mechanical strength. Since there is a clear proportional relationship between the center offset and the pin width, if the maximum offset threshold is set too small, it may lead to misjudging small alignment deviations within the normal production process tolerance as unacceptable, increasing unnecessary rework and reducing production line efficiency. If it is set too large, it may miss the fact that the pin has significantly deviated from the pad, resulting in insufficient contact area. Misalignment defects weaken the reliability of circuit boards in complex environments, posing potential quality and safety hazards to electronic products. Therefore, the reasonable range for the maximum offset threshold is set between 0.2 and 0.4 of the pin width, referencing industry standards. In this embodiment, it is set to 0.3. The setting of 0.3 is based on balancing detection sensitivity and the actual SMT placement process tolerance, avoiding overly stringent requirements that could lead to misjudgments while ensuring effective identification of functional alignment defects, thus achieving a balance between detection accuracy and production operability. In other embodiments, implementers can flexibly adjust the maximum offset threshold within the range according to the fineness of component packaging and product reliability requirements.

[0050] It should be noted that for solder joints identified as having offset defects, the system will immediately mark them in red in the panoramic image and record the defect location, offset value, and corresponding package type for reference in subsequent rework processes.

[0051] For example, Figure 2 These are original images of a localized area of ​​a PCB affected by strong specular reflection. They clearly show a typical multi-package mixed scene, with micron-level micro pads in the upper left corner and centimeter-level large connector pads on the right and below. Due to the smooth metallic properties of the lead-free solder surface, strong high-gloss overflow and reflected light spots are generated under ring light illumination, which seriously obscures the true physical contours of the solder joints, especially causing visual interference to micro-structures. This is a typical working condition in which conventional grayscale gradient algorithms fail.

[0052] For example, Figure 3 This is the result of processing with a traditional phase consistency algorithm using fixed scale parameters. Because the filter cannot adapt to the spatial frequency distribution of solder joints of different sizes, it results in two defects: at micro pads, the filter scale is too large and smooths out the micro details, causing the micro defect features to be lost; at large connector pads, the filter scale is too small and destroys the low-frequency phase synchronization, causing the outline to break.

[0053] For example, Figure 4This is the phase consistency response map after processing by the adaptive multi-package high-light immune filter proposed in this invention. By dynamically adjusting the wavelength adjustment factor to match the geometric scale of the solder joint in real time, it successfully achieves a balance between size, fully preserves the details of the micro pads, and ensures that the outline of the large pads is continuous without breaks. At the same time, only a very small amount of unstructured noise remains, which does not affect the recognition of the main features. This result fully verifies the robustness and high-precision extraction capability of this invention under complex optical environments and extremely variable packaging forms, and completely breaks through the fixed scale limitation of traditional algorithms.

[0054] This invention also discloses a PCB panel solder joint defect detection system based on machine vision, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the PCB panel solder joint defect detection method based on machine vision according to this invention is implemented.

[0055] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

Claims

1. A machine vision-based method for detecting solder joint defects on PCB panels, characterized in that, include: Acquire a panoramic image of the PCB panel, and extract local images of solder joints from the panoramic image of the PCB panel based on component coordinate data and size boundary parameters; The gradient-weighted geometric center is determined based on the gradient magnitude distribution of each pixel in the local image of the weld joint; and the gradient magnitude is used as a weight to calculate the distance from each pixel to the gradient-weighted geometric center, thus obtaining the morphological reference span index. The second derivative of the local image of the weld point is extracted using the Laplacian operator. The second derivative is then compared with the morphological reference span index to obtain the curvature energy density index, which reflects the structural complexity per unit physical span. Logarithmic attenuation calculations are performed based on the curvature energy density index to obtain the dynamic wavelength adjustment factor used to drive the scale scaling of the filter. Based on the dynamic wavelength adjustment factor, the frequency domain filter parameters in the phase consistency algorithm are scaled to obtain an adaptive multi-encapsulation form of high-light immune filter. A high-light immune filter is used to perform frequency domain adaptive scaling filtering and inverse Fourier transform response processing on the local image of the solder joint to obtain a phase consistency response map, calculate the center offset, and identify the offset defect.

2. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The formula for calculating the morphological reference span index is: As a morphological benchmark span index; For pixels Feature weights; This is a local image of the solder joint; x represents the horizontal coordinate of any pixel in the local image of the solder joint; y represents the vertical coordinate of any pixel in the local image of the solder joint. The lateral coordinates of the gradient-weighted geometric center point representing the local image of the solder joint; The vertical coordinates of the gradient-weighted geometric center point of the local image of the solder joint.

3. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The formula for calculating the curvature energy density index is: In the formula, Curvature energy density index; As a morphological benchmark span index; Coordinates in a local image of a solder joint The second derivative; R(D) is the derivative of the second derivative of the second derivative of the second derivative of the second derivative of the third derivative of the second derivative of the third derivative of the fourth ... Centered on the morphological reference span A circular constraint region with radius [radius value]. This is a local image of the solder joint; a represents the horizontal coordinate of any pixel within the circular constraint region; b represents the vertical coordinate of any pixel within the circular constraint region. The lateral coordinates of the gradient-weighted geometric center point representing the local image of the solder joint; The vertical coordinates of the gradient-weighted geometric center point of the local image of the solder joint.

4. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The formula for calculating the dynamic wavelength adjustment factor is: In the formula, This is a dynamic wavelength adjustment factor; The wavelength constant of the basic filter response; E is the energy density normalization reference coefficient; E is the curvature energy density index. It is a non-zero positive constant reference value determined by the optical resolution of the system hardware.

5. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The formula for calculating the high-light immune filter is: In the formula, For high-light immune filters; It is the angular frequency variable; This is a dynamic wavelength adjustment factor; To maintain a constant ratio for controlling the bandwidth of the filter; For natural logarithm operations; It is an exponential function.

6. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The high-light immune filter is implemented using a logarithmic Gaussian filter.

7. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The process of obtaining the phase consistency response map includes: mapping the local image of the solder joint to the frequency domain through a two-dimensional fast Fourier transform, and then performing convolution response processing with a high-light immune filter; subsequently, performing an inverse Fourier transform to extract the amplitude and phase information of each frequency component, and calculating the convergence degree of the phases of all effective frequency components to obtain the final phase consistency response map.

8. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The center offset is the Euclidean distance between the centroid coordinates of the region where the pixel grayscale value is significantly higher than the background in the phase consistency response image and the design reference coordinates.

9. The PCB panel solder joint defect detection method based on machine vision according to claim 1, characterized in that, The defect identification method is that if the center offset exceeds the maximum offset threshold, the system will determine it as an offset defect and mark it.

10. A PCB panel solder joint defect detection system based on machine vision, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the machine vision-based PCB panel solder joint defect detection method according to any one of claims 1-9.