Online detection method and system for flatness of PCB bonding pad based on machine vision
By using machine vision technology and utilizing multi-directional, multi-polarization, and multi-wavelength optical response data sequences, combined with optical acquisition equipment and height relationship models, real-time and accurate detection of PCB board pad flatness was achieved, solving the problem of inaccurate detection in existing technologies.
Patent Information
- Application Number
- CN202511445384.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-11
AI Technical Summary
Existing PCB board pad inspection technologies cannot provide real-time, accurate flatness assessments and are easily affected by human error and equipment wear.
A machine vision-based approach is adopted, which triggers multiple positioning light sources in different directions under a unified coordinate system by connecting optical acquisition devices to obtain optical response data sequences with multiple directions, multiple polarizations, and multiple wavelengths. The pads are divided into multiple sub-regions, and feature data of reflection characteristics and brightness change trends are extracted. Flatness is then detected by combining regional features with a height relationship model.
It enables real-time and accurate detection of PCB board pad flatness, solving the problem of inaccurate evaluation in existing technologies.
Smart Images

Figure CN120907472A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of online detection, and particularly relates to a PCB pad flatness online detection method and system based on machine vision. BACKGROUND
[0002] In modern electronic manufacturing industry, PCB (Printed Circuit Board) is a crucial basic component in electronic devices, and the pad flatness directly affects the welding quality and the assembly and performance of subsequent components. However, the existing PCB pad detection technology has many problems. The traditional pad flatness detection method mainly depends on manual inspection or mechanical contact measurement, which cannot provide real-time and accurate flatness evaluation, and is easily affected by human operation errors and equipment wear and tear. SUMMARY
[0003] The present application provides a PCB pad flatness online detection method and system based on machine vision, which is used to solve the technical problem that the prior art cannot accurately and timely detect the surface flatness of the PCB pad.
[0004] In view of the above problems, the present application provides a PCB pad flatness online detection method and system based on machine vision.
[0005] The first aspect of the present application provides a PCB pad flatness online detection method based on machine vision, which comprises: connecting an optical acquisition device, triggering a plurality of positioning light sources in different directions in a unified coordinate system, each light source in a direction has a preset polarization direction and wavelength combination, and obtaining a multi-direction, multi-polarization and multi-wavelength coded optical response data sequence; according to the geometric center and shape of the pad, each pad is divided into a plurality of pad sub-regions corresponding to the incident direction of the light source; in each pad sub-region, the feature data reflecting the surface reflection characteristics and brightness change trend of the region are extracted based on the collected optical response data sequence; the feature data of each pad sub-region is input into a pre-established region feature and height relationship model to obtain the relative height estimate value of the region; the relative height estimate value is positioned and spliced based on the positional relationship of the pad sub-regions to obtain the flatness detection index.
[0006] The second aspect of the present application provides a PCB pad flatness online detection system based on machine vision, which comprises: The data acquisition module is configured to connect an optical acquisition device, trigger a plurality of positioning light sources in different directions in sequence in a unified coordinate system, each light source in a direction has a preset polarization direction and wavelength combination, and obtain a multi-direction, multi-polarization, and multi-wavelength coded optical response data sequence; the division module is configured to divide each pad into a plurality of pad sub-regions corresponding to the incident direction of the light source according to the geometric center and shape of the pad; the feature extraction module is configured to extract, in each pad sub-region, feature data reflecting the surface reflection characteristics and brightness variation trend of the region based on the acquired optical response data sequence; the height estimation module is configured to input the feature data of each pad sub-region into a pre-established region feature-height relationship model to obtain a relative height estimation value of the region; and the positioning splicing module is configured to position and splice the relative height estimation values based on the positional relationship of the pad sub-regions to obtain a flatness detection index.
[0007] The one or more technical solutions provided in the present application have at least the following technical effects or advantages: The present application connects an optical acquisition device, triggers a plurality of positioning light sources in different directions in sequence in a unified coordinate system, each light source in a direction has a preset polarization direction and wavelength combination, and obtains a multi-direction, multi-polarization, and multi-wavelength coded optical response data sequence; each pad is divided into a plurality of pad sub-regions corresponding to the incident direction of the light source according to the geometric center and shape of the pad; in each pad sub-region, feature data reflecting the surface reflection characteristics and brightness variation trend of the region are extracted based on the acquired optical response data sequence; the feature data of each pad sub-region is input into a pre-established region feature-height relationship model to obtain a relative height estimation value of the region; and the relative height estimation values are positioned and spliced based on the positional relationship of the pad sub-regions to obtain a flatness detection index. The present application solves the technical problem that the prior art cannot accurately and in real time detect the flatness of the pad surface of a PCB, and achieves the technical effect of accurately and in real time detecting the flatness of the pad by using multi-direction, multi-polarization, and multi-wavelength optical response data sequences and combining machine vision technology to extract surface reflection characteristics and estimate height. BRIEF DESCRIPTION OF DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0009] Figure 1 A flowchart of the online detection method of the flatness of the pad of a PCB based on machine vision provided by the embodiments of the present application is shown. Figure 2This is a schematic diagram of the structure of the online detection system for PCB board pad flatness based on machine vision provided in the embodiments of this application.
[0010] Figure labeling: Data acquisition module 11, segmentation module 12, feature extraction module 13, height estimation module 14, localization and stitching module 15. Detailed Implementation
[0011] This application provides a machine vision-based online detection method and system for PCB board pad flatness, addressing the technical problem that existing technologies cannot accurately and in real-time detect the surface flatness of PCB board pads. By utilizing multi-directional, multi-polarization, and multi-wavelength optical response data sequences, combined with machine vision technology, surface reflection characteristics are extracted and height is estimated, achieving the technical effect of real-time and accurate detection of pad flatness.
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0013] It should be noted that any variation of the terms "comprising" and "having" is intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such processes, methods, products, or devices.
[0014] Example 1, as Figure 1 As shown, this application provides a machine vision-based online detection method for PCB board pad flatness, the method comprising: Step S100: Connect the optical acquisition device and trigger multiple positioning light sources in different directions in sequence under a unified coordinate system. Each light source has a preset polarization direction and wavelength combination to obtain an optical response data sequence with multi-directional, multi-polarization, and multi-wavelength encoding.
[0015] In this embodiment, a pre-prepared optical acquisition device is first connected. This device sequentially triggers multiple light sources positioned at different locations within a unified coordinate system. Each light source has a specific polarization direction and wavelength combination, acquiring optical response data of the pads. Each time a light source is triggered, its orientation, polarization direction, and wavelength parameters are recorded in real time, forming an optical response data sequence containing multi-directional, multi-polarization, and multi-wavelength information.
[0016] Further, the method provided by the application embodiment further comprises: The optical acquisition device comprises a telecentric lens, a plane array camera, and a multi-directional light source controlled to trigger.
[0017] In the application embodiment, the optical acquisition device comprises a telecentric lens, a plane array camera, and a multi-directional light source controlled to trigger. The plane array camera is responsible for capturing the optical image of the pad surface, and the telecentric lens ensures the image acquisition accuracy under different light source angles, avoiding the parallax problem caused by the change of the light source. The multi-directional light source controlled to trigger is arranged at different directions and has a preset polarization direction and wavelength combination. Each time the light source is triggered, the light source irradiates the pad surface, and the plane array camera records the corresponding optical response data according to the irradiation condition of the light source.
[0018] Further, in the method provided by the application embodiment, the step of acquiring the multi-directional, multi-polarization, and multi-wavelength encoded pad optical response data sequence further comprises: In a unified coordinate system, a plurality of light sources arranged at different directions are triggered in sequence, each light source having a preset polarization direction and wavelength combination; at each time the light source is triggered, the pad optical response data corresponding to the irradiation condition of the light source is acquired, and the direction, polarization direction, and wavelength parameters of the light source are recorded in real time; the optical response data acquired under different light source irradiation are aligned through pixel-level geometric registration to eliminate the parallax offset caused by the switching of the light source; based on a standard reflector or a reference pad, the optical response data are subjected to brightness normalization and spectral response correction, each optical response data after registration and correction is combined with the direction, polarization direction, and wavelength of the corresponding light source to form an encoded optical response data sequence that can be used for subsequent feature extraction.
[0019] In the application embodiment, when the optical acquisition device acquires the optical response data of the pad surface through the plane array camera and the telecentric lens, a plurality of light sources arranged at different directions are triggered in sequence in a unified coordinate system. Each light source has a specific polarization direction and wavelength combination, for example, one light source is set to a horizontal polarization direction and a blue wavelength of 450 nm, and another light source uses a vertical polarization direction and a red wavelength of 650 nm.
[0020] At each time the light source is triggered, the plane array camera acquires the optical response data of the pad surface in cooperation with the telecentric lens. At this time, the optical response image of the pad is recorded, and the irradiation parameters such as the direction, polarization direction, and wavelength of each light source are recorded in real time. For example, the direction of light source A is 30 degrees, the polarization direction is horizontal, and the wavelength is 450 nm; the direction of light source B is 60 degrees, the polarization direction is vertical, and the wavelength is 650 nm.
[0021] Subsequently, in order to eliminate the parallax offset that may be generated when the light source is switched, a feature matching method is used to perform pixel-level geometric registration alignment on the optical response data collected under different light source irradiation. Specifically, first, a feature detection algorithm (such as the SIFT algorithm) is used to identify feature points in the image, which are corner points or edges in the image. Next, a feature matching algorithm (such as the nearest neighbor matching method) is used to correspond the feature points from different images one by one, thereby determining the relative positional relationship between the images. Then, a least squares method or RANSAC algorithm is used to calculate the transformation matrix between the images, which describes how one image is aligned with another image through translation, rotation, scaling, and other transformations. Finally, an interpolation algorithm (such as the bilinear interpolation method) is used to transform the image, rearranging each pixel in the image according to the position of the transformation matrix, ensuring that the images can be aligned in a unified coordinate system and eliminating the parallax offset generated by the switching of the light source.
[0022] After completing the registration, the collected optical response data is subjected to brightness normalization and spectral response correction using a standard reflector plate or reference pad. The purpose of brightness normalization is to eliminate the brightness differences caused by different light sources or environmental factors (such as changes in light intensity). By comparing the collected data with the known reflectance of the standard reflector plate, the brightness of different images is adjusted to conform to a unified standard, ensuring consistency in brightness among all data. At the same time, during spectral response correction, errors caused by device or light source wavelength differences are eliminated by comparing the known reflectance characteristics of the reference pad, ensuring consistency in response among all data under different wavelength conditions.
[0023] Finally, after completing geometric registration, brightness normalization, and spectral response correction, each optical response data is combined with its corresponding light source orientation, polarization direction, and wavelength to establish a combined identifier. These identifiers clearly indicate the irradiation conditions of each data point. For example, the identifier for light source A may be "30° horizontal polarization 450nm", and the identifier for light source B may be "60° vertical polarization 650nm". In this way, a corresponding identifier is created for each optical response data, ultimately forming a sequence of encoded optical response data containing all necessary information.
[0024] Step S200: According to the geometric center and shape of the pad, each pad is divided into multiple pad sub-regions corresponding to the incident direction of the light source.
[0025] In the embodiments of the present application, when the pad is divided according to its geometric center and shape, the center position of the pad is first located, and its outline is determined. Then, in combination with the orientation of the light source incidence, the pad is divided into multiple pad sub-regions corresponding to the incident direction of each light source.
[0026] Further, the method provided by the application embodiment further comprises: On any reference optical response data collected, the geometric center and the contour shape of the pad are automatically located by using edge detection; according to the direction of light source incidence, each pad is divided into a plurality of pad sub-regions corresponding to the direction of light source, in combination with the geometric center and the contour shape; boundary smoothing and morphological processing are performed on the division result, so as to ensure that the pixel range of each pad sub-region is continuous and has no overlap.
[0027] In the application embodiment, first, the geometric center and the contour shape of the pad are automatically located on the collected reference optical response data by using an edge detection algorithm (such as Canny edge detection). Through Canny edge detection, the edges in the image are identified, and then the contour shape of the pad is extracted. Then, based on the extracted contour shape of the pad, the geometric center of the pad is determined by using a centroid calculation method. This process first decomposes the contour into a plurality of discrete edge points, and then calculates the average positions of the edge points on the X axis and the Y axis, so as to obtain the geometric center coordinates of the pad.
[0028] Then, according to the direction of light source incidence, each pad is divided into a plurality of pad sub-regions corresponding to the direction of light source, in combination with the geometric center and the contour shape of the pad. In this process, different incidence angles of the light source are mapped into the pad coordinate system, and the pad is divided into a plurality of sub-regions according to each direction of the light source. Each sub-region corresponds to the illumination direction of the light source, so as to ensure that each region can reflect the reflection characteristics of the pad surface under the illumination of the light source.
[0029] After the region division is completed, boundary smoothing and morphological processing are performed on each pad sub-region. The boundary smoothing removes the irregular jagged shape of the region boundary by using an algorithm such as Gaussian blur, so that the boundary becomes smoother and more continuous. Then, morphological processing is performed, including erosion and dilation operations. In the erosion operation, the noise points of the region boundary are removed, and the boundary of the region is reduced. In the dilation operation, the region boundary is expanded, and the gaps caused by noise or irregular shape are filled. Through these processing steps, it is ensured that the pixel range of each sub-region is continuous and has no overlap, so as to improve the accuracy and stability of the region division.
[0030] Further, the method provided by the application embodiment further comprises: The geometric center coordinates, the contour, and the principal axis direction of the pad are acquired, and a pad coordinate system is established with the geometric center as the coordinate origin and the principal axis direction as the rotation reference. The incident directions of the light sources are mapped to the pad coordinate system to determine the basic sector partitions corresponding to the directions of the light sources. Based on historical failed detection samples, the relative positions of defects in the pad geometric coordinate system are mapped to the current pad shape, and the defect-prone areas are independently divided in the basic sectors. The brightness response modes under irradiation of different light source directions are analyzed, and the incident angle of the light and the angle between the edge normal are calculated in combination with the pad contour and the principal axis direction to detect the intersection influence area of the light and the pad structure, in which the insufficient area is determined. The basic sectors, the defect-prone areas, and the insufficient areas are merged according to a preset priority to generate a comprehensive partition mask, and the partition mask is associated with the incident directions of the light sources to establish a correlation tag, and the area is segmented according to the correlation tag.
[0031] In the embodiments of the present application, first, the geometric center coordinates, the contour, and the principal axis direction of the pad are acquired through optical response data. The geometric center is the center point of the pad surface, the contour is the boundary shape of the pad, and the principal axis direction is the main symmetry direction of the pad. These information are automatically extracted through image processing technology (such as edge detection algorithm). According to these data, a pad coordinate system is established with the geometric center as the coordinate origin and the principal axis direction as the rotation reference.
[0032] Then, the incident directions of each light source are mapped to the pad coordinate system. Specifically, the incident angle of each light source is converted to the relative angle in the pad coordinate system. For example, if the incident direction of light source A is 45 degrees, it is converted to the relative direction in the pad coordinate system relative to the principal axis direction of the pad coordinate system, to ensure that the irradiation angle of each light source can be accurately reflected in the pad coordinate system. Based on these mapping results, the pad is divided into multiple basic sectors, and each sector corresponds to the incident direction of a light source.
[0033] Then, the relative positions of defects in the pad geometric coordinate system in the historical failed detection samples are mapped to the shape of the current pad. In the historical samples, some areas may frequently appear defects due to insufficient reflection or uneven pad surface. By mapping the relative positions of these historical defect areas to the geometric coordinate system of the current pad, the areas that are also likely to have defects in the current pad are identified. Finally, these defect-prone areas are independently divided in each basic sector.
[0034] Afterwards, the reflectivity of the pad is evaluated by analyzing the brightness response pattern under different light source orientations. The illumination of each light source affects the reflected brightness of the pad surface, and the brightness response pattern of the pad is evaluated through these reflection data. Combined with the contour of the pad and the principal axis direction, the angle between the incident angle of the light and the edge normal is calculated. The edge normal refers to the direction perpendicular to the edge of the pad surface, and the angle between the incident angle of the light and the edge normal reflects the interaction between the light and the pad surface. If the incident angle is small, the light almost vertically illuminates, and the reflection signal is strong; if the incident angle is large, the light deviates from the normal, and the reflection signal is weak. Specifically, in the calculation, first, the angle between the light source direction vector and the pad edge normal vector is calculated. For example, assuming that the incident direction of the light is L=(1, 0, 0), and the edge normal direction of the pad is N=(0, 1, 0), then the dot product between the light and the normal is By calculating the dot product and the vector length, the angle is obtained as 90°, indicating that there is a large deviation between the light and the normal, and the reflection signal is weak. Through this calculation, it is identified which areas of the pad surface are shaded and which areas have insufficient reflection due to a large incident angle of the light. The identified areas are marked as insufficient areas, i.e. areas with poor light quality. The insufficient area refers to an area where the reflection effect of the light is poor under certain light source directions, resulting in a low brightness response of the area. The optical data quality of these areas is poor, and if not identified separately, it will affect the flatness calculation of the entire pad.
[0035] Finally, according to the preset priority, the basic sectors, defect-prone areas and insufficient areas are merged to generate a comprehensive partition mask. Each area is given a different priority according to its importance and quality in flatness detection, ensuring that high-quality areas are given priority, while low-quality areas are specially identified and processed. Each partition mask is associated with a light source orientation label to ensure that each area is correctly evaluated and analyzed according to the incident direction of the light source.
[0036] Step S300: In each pad sub-region, feature data reflecting the surface reflectivity and brightness variation trend of the region are extracted based on the collected optical response data sequence.
[0037] In the embodiments of the present application, in each sub-pad area, based on the collected optical response data sequence, feature data reflecting the surface reflection characteristics and brightness change trend of the area are extracted. Specifically, first, by reading the optical response data sequence, each optical response data is matched with its collection parameters according to the combination identification of light source orientation, polarization direction and wavelength. Then, under the same light source orientation, the response difference under different polarization directions is calculated to identify the specular reflection area. Then, under the same light source orientation, the response difference of different wavelengths is calculated to identify the possible material difference or pollution area. In addition, the brightness change mode under different light source orientations is fused to extract the directional brightness difference feature reflecting the local tilt or warping. Finally, all these polarization-related features, wavelength-related features and directional brightness difference features are combined into the feature vector of the sub-pad area, which is the feature data reflecting the surface reflection characteristics and brightness change trend of the area.
[0038] Further, the method provided by the embodiments of the present application extracts feature data reflecting the surface reflection characteristics and brightness change trend of the area based on the collected optical response data sequence, and further includes: reading the optical response data sequence, matching each optical response data with its collection parameters according to the combination identification of light source orientation, polarization direction and wavelength; under the same light source orientation, calculating the response difference under different polarization directions to identify the specular reflection area; under the same light source orientation, calculating the response difference of different wavelengths to identify the material difference or pollution area; fusing the brightness change mode under different light source orientations to extract the directional brightness difference feature reflecting the local tilt or warping; and combining the polarization-related features, wavelength-related features and directional brightness difference features to form the feature vector of the sub-pad area.
[0039] In the embodiments of the present application, first, the optical response data sequence is read, which is from the light source irradiation under multi-direction, multi-polarization and multi-wavelength conditions. Each optical response data records the reflection information of the pad surface under a specific light source irradiation condition, and each optical response data is matched with its corresponding collection parameters according to the combination identification of light source orientation, polarization direction and wavelength. In this way, each data is accurately associated with the specific conditions (such as light source angle, polarization state and wavelength) at the time of collection.
[0040] Subsequently, the response difference under different polarization directions is calculated in the same light source orientation. Specifically, the reflection intensity of the pad surface varies with the polarization state of the light. In this process, the difference in reflection intensity of the pad surface under different polarization directions (such as 0°, 45°, 90° polarization angles) is calculated. The specular reflection region shows a large difference in reflection intensity under different polarization angles, because the reflection of light in these regions is very strong and directional, while the reflection of the diffuse reflection region is relatively uniform, and the polarization direction has less effect on the reflection intensity. By calculating the change of the reflection response under different polarization angles, the specular reflection region, i.e. the region with significant difference in reflection intensity, is identified, which usually has a smooth surface.
[0041] At the same time, the response difference under different wavelengths is calculated in the same light source orientation, aiming to identify material differences or contaminated regions. The reflection intensity of the pad surface under illumination of light of different wavelengths will be different, because different materials have different reflection characteristics for light of different wavelengths. In addition, contaminants or surface impurities may also cause changes in reflection signals under different wavelengths. Therefore, by calculating the response difference of the reflection signal under different wavelengths (such as red, green, blue, etc.), material differences or contaminated regions that may exist are identified. For example, some materials may reflect weakly at a certain wavelength, while other wavelengths reflect strongly, and contaminated regions may exhibit abnormal reflection intensity at a specific wavelength.
[0042] Then the reflection brightness change pattern under different light source orientations is fused to extract the directional brightness difference features, which help to identify local tilting or warping. The unevenness of the pad surface (such as tilting or warping) will cause the reflection brightness to change significantly under different light source orientations. By calculating the brightness response difference under different light source directions (such as 0°, 45°, 90°, etc.), the directional brightness difference features reflecting the local tilting or warping of the surface are extracted. For example, in the tilted region, the brightness difference under different light source directions may be large, while in the flat region, the brightness difference is small. Through this process, the uneven regions of the surface are identified.
[0043] Finally, the polarization-related features, wavelength-related features, and directional brightness difference features are combined to form the feature vector of the pad sub-region. These feature vectors integrate the reflection characteristics, brightness change trend, material differences, and surface morphology changes of the pad surface.
[0044] Step S400: input the feature data of each pad sub-region into the pre-established region feature and height relationship model to obtain the relative height estimate of the region.
[0045] In the embodiments of the present application, the feature vector of each sub-area of the solder pad is input into a pre-calibrated area feature and height relationship model. The model is trained by known height data of a standard template and can map each feature vector to a relative height estimate of the area. Based on the feature data, height mapping analysis is performed to output the relative height estimate of each sub-area of the solder pad, and these data are bound with the spatial position label of the sub-area of the solder pad, thereby realizing accurate evaluation of the flatness of the solder pad surface.
[0046] Further, in the method provided by the embodiments of the present application, the feature data of each sub-area of the solder pad is input into a pre-established area feature and height relationship model to obtain the relative height estimate of the area, and the method further comprises: The feature vector of each sub-area of the solder pad is input into a pre-calibrated area feature and height relationship model. The model is trained by known height data of a standard template and can map each feature vector to a relative height estimate of the area. Based on the feature data of the sub-area of the solder pad, height mapping analysis is performed to output the relative height data of the sub-area of the solder pad and bind the data with the spatial position label of the sub-area of the solder pad.
[0047] In the embodiments of the present application, the feature vector of each sub-area of the solder pad is input into a pre-calibrated area feature and height relationship model. The training process of the area feature and height relationship model is based on a known standard template, that is, an accurately measured solder pad sample. The relative height of each area of the standard template is obtained by an accurate measuring tool, such as a laser scanner or a contact measuring instrument. In the training process, the known relative height of each area in the standard template is matched with the feature data (such as reflection intensity, brightness difference, polarization response, etc.) of the area. Through comparison of these data, the area feature and height relationship model learns how each feature vector affects the relative height of the area. Specifically, these training data are processed by regression analysis or machine learning algorithms (such as support vector machines), thereby establishing a mapping relationship from the feature vector to the relative height.
[0048] By inputting the feature vector of each sub-area of the solder pad into the pre-calibrated area feature and height relationship model for processing, the relative height data of the sub-area of the solder pad is obtained, which is the relative height estimate of the area.
[0049] Then, the relative height estimate of each sub-area of the solder pad is bound with its spatial position label. The spatial position label is an identification associated with the specific position of the sub-area of the solder pad, ensuring that the height data of each area correspond to the actual position, so that the height estimate of each area can be accurately mapped to the three-dimensional spatial position of the solder pad surface.
[0050] Step S500: positionally splice the relative height estimation value based on the positional relationship of the sub-pad areas, to obtain a flatness detection index.
[0051] In the embodiments of the present application, when the relative height estimation value is positionally spliced based on the positional relationship of the sub-pad areas, first, weights are assigned to the relative height estimation values of each sub-pad area according to the feature stability of each sub-pad area, and the height data at the junction of adjacent areas is smoothed, to obtain pad height distribution data. Then, based on the processed height distribution data, an overall reference plane is fitted to remove the influence of overall warping. Next, through positionally splicing, the pad height distribution data after removing the influence of warping is compared in height neighborhood according to the spatial positional relationship, and finally the height data of each area is integrated to obtain the flatness detection index of the entire pad.
[0052] Further, the method provided in the embodiments of the present application further comprises: According to the feature stability of each sub-pad area, weights are assigned to the height estimation values, and the relative height estimation values at the area junction are smoothed, to obtain complete pad height distribution data; based on the processed pad height distribution data, an overall reference plane is fitted to remove the influence of overall warping; after removing the influence of overall warping, the pad height distribution data is compared in height neighborhood according to the positional relationship, to obtain the flatness detection index.
[0053] In the embodiments of the present application, first, different weights are assigned to the relative height estimation values of each sub-pad area according to the feature stability of each sub-pad area. The feature stability refers to whether the reflection data of the area is consistent and reliable, and a higher weight is assigned to a region with higher stability, and vice versa. The sum of the weights of all regions is 1, to ensure the rationality of the weighted data. By assigning weights to each region, it is ensured that the more stable regions contribute more to the flatness detection. Then, based on the relative height estimation value, smoothing is performed at the junction of each region. The smoothing is a weighted average of the height data of adjacent regions according to the assigned weights, to eliminate discontinuity and mutation at the junction, so that the height data can be smoothly transitioned. For example, when the reflection stability of a region is higher and the weight is 0.7, and the weight of the adjacent region is 0.3, the relative height estimation values of the two regions at the junction are weighted and averaged according to the ratio of the two weights, to ensure a more natural transition of the data. Through this process, complete pad height distribution data is obtained.
[0054] Then, a whole-board reference plane fitting is performed based on the processed pad height distribution data. This process aims to eliminate the influence of overall warping of the pad surface. A theoretical reference plane is calculated by a fitting algorithm (such as least squares method or high-order polynomial fitting), which represents the ideal pad surface height distribution and removes the influence of overall warping or overall tilt of the pad surface. Through this process, the influence of overall warping is eliminated, and the pad height distribution data after removing the influence of warping is obtained.
[0055] After removing the influence of overall warping, the data is compared and spliced based on the pad height distribution data and spatial position relationship, and the height data of each region is seamlessly integrated through positioning splicing, so that the neighborhood height distribution is obtained.
[0056] Finally, based on the neighborhood height distribution, the peak-valley difference, root mean square roughness or array coplanarity and other key indicators are calculated. These calculation methods are used to quantify the height variation and unevenness of the pad surface. Then, the peak-valley difference, root mean square roughness or array coplanarity is taken as the flatness detection index, and compared with the preset threshold value, and finally the detection result is obtained.
[0057] Further, the method provided by the application embodiment further comprises: Based on the neighborhood height distribution, the peak-valley difference, root mean square roughness or array coplanarity is calculated; the peak-valley difference, root mean square roughness or array coplanarity is taken as the flatness detection index, and the flatness detection index is compared with the preset threshold value to obtain the detection result.
[0058] In the application embodiment, a plurality of key flatness indicators are first calculated based on the neighborhood height distribution, including the peak-valley difference, the root mean square roughness and the array coplanarity.
[0059] In the calculation of the peak-valley difference, the height difference between the highest point and the lowest point of each pad sub-region is first calculated to obtain the peak-valley difference. This indicator quantifies the maximum degree of unevenness of the surface in the region. For example, if the highest point of a certain region is 5 μm and the lowest point is -3 μm, the peak-valley difference of the region is 8 μm. In the calculation of the root mean square roughness, the standard deviation of the pad surface height value relative to the average height of the region is calculated to quantify the slight fluctuation of the surface. The root mean square roughness reflects the overall fluctuation of the surface. For example, if the height data of a certain pad sub-region is {2 μm, 3 μm, 4 μm}, the average value is 3 μm, and the calculated root mean square roughness is 0.82 μm, indicating that the surface of the region has moderate slight fluctuation.
[0060] Array coplanarity evaluates whether multiple sub-areas of the solder pad are in the same plane. By calculating the height difference of these areas and fitting a reference plane, it is determined whether the height distribution of each area is flat. For example, if the height difference of multiple areas is small, it indicates that the solder pad surface is relatively flat, otherwise there may be unevenness or warping.
[0061] Next, the peak-valley difference, root mean square fluctuation and array coplanarity are used as flatness detection indexes to quantify the flatness state of the solder pad surface.
[0062] Finally, the obtained flatness detection indexes are compared with the preset threshold value. The preset threshold value is a numerical value set according to the flatness requirement of the solder pad, industry standard or engineering specification. If the calculated detection index exceeds the preset threshold value, it is determined that the solder pad surface has unevenness, warping or other defects. For example, if the peak-valley difference exceeds 10 μm, it is considered that there is a large unevenness in the area; if the root mean square fluctuation exceeds 1 μm, the surface fluctuation is large, which affects the quality of the solder pad. By comparing these flatness indexes with the preset threshold value, the final detection result is obtained, indicating whether the flatness of the PCB pad meets the preset requirements.
[0063] In the embodiments of the present application, as described above, the embodiments of the present application have at least the following technical effects: The optical acquisition device is connected, multiple positioning light sources in different directions are triggered in turn in a unified coordinate system, each light source in a direction has a preset polarization direction and wavelength combination, and a multi-direction, multi-polarization and multi-wavelength coded optical response data sequence is obtained. According to the geometric center and shape of the solder pad, each solder pad is divided into multiple solder pad sub-areas corresponding to the incident direction of the light source. In each solder pad sub-area, feature data reflecting the surface reflection characteristics and brightness change trend of the area is extracted based on the acquired optical response data sequence. The feature data of each solder pad sub-area is input into a pre-established area feature and height relationship model to obtain a relative height estimate value of the area. The relative height estimate value is positioned and spliced based on the positional relationship of the solder pad sub-areas to obtain a flatness detection index. The present application solves the technical problem that the existing technology cannot accurately and timely detect the flatness of the PCB pad surface. By using a multi-direction, multi-polarization and multi-wavelength optical response data sequence and combining machine vision technology, surface reflection characteristics extraction and height estimation are achieved to achieve the technical effect of real-time and accurate detection of solder pad flatness.
[0064] Embodiment two, based on the same inventive concept as the machine vision-based PCB pad flatness online detection method in the preceding embodiments, as shown in Figure 2 The present application provides a machine vision-based PCB pad flatness online detection system, and the system and method embodiments in the present application are based on the same inventive concept. The system comprises: The data acquisition module 11 is configured to connect an optical acquisition device, trigger a plurality of positioning light sources in different directions in sequence in a unified coordinate system, each light source in a direction has a preset polarization direction and wavelength combination, and obtain a multi-direction, multi-polarization, and multi-wavelength coded optical response data sequence; the division module 12 is configured to divide each pad into a plurality of pad sub-regions corresponding to the incident direction of the light source according to the geometric center and shape of the pad; the feature extraction module 13 is configured to extract, in each pad sub-region, feature data reflecting the surface reflection characteristics and brightness variation trend of the region based on the acquired optical response data sequence; the height estimation module 14 is configured to input the feature data of each pad sub-region into a pre-established region feature-height relationship model to obtain a relative height estimation value of the region; and the positioning splicing module 15 is configured to positionally splice the relative height estimation values based on the positional relationship of the pad sub-regions to obtain the flatness detection index.
[0065] Further, the system is further configured to implement the following functions: According to the feature stability of each pad sub-region, the height estimation value is weighted, and the relative height estimation values are smoothed at the region boundary to obtain complete pad height distribution data; based on the processed pad height distribution data, a whole plate reference plane is fitted to remove the influence of overall warping; after removing the influence of overall warping, height neighborhood comparison and splicing are performed according to the positional relationship of the pad height distribution data to obtain the flatness detection index.
[0066] Further, the system is further configured to implement the following functions: Based on the neighborhood height distribution, the peak-valley difference, root mean square fluctuation, or array coplanarity is calculated; the peak-valley difference, root mean square fluctuation, or array coplanarity is taken as the flatness detection index, and the flatness detection index is compared with a preset threshold to obtain a detection result.
[0067] Further, the system is further configured to implement the following functions: The optical response data sequence is read, each piece of optical response data is matched with its acquisition parameters according to the combination of the light source direction, polarization direction, and wavelength; under the same light source direction, the response difference of different polarization directions is calculated to identify the specular reflection region; under the same light source direction, the response difference of different wavelengths is calculated to identify the material difference or pollution region; the brightness variation mode under different light source directions is fused to extract a directional brightness difference feature reflecting local tilt or warping; and the polarization-related feature, wavelength-related feature, and directional brightness difference feature are combined to form a feature vector of the pad sub-region.
[0068] Further, the system is further configured to implement the following functions: The optical acquisition device comprises a telecentric lens, a plane array camera and a multi-directional light source controlled to trigger.
[0069] Further, the system is also used to realize the following functions: On any reference optical response data collected, the geometric center and contour shape of the pad are automatically located by edge detection; according to the direction of light source incidence, in combination with the geometric center and contour shape, each pad is divided into a plurality of pad sub-regions corresponding to the direction of light source; boundary smoothing and morphological processing are performed on the partitioning result to ensure that the pixel range of each pad sub-region is continuous and has no overlap.
[0070] Further, the system is also used to realize the following functions: The geometric center coordinates, contour shape and principal axis direction of the pad are obtained, and a pad coordinate system is established with the geometric center as the coordinate origin and the principal axis direction as the rotation reference; the incidence direction of the light source is mapped to the pad coordinate system to determine the basic sector partition corresponding to each light source direction; based on historical detection failure samples, the relative position of the defect in the pad geometric coordinate system is mapped to the current pad shape, and the defect high-occurrence area is independently divided in the basic sector; the brightness response mode under illumination of different light source directions is analyzed, and the light incidence angle and edge normal angle are calculated in combination with the pad contour and principal axis direction to detect the intersection influence area of the light and the pad structure, wherein the insufficient area is determined; the basic sector, the defect high-occurrence area and the insufficient area are merged according to the preset priority to generate a comprehensive partition mask, and the partition mask is associated with the light source direction to establish a correlation label, and the area is segmented according to the correlation label.
[0071] Further, the system is also used to realize the following functions: A plurality of light sources arranged at different directions are triggered in sequence in a unified coordinate system, each light source having a preset polarization direction and wavelength combination; when each light source is triggered, the optical response data of the pad corresponding to the illumination condition of the light source is collected, and the light source direction, polarization direction and wavelength parameters are recorded in real time; the optical response data collected under illumination of different light sources is aligned at the pixel level for geometric registration to eliminate parallax offset caused by light source switching; based on a standard reflector or a reference pad, the optical response data is subjected to brightness normalization and spectral response correction, each piece of optical response data after registration and correction is combined with the light source direction, polarization direction and wavelength corresponding thereto to establish a combined identifier, and an encoded optical response data sequence that can be used for subsequent feature extraction is formed.
[0072] Further, the system is also used to realize the following functions: The feature vector of each sub-pad area is input into a pre-calibrated area feature and height relationship model, wherein the area feature and height relationship model is trained by known height data of a standard template, and can map the feature vector into a relative height estimation value of the area; height mapping analysis is performed according to the feature data of the sub-pad area, and relative height data of the sub-pad area is output and bound with the spatial position label of the sub-pad area.
[0073] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. The above describes a specific embodiment of the present application. The processes depicted in the drawings do not necessarily require the specific order and continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0074] The above only describes the preferred embodiments of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0075] The specification and drawings are merely exemplary of the present application, and any and all modifications, variations, combinations or equivalents that fall within the scope of the present application are considered to be covered by the present application. Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application belong to the scope of the present application and its equivalent technology, the present application is intended to include these modifications and variations.
Claims
1. A PCB pad flatness online detection method based on machine vision, characterized in that, The method comprises the following steps: connecting an optical acquisition device, triggering a plurality of positioning light sources in different directions in turn under a unified coordinate system, each light source in a direction having a preset polarization direction and wavelength combination, and obtaining a multi-direction, multi-polarization and multi-wavelength coded optical response data sequence; dividing each pad into a plurality of pad sub-regions corresponding to the light source incident direction according to the geometric center and shape of the pad; extracting feature data reflecting the surface reflection characteristics and brightness change trend of each pad sub-region based on the acquired optical response data sequence; inputting the feature data of each pad sub-region into a pre-established region feature-height relationship model to obtain the relative height estimate value of the region; positioning and splicing the relative height estimate value based on the positional relationship of the pad sub-regions to obtain the flatness detection index. 2.The method of claim 1, wherein The method for obtaining the flatness detection index comprises the following steps: assigning a weight to the height estimate value according to the feature stability of each pad sub-region, and performing smoothing processing on the relative height estimate value at the region boundary to obtain complete pad height distribution data; fitting a whole plate reference plane based on the processed pad height distribution data to remove the influence of overall warping; after removing the influence of overall warping, performing height neighborhood comparison and splicing according to the positional relationship of the pad height distribution data to obtain the flatness detection index. 3.The method of claim 2, wherein, The method for obtaining the flatness detection index comprises the following steps: calculating the peak-valley difference, root mean square fluctuation or array coplanarity based on the neighborhood height distribution; taking the peak-valley difference, root mean square fluctuation or array coplanarity as the flatness detection index, and comparing the flatness detection index with a preset threshold to obtain a detection result.
4. The method for online detecting flatness of PCB pad based on machine vision according to claim 1, characterized in that, The method for extracting feature data reflecting the surface reflection characteristics and brightness change trend of each pad sub-region based on the acquired optical response data sequence comprises the following steps: reading the optical response data sequence, and matching each optical response data with its acquisition parameters according to the combination of light source direction, polarization direction and wavelength; calculating the response difference of different polarization directions under the same light source direction to identify the specular reflection region; calculating the response difference of different wavelengths under the same light source direction to identify the material difference or contaminated region; fusing the brightness change mode under different light source directions to extract the directional brightness difference feature reflecting local tilt or warping; combining the polarization-related feature, wavelength-related feature and directional brightness difference feature to form the feature vector of the pad sub-region.
5. The method for online detecting flatness of PCB pad based on machine vision according to claim 1, characterized in that, The optical acquisition device comprises a telecentric lens, a face array camera and a multi-direction light source control trigger.
6. The method of claim 1, wherein the method further comprises: The method for dividing each pad into a plurality of pad sub-regions corresponding to the light source incident direction according to the geometric center and shape of the pad comprises the following steps: automatically positioning the geometric center and contour shape of the pad on any reference optical response data acquired by edge detection; dividing each pad into a plurality of pad sub-regions corresponding to the light source direction according to the geometric center and contour shape; performing boundary smoothing and morphological processing on the division result to ensure that the pixel range of each pad sub-region is continuous and has no overlap.
7. The method according to claim 6, wherein, According to the direction of the light source, combined with the geometric center and the contour shape, each pad is divided into a plurality of pad sub-regions corresponding to the direction of the light source, including: Obtain the geometric center coordinates, contour shape and principal axis direction of the pad, and establish a pad coordinate system with the geometric center as the coordinate origin and the principal axis direction as the rotation reference; Map the incident direction of the light source to the pad coordinate system to determine the basic sector partition corresponding to each light source direction; Based on the historical detection failure samples, map the relative position of the defect in the pad geometric coordinate system to the current pad shape, and independently divide the high-defect area in the basic sector; Analyze the brightness response mode under different light source directions, and calculate the angle between the light incident angle and the edge normal based on the pad contour and the principal axis direction to detect the intersection area of the light and the pad structure, wherein the insufficient area is determined; Merge the basic sector, high-defect area and insufficient area according to the preset priority, generate a comprehensive partition mask, and associate the partition mask with the light source direction to establish a label, and perform region segmentation according to the associated label. 8.The method of claim 1, wherein, Obtain a multi-direction, multi-polarization, and multi-wavelength encoded pad optical response data sequence, including: Trigger a plurality of light sources arranged in different directions in a unified coordinate system, each light source having a preset polarization direction and wavelength combination; When each light source is triggered, collect the pad optical response data corresponding to the illumination conditions of the light source, and record the light source direction, polarization direction and wavelength parameters in real time; Align the optical response data collected under different light source illuminations at the pixel level to eliminate the parallax offset caused by light source switching; Based on a standard reflector or a reference pad, normalize the brightness and correct the spectral response of the optical response data, and establish a combined identification for each aligned and corrected optical response data and its corresponding light source direction, polarization direction and wavelength to form an encoded optical response data sequence that can be used for subsequent feature extraction. 9.The method of claim 1, wherein, Input the feature data of each pad sub-region into the pre-established region feature and height relationship model to obtain the relative height estimate value of the region, including: Input the feature vector of each pad sub-region into the pre-calibrated region feature and height relationship model, wherein the region feature and height relationship model is trained by the known height data of the standard template, and can map the feature vector to the relative height estimate value of the region; According to the feature data of the pad sub-region, perform height mapping analysis to output the relative height data of the pad sub-region, and bind the spatial position label of the pad sub-region.
10. A PCB pad flatness online detection system based on machine vision, characterized in that, The system is used to perform the machine vision-based PCB pad flatness online detection method as claimed in any one of claims 1-9, and the system comprises: A data acquisition module is used to connect an optical acquisition device, trigger a plurality of positioning light sources in different directions in a unified coordinate system, each light source in a direction having a preset polarization direction and wavelength combination, and obtain a multi-direction, multi-polarization, and multi-wavelength encoded optical response data sequence; A division module is used to divide each pad into a plurality of pad sub-regions corresponding to the incident direction of the light source according to the geometric center and shape of the pad. The feature extraction module is configured to extract feature data reflecting surface reflection characteristics and brightness change trend of each sub-pad area based on the collected optical response data sequence; The height estimation module is configured to input the feature data of each sub-pad area into a pre-established area feature-height relationship model to obtain a relative height estimation value of the area; The positioning and splicing module is configured to position and splice the relative height estimation values based on the positional relationship of the sub-pad areas to obtain the flatness detection index.
Citation Information
Patent Citations
Circuit board welding fault identification method and system based on machine vision
CN119648679A
Circuit board detection method and system based on machine vision
CN120451153A
Intelligent mobile phone defect detection method and system
CN120558973A
Solder paste defect detection method based on machine vision
CN120726016A
Method for non-destructive optical and visual testing of items by means of computer vision
RU2777718C1
Cited By
Method for improving warpage of PCB (Printed Circuit Board)
CN122170791A