Method, apparatus, device, and storage medium for three-dimensional reconstruction of a printed circuit board
By converting the point cloud data of the printed circuit board to a quad-tree storage structure and using spatial hidden functions for three-dimensional reconstruction, the problem of processing speed and result conflict in the existing technology is solved, and real-time and accurate three-dimensional reconstruction effect is achieved.
Patent Information
- Application Number
- CN202110303214.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-22
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-03-22
AI Technical Summary
When the prior art performs three-dimensional reconstruction of printed circuit board point cloud data, the processing speed and processing results conflict, and real-time and accurate three-dimensional reconstruction cannot be achieved.
By converting the initial point cloud data to a quad-tree storage structure, the spatial hidden function of the point cloud data is determined, the zero surface is extracted for triangulation, and the three-dimensional coordinates are mapped to a two-dimensional image to obtain a textured three-dimensional surface image.
The processing speed and processing results of three-dimensional reconstruction are balanced, providing real-time and accurate three-dimensional reconstruction effects, and can effectively complete the holes in point cloud data.
Smart Images

Figure CN115115771B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of image processing, and in particular, to a method, device, equipment, and storage medium for three-dimensional reconstruction of printed circuit boards. Background Art
[0002] 3D AOI (Automatic Optic Inspection), namely 3D automatic optical inspection, is a technology that uses three-dimensional imaging methods such as binocular vision and structured light to obtain three-dimensional information, so as to detect common defects encountered in PCB (Printed Circuit Board) welding. Among them, 3D AOI users need to visualize the three-dimensional surface of the PCB in the production line in real time, which is convenient for users (quality inspectors) to observe whether there are quality problems with the PCB. Therefore, it is particularly important to perform real-time reconstruction on the three-dimensional point cloud decoded by the 3D AOI system.
[0003] In traditional three-dimensional reconstruction, triangular meshing is usually performed on the three-dimensional point cloud to obtain dense grid information, and rendering is performed through texture mapping to obtain a compact three-dimensional surface. Existing three-dimensional reconstruction methods are divided into two categories: implicit surface methods and explicit surface methods. Explicit surface methods directly solve triangular patches or obtain the three-dimensional surface through initial shape deformation. These methods are difficult to handle the situation of missing point clouds, resulting in holes in the reconstructed three-dimensional surface. Implicit surface methods usually need to define the space with implicit equations, where an isosurface approximates the input data, and the isosurface extraction method is used to visualize the surface. By defining a global equation, surface holes can be filled. However, the PCB point cloud decoded by the 3D AOI system has a large quantity and many holes, and these methods cannot achieve the purpose of real-time reconstruction.
[0004] When the inventor performs three-dimensional reconstruction on the PCB point cloud based on the existing three-dimensional reconstruction methods, it is found that there is a conflict between the processing speed requirement and the processing result requirement for three-dimensional reconstruction of point cloud data, and real-time and accurate three-dimensional reconstruction cannot be achieved. Summary of the Invention
[0005] The present invention provides a method, device, terminal device, and storage medium for three-dimensional reconstruction of printed circuit boards to solve the technical problem that there is a conflict between the processing speed requirement and the processing result requirement for three-dimensional reconstruction of point cloud data in the prior art, and real-time and accurate three-dimensional reconstruction cannot be achieved.
[0006] In a first aspect, an embodiment of the present invention provides a method for three-dimensional reconstruction of a printed circuit board, including:
[0007] According to the relative position relationship between the initial point cloud data and the reference plane, the initial point cloud data is converted into a quadtree storage structure to obtain point cloud data. The initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device;
[0008] Based on the point cloud data in the quadtree storage structure, determine the spatial implicit function of the point cloud data;
[0009] Extract the zero-value surface from the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board;
[0010] Map the three-dimensional coordinates of the three-dimensional surface of the printed circuit board to the two-dimensional image of the printed circuit board to obtain the three-dimensional surface image of the printed circuit board with texture.
[0011] In a second aspect, an embodiment of the present invention further provides a device for three-dimensional reconstruction of a printed circuit board, including:
[0012] A data conversion unit, configured to convert the initial point cloud data into a quadtree storage structure to obtain point cloud data according to the relative position relationship between the initial point cloud data and the reference plane. The initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device;
[0013] An implicit function determination unit, configured to determine the spatial implicit function of the point cloud data based on the point cloud data in the quadtree storage structure;
[0014] A zero-value surface extraction unit, configured to extract the zero-value surface from the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board;
[0015] A texture mapping unit, configured to map the three-dimensional coordinates of the three-dimensional surface of the printed circuit board to the two-dimensional image of the printed circuit board to obtain the three-dimensional surface image of the printed circuit board with texture.
[0016] In a third aspect, an embodiment of the present invention further provides a terminal device, including:
[0017] One or more processors;
[0018] A memory, configured to store one or more programs;
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for three-dimensional reconstruction of a printed circuit board as described in any one of the first aspect.
[0020] Fourthly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the method for three-dimensional reconstruction of a printed circuit board as described in any one of the first aspect.
[0021] For the above method, device, terminal device, and storage medium for three-dimensional reconstruction of a printed circuit board, according to the relative position relationship between the initial point cloud data and the reference plane, the initial point cloud data is converted into a quadtree storage structure to obtain point cloud data. The initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device. Based on the point cloud data in the quadtree storage structure, the spatial implicit function of the point cloud data is determined. The zero-value surface is extracted from the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board. The three-dimensional coordinates of the three-dimensional surface of the printed circuit board are mapped to the two-dimensional image of the printed circuit board to obtain a three-dimensional surface image of the printed circuit board with texture. By storing the point cloud data in the quadtree storage structure and using the spatial implicit function to fill the holes in the point cloud data in the quadtree storage structure, based on the spatial implicit function to completely describe the relationship between the spatial position of the point cloud data and the real surface of the printed circuit board, combined with the mapping of two-dimensional graphics to obtain a three-dimensional surface with texture, the balance between the processing speed and the processing result of three-dimensional reconstruction is achieved, and real-time and accurate three-dimensional reconstruction is provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of a method for three-dimensional reconstruction of a printed circuit board provided by an embodiment of the present invention;
[0023] Figure 2 It is a schematic diagram of the storage of point cloud data in the quadtree storage structure provided by an embodiment of the present invention;
[0024] Figure 3 It is a schematic diagram of the nearest neighbor search method in an embodiment of the present invention;
[0025] Figure 4 It is a schematic structural diagram of a device for three-dimensional reconstruction of a printed circuit board provided by an embodiment of the present invention;
[0026] Figure 5 It is a schematic structural diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] The present invention will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of convenience of description, only parts related to the present invention are shown in the drawings, rather than all the structures.
[0028] It should be noted that due to space limitations, the specification of this application does not enumerate all optional implementation manners. After reading the specification of this application, those skilled in the art should be able to think that as long as the technical features do not conflict with each other, any combination of technical features can constitute an optional implementation manner.
[0029] For example, in one implementation manner of the embodiment, a technical feature is recorded: determining the spatial implicit function of the point cloud data based on the point cloud data in the quadtree storage structure. In another implementation manner of the embodiment, another technical feature is recorded: determining the region range through the height difference and quantity of the point cloud data within the region. After reading the specification of this application, those skilled in the art should be able to think that the implementation manner having both of these two features is also an optional implementation manner, that is, after determining the region range through the height difference and quantity, determining the spatial implicit function with the point cloud data in each region.
[0030] The following will describe each embodiment in detail.
[0031] Figure 1 It is a flowchart of a method for three-dimensional reconstruction of a printed circuit board provided by an embodiment of the present invention. The method for three-dimensional reconstruction of a printed circuit board provided in the embodiment can be executed by an operating device corresponding to the method for three-dimensional reconstruction of a printed circuit board. The operating device can be implemented in a software and / or hardware manner. The operating device can be composed of two or more physical entities, or can be composed of one physical entity.
[0032] Specifically, referring to Figure 1 , the method for three-dimensional reconstruction of a printed circuit board specifically includes:
[0033] Step S110: Convert the initial point cloud data into the quadtree storage structure according to the relative position relationship between the initial point cloud data and the reference plane to obtain the point cloud data.
[0034] Among them, the initial point cloud data is obtained by a three-dimensional imaging device collecting the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device.
[0035] In the field of detection, the set of point data on the surface of the product appearance obtained by a measuring instrument is also called point cloud. Common measuring instruments such as three-dimensional coordinate measuring machines, three-dimensional laser scanners, photogrammetric scanners, etc. In terms of the detected 3D point cloud data, the number of points obtained by a three-dimensional coordinate measuring machine is generally relatively small, the distance between points is also relatively large, and the point cloud is relatively sparse; the number of points obtained by using a three-dimensional laser scanner or a photogrammetric scanner is generally relatively large, the distance between points is also relatively small, and the point cloud is relatively dense.
[0036] For different scanning objects, the point cloud data has data characteristics adapted to the specific physical form characteristics of the scanning objects. For a printed circuit board, the corresponding point cloud data is characterized by a large amount of data and a flat distribution. Traditional point cloud data storage usually uses an octree or a KD (K-Dimensional) tree for storage. For point cloud data with a large amount of data and a flat distribution, if an octree or a KD tree is used for storage, the redundant structure of the octree or KD tree will lead to low search efficiency in the subsequent specific data processing process. Therefore, in this solution, as Figure 2 shown, when storing the point cloud data in the three-dimensional space, the vertical axis (Z-axis) direction is not divided, and a quadtree is only constructed on the XOY plane to achieve the storage of the point cloud data. Figure 2 Exemplarily shows a storage schematic diagram of the point cloud data set of a leaf node in the quadtree storage structure.
[0037] To adapt to the data characteristics of the point cloud data corresponding to the printed circuit board, the processing of the point cloud data in this solution needs to be based on a reference plane in the real scene for coordinate transformation. Specifically, a board surface is taken as the reference plane from the real printed circuit board, and the point cloud data based on the three-dimensional imaging device is rotated according to the normal vector of the point cloud data, so that the collected point cloud data is located directly above its actual position on the printed circuit board. By dividing the projection area of the reference plane, the point cloud data can be quickly saved in the quadtree storage structure. The board surface of the printed circuit board mentioned in this solution refers to the surface for installing electronic components or the bottom surface opposite to the surface, that is, any one of the two largest board surfaces on the printed circuit board. In this solution, when dividing the projection area, it is necessary to ensure that the bottom surface determined by the corrected point cloud data is parallel or coincident with the reference plane. In the actual product form of the printed circuit board, the bottom surface of the entity structure corresponding to the point cloud data is the board surface for installing electronic components. Therefore, the reference plane can be any one of the two parallel board surfaces, and it does not need to be the board surface where the electronic components are actually installed.
[0038] In the specific implementation process, step S110 can be implemented through steps S111 - S112:
[0039] Step S111: Calibrate the initial point cloud data to obtain point cloud data, and the bottom surface of the three-dimensional graph formed by the point cloud data is parallel to the reference plane.
[0040] For the actually collected initial point cloud data, due to the orientation problem of the 3D imaging device, there may be an inclination angle between the orientation of the actual printed circuit board surface and the coordinate axes when the 3D imaging device generates the point cloud data, that is, the axis of the 3D imaging device is not perpendicular to the orientation of the actual printed circuit board surface. At this time, the point cloud data cannot be directly stored in the quadtree structure according to the projection area division of the reference plane. It is necessary to rotate the coordinates based on the normal vector of the initial point cloud data so that the bottom surface of the 3D graph formed by the point cloud data is parallel to the reference plane, thereby obtaining new point cloud data for subsequent quadtree storage implementation.
[0041] Step S112: Divide the reference plane into multiple projection areas based on a preset area size, and the height difference of the point cloud data projected within a single projection area is within a first preset value or the quantity is less than a second preset value.
[0042] As a finite plane, the reference plane can be divided into a finite number of projection areas with the same size. The projection area is not only a division of the reference plane but also a division of the point cloud data. That is, the point cloud data projected in the same projection area belongs to the same point cloud set. Please refer to Figure 2 , where a projection area is exemplarily shown on the reference plane (XOY plane), and the point cloud data projected in this projection area can be regarded as being constrained within the Figure 2 cuboid shown in.
[0043] The specific division process of dividing the reference plane into multiple projection areas based on a preset area size is to first divide the reference plane into multiple projection areas according to the preset area size, and then further split according to the number of point cloud data corresponding to each projection area and the height relationship between the numbers. Specifically, the upper-level projection area is evenly divided into the lower-level projection area in a 2×2 manner until the point cloud data of the quadtree storage structure is obtained, and finally, the point cloud data in each projection area satisfies the set number of point cloud data and the relationship between the point cloud data.
[0044] During actual processing, for step S112, the projection division can be specifically implemented through steps S1121 - S1122:
[0045] Step S1121: Divide the reference plane into multiple projection areas based on a preset initial area size, and confirm the height difference of the point cloud data within the projection range corresponding to each projection area.
[0046] Step S1122: If the height difference of the point cloud data within the projection area is greater than the first preset value and the quantity is above the second preset value, divide the projection area into 2×2 projection areas on average, and confirm the height difference and quantity of the point cloud data within the evenly divided projection areas until the height difference of the point cloud data within a single projection area is within the first preset value or the quantity is less than the second preset value.
[0047] For a printed circuit board, in addition to the overall characteristics of large data volume and flat distribution mentioned above, the point cloud data also has the characteristic of abrupt changes at the edges of each component on the printed circuit board. When storing the point cloud data based on the quadtree storage structure in this solution, in order to prevent the smoothing of the edges of the components, when finally determining the leaf nodes corresponding to the projection area, it is necessary to first judge whether the height variance of the point cloud data within the projection area in the vertical axis (Z-axis) direction is greater than the preset first preset value. If the height variance is greater than the preset first preset value, it indicates that there is a height step in the point cloud data within the projection area, that is, there is an edge of a component within the projection area. Therefore, the projection area is further divided into 2×2 on average, so that 4 child nodes can be obtained, which is also the formation process of the quadtree storage structure in this solution. Of course, in order to reduce the calculation amount and the depth of the quadtree storage structure and improve the data processing efficiency, when the number of the point cloud data in the projection area is within the second preset value, even if the height variance is greater than the preset first threshold, no further division is performed. Storing the point cloud data through the quadtree storage structure formed by the above division process can quickly locate the three-dimensional spatial position of the point cloud data and its adjacent points, and can ensure the fineness of the edges of the components.
[0048] It can be seen that not all the sizes of the projection areas are the same. For the parts with dense point cloud data and large height differences of the point cloud data, the projection area may need to be divided into 2×2 on average multiple times, and the corresponding projection area may be relatively small. The quadtree storage structure based on the initial area has more levels and greater depth; while for the parts with sparse point cloud data and small height differences of the point cloud data, the projection area may not need or only needs to be divided into 2×2 on average very few times, and the corresponding projection area may be relatively large. The quadtree storage structure based on the initial area has fewer levels and shallower depth.
[0049] Step S120: Based on the point cloud data in the quadtree storage structure, determine the spatial implicit function of the point cloud data.
[0050] The point cloud data stored in the quadtree storage structure may have holes. To finally present an accurate and realistic reconstructed texture to the user (quality inspector), it is necessary to fill the holes. In this solution, the holes in the point cloud data are filled by determining the spatial implicit function of the point cloud data. The spatial implicit function is used for the surface reconstruction of 3D images, mainly converting unstructured 3D directed point cloud data into a locally smooth spatial implicit function, so as to reflect the detailed shape of the 3D directed point cloud surface. The spatial implicit function has high flexibility and can describe scenes of various complex shapes; due to the adoption of global constraints, the spatial implicit function is robust to noise and can smoothly handle the holes in the directed point cloud.
[0051] For the process of determining the spatial implicit function in step S120, it can be specifically implemented through steps S121 - S123:
[0052] Step S121: Define the general expression of the spatial implicit function according to the point cloud data and the corresponding normal vectors.
[0053] Based on the point cloud data P = {p 1 , p 2 , …, p n} and the normal vectors N = {n 1 , n 2 , …, n n}, the general expression of the spatial implicit function can be defined. The general expression determines the basic form of the spatial implicit function. By determining several coefficients in the general expression, the actual expression of the spatial implicit function can be obtained.
[0054] Step S122: Construct a linear equation system based on the general expression, the normal vectors, and the values of the spatial implicit function.
[0055] Step S123: Solve the linear equation system to determine the spatial implicit function.
[0056] The coefficients in the general expression are realized by constructing and solving an equation system, that is, constructing an equation system containing only coefficient unknowns. After solving the equation system and substituting it into the general expression, the spatial implicit function of the point cloud data corresponding to a specific printed circuit board can be obtained.
[0057] In a specific implementation process, the general expression of the spatial implicit function is:
[0058]
[0059] In this general expression, represents the radial basis function, φ p (r) = φ(r / ρ),
[0060] where, p jdenotes the point cloud data, n denotes the number of point cloud data, a j and b j are the unknowns to be solved, ρ represents the support radius, and r is the Euler distance.
[0061] Based on the above general expression, the constraints of the spatial implicit function can confirm two equalities:
[0062]
[0063]
[0064] where i = 1, 2…, n, H is the Hessian matrix, c represents the value of the spatial implicit function. For the known point cloud, c = 0 (the surface is the zero-value surface of the spatial implicit function), a j and b j respectively represent the coefficients to be solved. The above two equalities can be further written as a linear equation system with a regularization term:
[0065] (A + ηI)λ = y
[0066] where λ and y are vectors of length 4n, and the i-th elements are [a i , b i T and [c i , n i T respectively. A is a 4n×4n coefficient matrix, and A i,j is a 4×4 submatrix, defined as:
[0067]
[0068] By solving the above linear equation system, a j and b j can be obtained, thereby determining the expression of the spatial implicit function in the specific point cloud data.
[0069] Based on this general expression, step S123 is specifically implemented through steps S1231 - S1232:
[0070] Step S1231: Degenerate the linear equation system based on the closed-form formula to obtain an approximate solution.
[0071] Step S1232: Determine the spatial implicit function according to the approximate solution.
[0072] In the specific processing process, considering that the increase in the number of point clouds will bring problems such as numerical instability and high computational cost in the solution process of the above linear equations, therefore, a closed-form formula based on the quasi-interpolation theorem is adopted to reconstruct the surface in a more stable and efficient manner. Specifically, considering the constraint g(x i ) = f i of the function value, the interpolation function g(x) = ∑ i λ i Ψ i (x). When λ i ≡ f i , the interpolation function g(x) can be well approximated as ∑ i f i Ψ i (x). However, since the interpolation constraint includes both the value of the function and the gradient of the function (i.e., the above two equations), a closed-form equation is used to approximate the solution of the system of equations. Through matrix calculation, when the coefficient matrix is approximated by the identity matrix I, λ i ≡ f i is the approximate solution of the quasi-interpolation. The above coefficient matrix A i,i degenerates to:
[0073] D i,j = 0 (i ≠ j)
[0074] The linear equation to be solved in the linear equation system corresponding to the added regularization term degenerates to Dλ = y, D = (D i,j ) n×n and the approximate solution is obtained
[0075]
[0076] Finally, according to the principle that the reconstructed surface is the zero-value surface of the spatial implicit function, let c = 0 to obtain:
[0077]
[0078] In the specific implementation, in addition to the above-mentioned completion method, there can also be a second implementation method of the completion method. Generally speaking, the general expression of the spatial implicit function is still:
[0079]
[0080] However, in this general expression, represents the radial basis function, φ p (r) = φ(r / ρ),
[0081] where, p j represents the point cloud data, n represents the number of point cloud data, a jand b j are unknowns to be solved, ρ represents the support radius, and r is the Euler distance.
[0082] Since there are holes in the point cloud data of the printed circuit board decoded by the 3D AOI system on the vertical plane of the components, the implicit function cannot be calculated at the positions of the holes, resulting in surface missing. To further improve the computational efficiency of the filling process, another method is proposed to fill the surface during the reconstruction process without incurring additional computational costs. According to the distribution of the point cloud data of the printed circuit board, a radial basis function for the point cloud data of the printed circuit board is designed so that the implicit function value can be calculated at the three-dimensional positions of the holes. As Figure 3 shown, the black points are the three-dimensional spatial positions where the implicit function value is positive, the shaded points are the three-dimensional spatial positions where the implicit function value is negative, the blank points are the missing parts, and the black lines are the reconstructed surface, that is, the zero-value surface of the spatial implicit function. By using the improved radial basis function in the second implementation method, the constraint of the vertical axis (Z-axis) is reduced so that the implicit function value can be calculated on the vertical plane of the components on the printed circuit board (i.e., through calculation). Overall, by defining the distances in the horizontal axis (X-axis) and vertical axis (Y-axis) directions as the radius of the radial basis function, the missing parts of the spatial implicit function values can be effectively filled ([[]] Figure 3 the point cloud data within the dashed box in ).
[0083] In the second implementation method, for the case of missing point cloud on the side of the components on the printed circuit board, by improving the expression of the radial basis function, the spatial implicit function is filled without introducing computational overhead, thereby eliminating the surface holes and overall improving the processing speed.
[0084] Step S130: Extract the zero-value surface of the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board.
[0085] After triangulating the spatial implicit function, a three-dimensional mesh with topological structure can be obtained, thereby performing high-quality rendering on the three-dimensional model.
[0086] Step S140: Map the three-dimensional coordinates of the three-dimensional surface of the printed circuit board to the two-dimensional image of the printed circuit board to obtain the three-dimensional surface image of the printed circuit board with texture.
[0087] During specific rendering, the two-dimensional image synchronously captured during the acquisition of the point cloud data is mapped to the reconstructed three-dimensional coordinates to obtain the three-dimensional surface image of the printed circuit board with texture. The user (quality inspector) can complete the observation and detection of the printed circuit board to be tested by observing the three-dimensional surface image.
[0088] As described above, according to the relative position relationship between the initial point cloud data and the reference plane, the initial point cloud data is converted into a quadtree storage structure to obtain point cloud data. The initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device. Based on the point cloud data in the quadtree storage structure, the spatial implicit function of the point cloud data is determined. The zero-value surface is extracted from the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board. The three-dimensional coordinates of the three-dimensional surface of the printed circuit board are mapped to the two-dimensional image of the printed circuit board to obtain the three-dimensional surface image of the textured printed circuit board. By storing the point cloud data in a quadtree storage structure and using the spatial implicit function to fill the holes in the point cloud data in the quadtree storage structure, based on the spatial implicit function to completely describe the relationship between the spatial position of the point cloud data and the real surface of the printed circuit board, combined with the mapping of two-dimensional graphics to obtain a textured three-dimensional surface, the balance of the processing speed and processing results of three-dimensional reconstruction is achieved, providing real-time and accurate three-dimensional reconstruction.
[0089] Figure 4 FIG. is a schematic structural diagram of an apparatus for three-dimensional reconstruction of a printed circuit board provided by an embodiment of the present invention. Refer to Figure 4 , the apparatus for three-dimensional reconstruction of the printed circuit board includes: a data conversion unit 210, an implicit function determination unit 220, a zero-value surface extraction unit 230, and a texture mapping unit 240.
[0090] Among them, the data conversion unit 210 is configured to convert the initial point cloud data into a quadtree storage structure to obtain point cloud data according to the relative position relationship between the initial point cloud data and the reference plane. The initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device. The implicit function determination unit 220 is configured to determine the spatial implicit function of the point cloud data based on the point cloud data in the quadtree storage structure. The zero-value surface extraction unit 230 is configured to extract the zero-value surface from the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board. The texture mapping unit 240 is configured to map the three-dimensional coordinates of the three-dimensional surface of the printed circuit board to the two-dimensional image of the printed circuit board to obtain the three-dimensional surface image of the textured printed circuit board.
[0091] Based on the above embodiment, the data conversion unit includes:
[0092] A point cloud correction module, configured to correct the initial point cloud data to obtain point cloud data, and the bottom surface of the three-dimensional graph formed by the point cloud data is parallel to the reference plane;
[0093] A region division module, configured to divide the reference plane into multiple projection regions based on a preset region size, and the height difference of the point cloud data projected in a single projection region is within a first preset value or the quantity is less than a second preset value;
[0094] Among them, the upper-level projection area is evenly divided into lower-level projection areas in a 2×2 manner to obtain the point cloud data of the quadtree storage structure.
[0095] Based on the above embodiments, the region division module includes:
[0096] The division sub-module is used to divide the reference plane into multiple projection areas based on a preset initial area size, and confirm the height difference of the point cloud data within the projection range corresponding to each projection area;
[0097] The judgment sub-module is used to, if the height difference of the point cloud data within a projection area is greater than a first preset value and the quantity is above a second preset value, divide the projection area into 2×2 projection areas, and confirm the height difference and quantity of the point cloud data within the evenly divided projection areas until the height difference of the point cloud data within a single projection area is within the first preset value or the quantity is less than the second preset value.
[0098] Based on the above embodiments, the implicit function determination unit includes:
[0099] The expression definition module is used to define the general expression of the spatial implicit function according to the point cloud data and the corresponding normal vector;
[0100] The equation system construction module is used to construct a linear equation system based on the general expression, the normal vector, and the value of the spatial implicit function;
[0101] The equation system solving module is used to solve the linear equation system to determine the spatial implicit function.
[0102] Based on the above embodiments, the general expression of the spatial implicit function is:
[0103]
[0104] In this general expression, represents the radial basis function, φ p (r) = φ(r / ρ),
[0105] where, p j represents the point cloud data, n represents the quantity of the point cloud data, a j and b j are unknowns to be solved, ρ represents the support radius, and r is the Euler distance.
[0106] Based on the above embodiments, the equation system solving module includes:
[0107] The approximate solution sub-module is used to degenerate the linear equation system based on the closed-form formula to obtain an approximate solution;
[0108] An implicit function determination sub-module, configured to determine a spatial implicit function according to an approximate solution.
[0109] Based on the above embodiments, the general expression of the spatial implicit function is:
[0110]
[0111] In this general expression, denotes a radial basis function, φ p (r) = φ(r / ρ),
[0112] where p j denotes point cloud data, n denotes the number of point cloud data, a j and b j are unknowns to be solved, ρ denotes the support radius, and r is the Euler distance.
[0113] The device for three-dimensional reconstruction of a printed circuit board provided by an embodiment of the present invention is included in a terminal device and can be used to execute any method for three-dimensional reconstruction of a printed circuit board provided in the above embodiments, and has corresponding functions and beneficial effects.
[0114] It should be noted that in the embodiments of the device for three-dimensional reconstruction of a printed circuit board, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0115] Figure 5 FIG. is a schematic structural diagram of a terminal device provided by an embodiment of the present invention. As Figure 5 shown, the terminal device includes a processor 310, a memory 320, an input device 330, an output device 340, and a communication device 350; the number of processors 310 in the terminal device can be one or more, Figure 5 and one processor 310 is taken as an example here; the processor 310, the memory 320, the input device 330, the output device 340, and the communication device 350 in the terminal device can be connected through a bus or other means, Figure 5 and connected through a bus is taken as an example here.
[0116] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for three-dimensional reconstruction of a printed circuit board in the embodiments of the present invention (for example, the data conversion unit 210, implicit function determination unit 220, zero-value surface extraction unit 230, and texture mapping unit 240 in the device for three-dimensional reconstruction of a printed circuit board). The processor 310 executes various functional applications and data processing of the terminal device by running the software programs, instructions, and modules stored in the memory 320, that is, implements the above-mentioned method for three-dimensional reconstruction of a printed circuit board.
[0117] The memory 320 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 320 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 320 may further include a memory remotely provided with respect to the processor 310, and these remote memories can be connected to the terminal device through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0118] The input device 330 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the terminal device. The output device 340 may include a display device such as a display screen.
[0119] The above terminal device includes a device for three-dimensional reconstruction of a printed circuit board, can be used to execute any method for three-dimensional reconstruction of a printed circuit board, and has corresponding functions and beneficial effects.
[0120] The embodiments of the present invention also provide a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute related operations in the method for three-dimensional reconstruction of a printed circuit board provided in any embodiment of the present application when executed by a computer processor, and have corresponding functions and beneficial effects.
[0121] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product.
[0122] Accordingly, the present application may be implemented in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in the flow Figure 1 one flow or multiple flows and / or blocks Figure 1 These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in the flow Figure 1 one flow or multiple flows and / or blocks Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0123] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory. The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
[0124] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0125] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0126] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. Method for three-dimensional reconstruction of a printed circuit board, Characterized in that, Comprising: According to the relative position relationship between the initial point cloud data and the reference plane, converting the initial point cloud data into a quadtree storage structure to obtain point cloud data, where the initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device; Based on the point cloud data in the quadtree storage structure, determining the spatial implicit function of the point cloud data; Extracting the zero-value surface of the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board; Mapping the three-dimensional coordinates of the three-dimensional surface of the printed circuit board to the two-dimensional image of the printed circuit board to obtain a three-dimensional surface image of the printed circuit board with texture; Wherein, the determining the spatial implicit function of the point cloud data based on the point cloud data in the quadtree storage structure includes: Defining a general expression of the spatial implicit function according to the point cloud data and the corresponding normal vector; Constructing a linear equation system based on the general expression, the normal vector, and the value of the spatial implicit function; Solving the linear equation system to determine the spatial implicit function; Wherein, the general expression of the spatial implicit function is: In the general expression, represents a radial basis function, φ p (r) = φ(r / ρ), Among them, p j represents the point cloud data, n represents the number of point cloud data, a j and b j are unknowns to be solved, ρ represents the support radius, and r is the Euler distance.
2. The method according to claim 1, Characterized in that, The converting the initial point cloud data into a quadtree storage structure to obtain point cloud data according to the relative position relationship between the initial point cloud data and the reference plane includes: Correcting the initial point cloud data to obtain point cloud data, and the bottom surface of the three-dimensional graph formed by the point cloud data is parallel to the reference plane; Dividing the reference plane into multiple projection regions based on a preset region size, and the height difference of the point cloud data projected in a single projection region is within a first preset value or the quantity is less than a second preset value; Wherein, the upper-level projection region is equally divided into four lower-level projection regions in a 2×2 manner to obtain the point cloud data of the quadtree storage structure.
3. The method according to claim 2, Characterized in that, The dividing the reference plane into multiple projection regions based on a preset region size, and the height difference of the point cloud data projected in a single projection region is within a first preset value or the quantity is less than a second preset value includes: Dividing the reference plane into multiple projection regions based on a preset initial region size, and confirming the height difference of the point cloud data within the projection range corresponding to each projection region; If the height difference of the point cloud data in a projection region is greater than the first preset value and the quantity is above the second preset value, then divide the projection region into four projection regions in a 2×2 manner, and confirm the height difference and quantity of the point cloud data in the evenly divided projection regions until the height difference of the point cloud data in a single projection region is within the first preset value or the quantity is less than the second preset value.
4. The method according to claim 1, Characterized in that, The solving the linear equation system to determine the spatial implicit function includes: Degrading the linear equation system based on a closed-form formula to obtain an approximate solution; Determining the spatial implicit function according to the approximate solution.
5. The method according to claim 1, Characterized in that, The general expression of the spatial implicit function is as follows: In the general expression, represents a radial basis function, φ p (r) = φ(r / ρ), Among them, p j represents the point cloud data, n represents the number of point cloud data, a j and b j are unknowns to be solved, ρ represents the support radius, and r is the Euler distance.
6. An apparatus for three-dimensional reconstruction of a printed circuit board, characterized in that, it includes: A data conversion unit, configured to convert the initial point cloud data into a quadtree storage structure according to the relative position relationship between the initial point cloud data and the reference plane, so as to obtain point cloud data. The initial point cloud data is obtained by a three-dimensional imaging device collecting images of the printed circuit board to be measured, and the reference plane is the plane where the board surface of the printed circuit board to be measured faces the three-dimensional imaging device; An implicit function determination unit, configured to determine the spatial implicit function of the point cloud data based on the point cloud data in the quadtree storage structure; A zero-value surface extraction unit, configured to extract the zero-value surface from the spatial implicit function to triangulate the three-dimensional surface of the printed circuit board; A texture mapping unit, configured to map the three-dimensional coordinates of the three-dimensional surface of the printed circuit board to the two-dimensional image of the printed circuit board to obtain a three-dimensional surface image of the printed circuit board with texture; wherein, determining the spatial implicit function of the point cloud data based on the point cloud data in the quadtree storage structure includes: Defining the general expression of the spatial implicit function according to the point cloud data and the corresponding normal vector; Constructing a linear equation system based on the general expression, the normal vector and the value of the spatial implicit function; Solving the linear equation system to determine the spatial implicit function; wherein, the general expression of the spatial implicit function is as follows: In the general expression, represents a radial basis function, φ p (r) = φ(r / ρ), Among them, p j represents the point cloud data, n represents the number of point cloud data, a j and b j are unknowns to be solved, ρ represents the support radius, and r is the Euler distance.
7. A terminal device, characterized in that, it includes: One or more processors; A memory, configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for three-dimensional reconstruction of a printed circuit board according to any one of claims 1-5.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the program is executed by a processor, it implements the method for three-dimensional reconstruction of a printed circuit board according to any one of claims 1-5.
Citation Information
Patent Citations
Insulator laser-point cloud three-dimensional reconstruction method based on CS-RBF (Compactly-Supported Radial Basis Functions)
CN108230432A
Vehicle point cloud data processing method and device, equipment and storage medium
CN111797734A