A method for quickly registering point clouds of PCB boards
By compensating for the point cloud data of the PCB board and calculating the relative height difference, and combining it with the PCB schematic diagram for rapid registration, the problems of large computational load and missing point cloud data in the point cloud data processing of the PCB board are solved, and the accurate positioning and identification of components are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-04-14
AI Technical Summary
Existing point cloud data processing methods on PCB boards suffer from problems such as high computational load, high requirements for training data, and registration errors caused by missing point clouds, making it difficult to effectively identify the position and height information of components.
By compensating the PCB board point cloud data, selecting K dispersed components as registration references, calculating the relative height difference for point cloud registration, and combining this with the PCB schematic diagram for rapid positioning and detection, errors caused by missing point clouds are avoided.
It enables rapid registration of PCB board point cloud data, reduces computational load and hardware costs, improves registration speed and robustness, and ensures the accuracy of point cloud data for components, solder, and pins.
Smart Images

Figure CN115471532B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of industrial product anomaly detection, specifically relating to a method for rapid point cloud registration of PCB boards. Background Technology
[0002] Product anomaly detection is a crucial application of machine vision in the industrial field. Through image processing and point cloud data processing, defects and anomalies in industrial products are identified, enabling fully automated screening of qualified products, thereby improving product pass rates and achieving more stringent and effective quality control. PCB board defect and anomaly detection is a significant area within industrial anomaly detection. In PCB board defect detection, missing components, incorrect component types, substandard soldering, and non-compliant pins are all key factors affecting product quality. While obvious defects such as missing components and incorrect component types can be identified through 2D image processing, defects like substandard soldering and non-compliant pins require 3D point cloud information. This is because the identification involves not only the horizontal position of the component on the PCB board but also the height information of the solder and pins, making simple identification from 2D images impossible.
[0003] In the process of 3D point cloud information processing, point cloud data registration is required. Existing point cloud data processing methods focus more on using machine learning to achieve point cloud segmentation and registration, which has the drawbacks of extremely high computational cost and high requirements for training data. Secondly, compared with 2D planar imaging, 3D point cloud imaging is affected by component occlusion. Therefore, at the edges of components and at the junctions of two components, point cloud gaps caused by occlusion are prone to occur. This gap leads to the loss and anomalies of the originally continuous and reliable height dimension information of the point cloud data, causing errors in point cloud registration and affecting defect detection. Therefore, point cloud data compensation is necessary.
[0004] However, the amount of data in the compensated point cloud information is extremely large, and the point cloud data corresponding to the same type of component varies greatly, making it difficult to achieve accurate detection of component areas using target detection methods. Therefore, a simpler and more effective component localization method is needed. In addition, the point cloud data corresponding to the PCB board is more numerous and denser than the point cloud data in natural scenes, and the point cloud data corresponding to each component, solder, pin, etc. is less and more variable.
[0005] Current point cloud data processing methods primarily focus on segmentation, registration, and detection / recognition techniques for large-object point cloud data in natural scenes. These methods utilize data processing and machine learning to detect, locate, and identify objects. Point cloud data for natural scenes is complete and clear, with well-defined object contours and rich information for individual objects. Therefore, there is significant room for improvement in segmentation, registration, and detection / recognition methods. However, these methods are not effectively applicable to PCB board point cloud data, which often contains missing data, blurred contours, and limited information on individual objects. Therefore, the problem of rapid point cloud registration for PCB boards urgently needs to be solved. Summary of the Invention
[0006] The purpose of this invention is to provide a rapid point cloud registration method for PCB boards. First, the point cloud data is compensated. Then, K dispersed components are selected as registration references, and registration parameters are calculated based on their relative height differences. This invention does not require point cloud modeling of the target or lengthy network training, resulting in high computational speed and low hardware costs, making it highly practical. This invention achieves compensation of 3D point cloud data of PCB boards and registration detection based on point clouds and PCB schematics, thereby generating point cloud data for each component, solder, and pin, providing a stable and reliable input for subsequent point cloud data defect detection and identification.
[0007] This invention is mainly achieved through the following technical solutions:
[0008] A method for rapid point cloud registration on a PCB board includes the following steps:
[0009] Step S100: Using an industrial 3D digital camera, scan and photograph the PCB board to obtain 3D point cloud data (x i y i , z i ), i = 1, 2, 3...N;
[0010] Step S200: Compensate the point cloud data to obtain complete point cloud data without missing data for point cloud registration;
[0011] Step S300: Extract the center coordinates (x, y) of K dispersed components on the PCB board. i y i ) and height h i And used as a registration reference value, where K > 5;
[0012] Step S400: First, calculate the height difference H between every two components:
[0013] H = {h} i -h j}i≠j (11)
[0014] For each bias (Δx, Δy), calculate the height h′ of the corresponding component:
[0015] h′=z(Δx+x,Δy+y) (12)
[0016] Calculate the height difference H′ between the components corresponding to this offset:
[0017] H′={h′ i -h′ j}i≠j (14)
[0018] Calculate the difference δ between H and H′:
[0019] δ=||HH′||2 (15)
[0020] The offset corresponding to the smallest difference δ is the registration coordinate (Δx). * Δy * This allows for point cloud registration.
[0021] To better realize the present invention, step S300 further includes the following steps:
[0022] Step S301: Set K to be the product of two integers, i.e., K = P × Q, where the values of P and Q are as close as possible;
[0023] Step S302: Divide the area on the PCB board into P×Q sub-regions, and then randomly select a component for each sub-region.
[0024] To better implement the present invention, in step S302, if any sub-region has no component, a component is randomly selected from the sub-region that has been selected the fewest times to supplement it.
[0025] To better implement this invention, further, in step S400, if the x-axis range and y-axis range of the point cloud data are respectively [x 3D [0, y] and [0, y] 3D The x-axis range of all selected point clouds is [x min x max The range of the y-axis is [y min y max The range of the bias is:
[0026]
[0027] To better implement this invention, further, in step S400, assuming the center coordinates of the component are (x', y'), then after registration, the actual position of the component on the point cloud is (x' + Δx). * ,y'+Δy* ).
[0028] To better implement the present invention, step S200 further includes the following steps:
[0029] Step S201: Transfer the point cloud data (x) from step S100 to... i ,y i ,z i First, follow x i Sort the values in ascending order by size, then sort by y. i The points are sorted in ascending order of size. The point cloud is judged to be missing based on whether there is a sudden change in the height of the point cloud. If there is a sudden change in the height of the point cloud, the point cloud is determined to be missing. If the point cloud is missing, the point cloud is compensated by linear interpolation. The height compensation of the interpolation is λ.
[0030] Step S202: Transfer the point cloud data (x) from step S100 to... i ,y i ,z i First, follow y i Sort the values in ascending order by size, then sort by x. i The points are sorted in ascending order of size. The point cloud is judged to be missing based on whether there is a sudden change in the height of the point cloud. If there is a sudden change in the height of the point cloud, the point cloud is determined to be missing. If the point cloud is missing, the point cloud is compensated by linear interpolation. The height compensation of the interpolation is λ.
[0031] Step S203: Merge the point cloud data compensated in steps S201 and S202 with the point cloud data in step S100 to obtain complete point cloud data.
[0032] To better implement this invention, the calculation formula for determining whether a point cloud is missing is further as follows:
[0033]
[0034] If flag_lack is 1, it indicates that there are missing point clouds; if flag_lack is 0, it indicates that the point cloud is complete.
[0035] Where: the coordinates of the two adjacent point clouds of the sorted missing point cloud are respectively
[0036] θ is the height difference threshold, which is determined by the height resolution of the industrial 3D camera.
[0037] Existing point cloud registration methods require 3D point cloud modeling of the target (components, solder, pins, etc.) and then use 3D machine learning to calculate the target's position and corresponding point cloud. The performance of these methods depends on the modeling performance of the 3D model, the number of models, and the number of parameters and training time of the 3D deep learning network. Modeling is time-consuming and requires a large number of models, resulting in significant training time for the 3D deep learning network. The point cloud registration method proposed in this invention only requires the center coordinates and height of K components, eliminates the need for point cloud modeling of the target, and avoids extremely long network training times. It offers faster computation speed and lower hardware costs.
[0038] The beneficial effects of this invention are as follows:
[0039] (1) Existing point cloud data processing methods focus more on using machine learning methods to achieve point cloud segmentation and registration. However, this invention first compensates for the PCB board point cloud data to avoid point cloud registration errors and point cloud recognition errors caused by missing point clouds. Then, based on the compensated point cloud and PCB schematic diagram, it achieves rapid positioning and detection of PCB components, thereby avoiding the disadvantages of existing machine learning-based methods that have a large amount of computation and high requirements for training data.
[0040] (2) In the process of registering point cloud data and PCB schematic diagram, this invention proposes a method of point cloud registration by selecting local areas and calculating the height difference between each area. Compared with the existing sliding window scanning, this invention does not need to rely on the sample point cloud data of each component, and the matching speed is faster and the robustness to the placement position and height of the components is better.
[0041] (3) The present invention adopts bidirectional point cloud compensation, which greatly improves the compensation speed under the premise of similar compensation effect compared with the existing nearest neighbor scanning method; the present invention solves the problem that the existing point cloud compensation exhaustive method has a huge amount of computation and is too slow, and the point cloud compensation speed is greatly improved.
[0042] (4) This invention employs a non-machine learning paradigm for PCB point cloud registration, combining PCB schematics and 3D point cloud data processing to rapidly calculate the point cloud positions corresponding to PCB components and extract point cloud data for each component, pin, solder, etc. This invention uses the relative height difference of components as a registration reference, eliminating the need to calculate the PCB placement height or pre-determine a priori value for the placement height. This invention performs point cloud registration based on the center position and height of some components, without relying on prior 3D point cloud modeling of each component, pin, solder, etc., and improves the registration speed, demonstrating good practicality. Attached Figure Description
[0043] Figure 1 Point cloud image of the PCB board before point cloud compensation;
[0044] Figure 2 Point cloud image of the PCB board after point cloud compensation;
[0045] Figure 3 This is a flowchart of the present invention. Detailed Implementation
[0046] Example 1:
[0047] A method for rapid point cloud registration on a PCB board includes the following steps:
[0048] Step S100: Use an industrial 3D digital camera to scan and capture the 3D point cloud data of the PCB board;
[0049] Step S200: Compensate the point cloud data to obtain complete point cloud data without missing data, making point cloud registration more accurate and effective;
[0050] Step S300: Based on the PCB schematic, extract the center position and height of the components, and select a portion of the center position and height of the components as registration reference values;
[0051] Step S400: Calculate the height difference corresponding to each pair of center positions and heights, and perform point cloud registration using the sliding window method based on the height difference;
[0052] Step S500: Based on the registration results and the PCB schematic, calculate the actual point cloud positions and point cloud data corresponding to each component, solder, pin, etc.
[0053] This invention avoids point cloud registration and recognition errors caused by missing point cloud data through point cloud data compensation. This invention performs point cloud registration by calculating the height difference between different regions, eliminating the need for sample point cloud data from individual components. It also offers faster matching speeds and better robustness to component placement and height variations.
[0054] Example 2:
[0055] A method for rapid point cloud registration on a PCB board includes the following steps:
[0056] Step S100: Using an industrial 3D digital camera, scan and photograph the PCB board to obtain 3D point cloud data (x i y i , z i ), i = 1, 2, 3...N;
[0057] Step S200: Compensate the point cloud data to obtain complete point cloud data without missing data for point cloud registration;
[0058] Step S300: Extract the center coordinates (x, y) of K dispersed components on the PCB board.i y i ) and height h i And used as a registration reference value, where K > 5;
[0059] Step S400: First, calculate the height difference H between every two components:
[0060] H = {h} i -h j}i≠j (11)
[0061] For each bias (Δx, Δy), calculate the height h′ of the corresponding component:
[0062] h′=z(Δx+x,Δy+y) (12)
[0063] Calculate the height difference H′ between the components corresponding to this offset:
[0064] H′={h′ i -h′ j}i≠j (14)
[0065] Calculate the difference δ between H and H′:
[0066] δ=||HH′||2 (15)
[0067] The offset corresponding to the smallest difference δ is the registration coordinate (Δx*, Δy*), thus achieving point cloud registration.
[0068] This invention first compensates for the point cloud data of the PCB board, avoiding point cloud registration and recognition errors caused by missing point clouds. Then, based on the compensated point cloud and the PCB schematic, it achieves rapid positioning and detection of PCB components, thus avoiding the drawbacks of existing machine learning-based methods, such as extremely high computational load and high requirements for training data. This invention proposes a method for point cloud registration by selecting local regions and calculating the height differences between regions. Compared with existing sliding window scanning, this invention does not rely on sample point cloud data of each component, has a faster matching speed, and is more robust to component placement and height.
[0069] Example 3:
[0070] A method for rapid point cloud registration on a PCB board includes the following steps:
[0071] Step 1: Extract the center coordinates (x, y) and height h of K components from the PCB schematic, where K is the corresponding parameter. The method proposed in this invention has good results when K > 5.
[0072] Preferably, the method for selecting K components is as follows: set K as the product of two integers, i.e., K = P × Q, where the values of P and Q are as close as possible. If K is 12, then P and Q are 3 and 4. Divide the PCB area into 3 × 4 sub-areas, and then randomly select a component from each sub-area. If a sub-area has no component, then randomly select a component from the sub-area that has been selected the fewest times to supplement it.
[0073] By employing the above strategy to select the center coordinates and height of components, it is ensured that the selected components are evenly distributed on the PCB board, making the matching process more stable and accurate. If the center coordinates and heights of the components are selected too densely, registration errors will occur because information from other PCB areas is not included.
[0074] Step 2: Calculate the height difference H between every two components:
[0075] H = {h} i -h j}i≠j (11)
[0076] Step 3: For each possible bias (Δx, Δy), calculate the corresponding component height h':
[0077] h′=z(Δx+x,Δy+y) (12)
[0078] Wherein, if the x-axis range and y-axis range of the 3D point cloud data are respectively [x 3D [0, y] and [0, y] 3D The x-axis range of all selected center point clouds is [x min x max The range of the y-axis is [y min, y max The range of the bias is:
[0079]
[0080] Taking the x-axis as an example, Δx changes from -x min The value is initially selected, increasing in increments of 2, with the maximum value not exceeding x. 3D-xmax ;
[0081] Step 4: Calculate the height difference H' between the components corresponding to this offset:
[0082] H′={h′ i -h′ j}i≠j (14)
[0083] Step 5: Calculate the difference between H and H':
[0084] δ=||HH′||2 (15)
[0085] For each set of offsets (Δx, Δy), the corresponding difference δ can be calculated according to Steps 3 to 5. The offset corresponding to the smallest difference δ is the registration coordinate, that is, the coordinate (Δx, Δy) on the point cloud data corresponding to the origin of the PCB schematic. * Δy * Based on the registration coordinates and the center coordinates resolved from the PCB schematic, the actual position of each component on the 3D point cloud can be calculated. Assuming the center coordinates of a component resolved from the PCB schematic are (x', y'), then the actual position of this component on the point cloud is:
[0086] (x′+Δx * y′+Δy * (16)
[0087] Existing point cloud registration methods require 3D point cloud modeling of the target (components, solder, pins, etc.) and then use 3D machine learning to calculate the target's position and corresponding point cloud. The performance of these methods depends on the modeling performance of the 3D model, the number of models, and the number of parameters and training time of the 3D deep learning network. Modeling is time-consuming and requires a large number of models, resulting in significant training time for the 3D deep learning network. The point cloud registration method proposed in this invention only requires the center coordinates and height of K components, eliminates the need for point cloud modeling of the target, and avoids extremely long network training times. It offers faster computation speed and lower hardware costs.
[0088] Example 4:
[0089] This embodiment is an optimization based on embodiments 1-3. Before point cloud registration, the point cloud data is first compensated, including the following steps:
[0090] Step 1: Convert the original point cloud data (x i y i , z i First, follow x i Sort the values in ascending order by size, then sort by y. i The points are sorted in ascending order of size. The point cloud is judged to be missing based on whether there is a sudden change in the height of the point cloud. If there is a sudden change in the height of the point cloud, the point cloud is determined to be missing. If the point cloud is missing, the point cloud is compensated by linear interpolation. The height compensation of the interpolation is λ.
[0091] Step 2: Convert the original point cloud data (x i y i , z i First, follow y i Sort the values in ascending order by size, then sort by x. iThe points are sorted in ascending order of size. The point cloud is judged to be missing based on whether there is a sudden change in the height of the point cloud. If there is a sudden change in the height of the point cloud, the point cloud is determined to be missing. If the point cloud is missing, the point cloud is compensated by linear interpolation. The height compensation of the interpolation is λ.
[0092] Step 3: Merge the compensated point cloud data from Step 1 and Step 2 with the original point cloud data to obtain complete point cloud data.
[0093] This invention employs bidirectional point cloud compensation, which significantly improves the compensation speed compared to existing nearest neighbor scanning methods while maintaining similar compensation effects. This invention also solves the problems of extremely large computational load and slow speed of existing exhaustive point cloud compensation methods, thus greatly improving the point cloud compensation speed.
[0094] The other parts of this embodiment are the same as those in Embodiments 1-3, so they will not be described again.
[0095] Example 5:
[0096] This embodiment is an optimization based on embodiments 1-3. Before point cloud registration, the point cloud data is first compensated. Let the dimension of the PCB point cloud data be:
[0097] (x i y i , z i i = 1, 2, ..., N (1)
[0098] Where N is the number of point cloud data, typically 10. 5 -10 6 x, y, and z represent the x-axis, y-axis, and z-axis coordinates (i.e., height information) of a data point.
[0099] Specifically, the following steps are included:
[0100] Step S1: Use an industrial 3D camera to scan and photograph the PCB board to obtain point cloud data (x i y i , z i i = 1, 2, ..., N;
[0101] Step S2: Transfer the point cloud data (x) from step S1 to... i y i , z i (i = 1, 2, ..., N) First, follow x i Sort the values in ascending order by x. i After sorting by size, the following conditions must be met:
[0102]
[0103] Then according to y i Sort the values in ascending order by y. i After sorting by size, the following conditions must be met:
[0104]
[0105] The point cloud is determined to be missing based on whether there is a sudden change in the point cloud height. If there is a sudden change in the point cloud height, the point cloud is determined to be missing. If the point cloud is missing, a linear interpolation method is used to compensate for the point cloud height. The interpolation height compensation is λ.
[0106] Step S3: Transfer the point cloud data (x) from step S1 to... i y i , z i (i = 1, 2, ..., N) First, follow y i Sort the values in ascending order by size, then sort by x. i The points are sorted in ascending order of size. The point cloud is judged to be missing based on whether there is a sudden change in the height of the point cloud. If there is a sudden change in the height of the point cloud, the point cloud is determined to be missing. If the point cloud is missing, the point cloud is compensated by linear interpolation. The height compensation of the interpolation is λ.
[0107] Step S4: Merge the point cloud data compensated in steps S2 and S3 with the point cloud data in step S1 to obtain complete point cloud data.
[0108] Furthermore, the formula for determining whether a point cloud is missing is as follows:
[0109]
[0110] If flag_lack is 1, it indicates that there are missing point clouds; if flag_lack is 0, it indicates that the point cloud is complete.
[0111] Where: the coordinates of the two adjacent point clouds of the sorted missing point cloud are respectively θ is the height compensation λ, which is determined by the height resolution of the industrial 3D camera.
[0112] The number of points to be compensated between two adjacent points in a missing point cloud is:
[0113]
[0114] in: This indicates rounding down by the integer part of the asterisk (*).
[0115] The compensated point cloud data is as follows:
[0116]
[0117] Existing compensation methods use a simple exhaustive search (nearest neighbor method) to make compensation decisions, and the number of decisions M is:
[0118] M = N*(N-1) (2)
[0119] The sorting computational cost P is:
[0120] P = N * logN (8)
[0121] Then, compensation based on the height difference is performed on the data in both the x and y directions, and the number of judgments Q is:
[0122]
[0123] That is, the compensation calculation quantity R proposed in this invention is:
[0124]
[0125] The function `ceil()` represents the floor function. A typical point cloud dataset N is 16 x 10^6. 4 The computational cost of existing nearest neighbor methods is approximately 16,000 times that of the compensation method proposed in this invention. Therefore, the bidirectional fast point cloud compensation method proposed in this invention greatly improves the speed of point cloud compensation.
[0126] like Figure 1 As shown, before compensation, due to the camera angle and light source angle, a large number of point clouds were missing (black areas). Figure 2 As shown, after compensation, it can be seen that the method proposed in this invention can compensate for point cloud loss caused by occlusion while preserving the height information of each component. Point cloud loss due to component occlusion and due to the large angle of the desktop can both be compensated, resulting in a more continuous point cloud. Secondly, in Figure 1 Registration was performed on the point cloud, with a registration error of 36.4 pixels. Figure 2 Registration was performed on the point cloud in the image, and the registration error was 2.7 pixels. It can be seen that the registration accuracy of the point cloud after compensation is significantly improved.
[0127] The other parts of this embodiment are the same as those of embodiments 1-3 above, so they will not be described again.
[0128] Example 6:
[0129] A rapid point cloud registration method for PCB boards utilizes an industrial 3D digital camera equipped with an active light source and lens to capture 3D point cloud data of the PCB board. The software system development platform is as follows: the operating system is Microsoft Windows 11 Home Chinese Edition. The point cloud data processing development software includes JetBrains' PyCharm Community integrated development environment (Python IDE) and Mathworks' Matlab software. The PCB schematic analysis software is Altium Designer software developed by Altium. The system uses an Intel i7 processor and an NVIDIA GetForce RTX 3050 dedicated graphics card. Figure 3 As shown, the steps include: (1) Acquisition of 3D point cloud data of PCB board.
[0130] An industrial 3D digital camera is used to capture and scan 3D point cloud data of the PCB board at appropriate distances, viewing angles, and heights. The distance at which the PCB board is placed should meet the requirements of the "Reference Distance" item in the 3D camera hardware user manual, and the shooting interval should meet the requirements of the "Scanning Speed" item in the 3D camera hardware user manual.
[0131] (2) Point cloud compensation
[0132] First, sort the data in the order of x and y to complete data reorganization. The specific method for data reorganization is as follows:
[0133] Step 1: Process all point cloud data (x i y i , z i (i = 1, 2, ..., N) First, according to x i Sort x in ascending order of size, i.e. i Smaller point clouds are placed first, x i Larger point clouds are placed last. After sorting, the following conditions must be met:
[0134]
[0135] Step 2: For the point cloud data sorted in Step 1, for point clouds with the same x value, sort them in ascending order according to the size of y, i.e., y i Smaller point clouds are listed first, y i Larger point clouds are ranked last. After sorting, the following conditions must be met:
[0136]
[0137] The sorted point cloud is (x i y i , zi (i = 1, 2, ..., N). The following formula is used to determine if the point cloud is missing:
[0138]
[0139] Here, `flag_lack` indicates whether point cloud defects exist. If `flag_lack` is 1, it means point cloud defects exist, and point cloud compensation is performed using a linear interpolation method, with the height compensation of the interpolation set to λ. If `flag_lack` is 0, it means the point cloud is complete, and no operation is performed. Preferably, θ is 0.4, and the height compensation λ is 0.03.
[0140] Hypothetical point cloud and If there is a missing point cloud between two points, the number of points to be compensated between them is:
[0141]
[0142] in, This indicates rounding down from the nearest integer.
[0143] The compensated point cloud is:
[0144]
[0145] Step 3: Process the original point cloud data (x i y i , z i For i = 1, 2, ..., N, the data is reorganized and compensated along the Y direction using the same method as described above. That is, when sorting, the data is first sorted according to the size of the y value, and then sorted according to the size of the x value.
[0146] Step 4: Merge the point cloud data from the two compensations with the original point cloud data to obtain the complete point cloud data after bidirectional compensation.
[0147] (3) Extraction of center position and height
[0148] Altium Designer software was used to extract the center positions and heights of components in the PCB schematic. K = 6 positions and heights were selected, with the selection criterion being that the six components be distributed as widely as possible on the PCB. Experiments showed that, as long as the selected six points are not very close together and their distribution range is not very narrow, the method proposed in this invention generally exhibits small differences in performance and good robustness.
[0149] (4) Point cloud registration
[0150] A sliding window method is used to calculate the corresponding δ for all possible positional offsets (Δx, Δy). In practical applications, it was found that using a sliding step size of 2-3 still yielded good registration results while reducing computational complexity. Therefore, the sliding step size was set to 3. First, the height difference H between every two components was calculated:
[0151] H = {h} i -h j}i≠j (11)
[0152] For each bias (Δx, Δy), calculate the height h′ of the corresponding component:
[0153] h′=z(Δx+x,Δy+y) (12)
[0154] Calculate the height difference H′ between the components corresponding to this offset:
[0155] H′={h′ i -h′ j}i≠j (14)
[0156] Calculate the difference δ between H and H′:
[0157] δ=||HH′||2 (15)
[0158] The offset corresponding to the smallest difference δ is the registration coordinate (Δx). * Δy * ).
[0159] (5) Calculate the coordinate positions of components and point cloud data
[0160] Assuming the center coordinates of the component are (x′, y′), then after registration, the actual position of the component on the point cloud is (x′ + Δx). * y′+Δy * According to the registration coordinates (Δx) * Δy * By combining the extracted component center position with the distance step size corresponding to the pre-known point cloud data, the actual position of the component in the point cloud is calculated. Based on the actual center position and coverage area, the point cloud data corresponding to each component, solder, pin, etc. is extracted.
[0161] like Figure 1 As shown, before compensation, due to the camera angle and light source angle, a large number of point clouds were missing (black areas). Figure 2As shown, after compensation, it can be seen that the method proposed in this invention can compensate for point cloud loss caused by occlusion while preserving the height information of each component. Point cloud loss due to component occlusion and due to the large angle of the desktop can both be compensated, resulting in a more continuous point cloud. Secondly, in Figure 1 Registration was performed on the point cloud, with a registration error of 36.4 pixels. Figure 2 Registration was performed on the point cloud in the image, and the registration error was 2.7 pixels. It can be seen that the registration accuracy of the point cloud after compensation is significantly improved.
[0162] This invention first compensates for the point cloud data of the PCB board, avoiding point cloud registration and recognition errors caused by missing point clouds. Then, based on the compensated point cloud and the PCB schematic, it achieves rapid positioning and detection of PCB components, thus avoiding the drawbacks of existing machine learning-based methods, such as extremely high computational load and high requirements for training data. This invention performs point cloud registration by selecting local regions and calculating the height differences between regions. This invention does not rely on sample point cloud data of each component, has a faster matching speed, and is more robust to component placement and height.
[0163] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for rapid point cloud registration on a PCB board, characterized in that, Includes the following steps: Step S100: Using an industrial 3D digital camera, scan and photograph the PCB board to obtain 3D point cloud data. x i , y i , z i ), i =1,2,3… N ; Step S200: Compensate the point cloud data to obtain complete point cloud data without missing data for point cloud registration; Step S300: Extract from PCB board K The center coordinates of the dispersed components ( x i , y i ) and height h i And used as a registration reference value, where K >5; Step S300 specifically includes the following steps: Step S301: Setting K Two integers P , Q The product of, where, P , Q The value should be as close as possible to; Step S302: Divide the area on the PCB board into P × Q Each sub-region is then randomly selected, and a component is chosen from each sub-region to obtain... K Individual components; Step S303: Extract the center coordinates of each component ( x i , y i ) and height hi And used as a registration reference value; Step S400: First, calculate the height difference H between every two components: (11) For each bias (Δ) x ,Δ y ), calculate the height of the corresponding component h ': (12) Note: Point cloud data x Axis range and y The axis ranges are respectively [ x 3D [, 0] and [0, y 3D ], all selected point clouds x The range of the axis is [ x min , x max ]、 y The range of the axis is [ y min , y max The range of the bias is: (13) Calculate the height difference H' between the components corresponding to this offset: (14) Calculate the difference between H and H'. δ : (15) Calculate the minimum difference δ The corresponding offset is denoted as the registration coordinate (Δ). x * ,Δ y * This allows for point cloud registration.
2. The method for rapid point cloud registration of a PCB board according to claim 1, characterized in that, In step S400, assuming the center coordinates of the component are (x', y'), then after registration, the actual position of the component on the point cloud is (x' + Δy'). x * ,y'+Δ y * ).
3. A method for rapid point cloud registration of a PCB board according to claim 1 or 2, characterized in that, Step S200 includes the following steps: Step S201: Transfer the point cloud data from step S100 ( x i , y i , z i First, follow x i Sort the values in ascending order, then sort them according to their size. y i The points are sorted in ascending order of size. The point cloud is determined to be missing based on whether there is a sudden change in the height. If there is a sudden change in the height, the point cloud is determined to be missing. If the point cloud is missing, a linear interpolation method is used to compensate for the point cloud. The height compensation of the interpolation is λ. Step S202: Transfer the point cloud data from step S100 ( x i , y i , z i First, follow y i Sort the values in ascending order, then sort them according to their size. x i The points are sorted in ascending order of size. The point cloud is determined to be missing based on whether there is a sudden change in the height. If there is a sudden change in the height, the point cloud is determined to be missing. If the point cloud is missing, a linear interpolation method is used to compensate for the point cloud. The height compensation of the interpolation is λ. Step S203: Merge the point cloud data compensated in steps S201 and S202 with the point cloud data in step S100 to obtain complete point cloud data.
4. The method for rapid point cloud registration of a PCB board according to claim 3, characterized in that, The formula for determining whether a point cloud is missing is as follows: (5) like flag_lac A value of k = 1 indicates that point cloud defects exist; like flag_lack A value of 0 indicates that the point cloud is complete; Where: the coordinates of the two adjacent point clouds of the sorted missing point cloud are respectively , ; θ The height difference threshold, θ It is determined by the height resolution of the industrial 3D digital camera.
Citation Information
Patent Citations
Rapid distance measurement method and system based on double-sided point cloud information
CN111833401A
Depth image matching method based on point cloud registration
CN112017225A