A method for generating geometric mesh structure of 3D point cloud based on plane recognition

Through the generation method of 3D point cloud geometric grid structure based on plane recognition, the precision limitation and memory consumption problem of grid models in the existing technology are solved, and an efficient and concise grid representation of 3D point cloud is achieved, which is suitable for various applications. complex structure.

CN113763563BActive Publication Date: 2024-08-27DAIWU INTELLIGENT TECH (SHANGHAI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111044729.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-07
Publication Date
2024-08-27
Estimated Expiration
2041-09-07

AI Technical Summary

Technical Problem

Existing 3D reconstruction methods have accuracy limitations and memory consumption problems when generating meshed models. Especially for large flat surfaces, a large number of triangles are needed to represent them, resulting in unrefined results and unsharp edges.

Method used

A three-dimensional point cloud geometric mesh structure generation method based on plane recognition is adopted. Through data preprocessing, plane recognition, boundary fusion and mesh generation steps, a streamlined and reliable mesh model is established, which avoids the rasterization process of the three-dimensional space and utilizes Techniques such as principal component analysis and ear-cutting generate clean meshes.

Benefits of technology

It achieves efficient grid representation of three-dimensional point clouds, reduces storage space requirements, ensures edge sharpness and grid simplicity, and is suitable for non-Manhattan structures such as 'herringbone'-shaped building floors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113763563B
    Figure CN113763563B
Patent Text Reader

Abstract

The present invention discloses a method for generating a three-dimensional point cloud geometric grid structure based on plane recognition, and the method comprises the following steps: step S1: data preprocessing, the input data is general three-dimensional space point cloud data, the input data is downsampled, and the normal vector value of the point cloud is calculated using principal component analysis; step S2: plane recognition, constructing an energy function, obtaining a locally consistent plane extraction result, and optimizing the result, using principal component analysis to calculate the distribution of the inner points in space, and the normal vector obtained by the optimization step and the passing point can represent the plane; step S3: solving the contour boundary of the plane itself; step S4: solving the intersection boundary of the plane; step S5: boundary fusion, obtaining a closed boundary of a plane; step S6: grid generation. The present invention can improve and optimize the plane recognition algorithm; and can realize the dual-method generation and fusion of the plane polygon contour.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer three-dimensional reconstruction, and in particular to a method for generating a three-dimensional point cloud geometric grid structure based on plane recognition. Background Art

[0002] In the process of 3D reconstruction, after scanning and obtaining the point cloud, the next step is usually to triangulate and obtain a meshed model. The reason is that no matter how dense the point cloud is, it is actually still a sparse expression in three-dimensional space, that is, there will be distances between points, while the meshed representation is non-sparse and can express the surface of an object in a closed and complete manner. At the same time, for a huge rectangular plane, if it is expressed by points, a large number of points are required, but only two are required with triangles, so a lot of storage space can also be saved. Mesh: refers to the mesh of the model. The 3D model is made up of polygons, and polygons are actually made up of multiple triangles. That is, the surface of a 3D model is actually composed of multiple triangular faces connected to each other.

[0003] Currently, the commonly used methods for establishing triangular meshes are Poisson reconstruction or truncated signed distance function (TSDF). They both use some methods to calculate the signed distance from each acceleration point to the front of the mesh in the rasterized three-dimensional space, and use the marching cubes method to calculate the isosurface in the three-dimensional discrete voxels to obtain the mesh.

[0004] The existing methods all rasterize the three-dimensional space and then calculate the three-dimensional surfaces therein. In this case, the memory consumption and the accuracy of the results in the calculation process are heavily dependent on the accuracy of the octree in the rasterization process.

[0005] A face that passes through multiple voxels will be composed of multiple small triangles. Although this can represent a curved surface, when facing a large flat surface, such as a whole wall, a large number of triangles are not needed to represent the bumps and depressions. At the same time, two large triangles can fully represent the wall while saving a lot of space.

[0006] Especially for Poisson reconstruction, due to the existence of the smoothing function, the final result will have more rounded corners instead of the 90-degree edges that should be in the building structure.

[0007] Therefore, technicians in this field are committed to developing a method for generating a three-dimensional point cloud geometric grid structure based on plane recognition. This method does not rasterize the three-dimensional space, so there will be no similar accuracy limitations and memory consumption; at the same time, when the plane intersects with other planes in all directions, the edges are completely composed of intersection lines, and a simple grid can be formed; and the intersection lines brought by the intersection also ensure the sharpness of the corners. Summary of the invention

[0008] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention involves the gridding part in the field of three-dimensional reconstruction in computer vision, specifically, how to triangulate the environmental point cloud and obtain the gridding representation of the scene after obtaining the point cloud of the environmental scene by scanning the points with a three-dimensional sensor. To solve this problem, the present invention establishes a concise and reliable grid model based on the boundary of each face and the intersection relationship between faces after performing face recognition on the three-dimensional point cloud.

[0009] To achieve the above object, the present invention provides a method for generating a three-dimensional point cloud geometric grid structure based on plane recognition, the method comprising the following steps:

[0010] Step S1: data preprocessing, the input data is general three-dimensional space point cloud data, the input data is downsampled, and the normal vector value of the point cloud is calculated using principal component analysis;

[0011] Step S2: plane identification, constructing an energy function, obtaining a locally consistent plane extraction result, and optimizing the result, using principal component analysis to calculate the distribution of the interior points in space, and using the normal vectors and passing points obtained in the optimization step to represent the plane;

[0012] Step S3: solving the contour boundary of the plane itself;

[0013] Step S4: Solve the plane intersection boundary, establish a k-dimensional tree for all points of each face, double-convenient all faces, and for any two faces, calculate the number of points whose distance from each other to the point set of the other face is less than 0.05m. If the number of points is less than 10, it means that the two faces do not intersect; if the number of points of the two faces is greater than or equal to 10, calculate the angle between the normal vectors of the two faces. If the angle is less than 20 degrees, they do not intersect, otherwise they are judged to intersect;

[0014] Step S5: Boundary fusion to obtain a closed boundary of a plane;

[0015] Step S6: Mesh generation: For each polygonal boundary of a plane, the mesh is calculated using the ear-cut method, and then the meshes of all planes are merged to obtain the final environment mesh data.

[0016] Furthermore, the downsampling method is voxel filtering, which classifies all points into different small blocks in three dimensions by voxelizing the three-dimensional space, and uses the center of gravity of the small block to approximately express all the points therein, thereby obtaining a filtered three-dimensional point cloud.

[0017] Furthermore, the principal component analysis is used to calculate the normal vector value of the point cloud, and its main steps are:

[0018] Step S11: For the data set X = {x1, x2, ..., x n}Decentralize, that is, subtract the mean value of each feature dimension, where x is a vector and X is a matrix composed of vectors;

[0019] Step S12: Calculate the covariance matrix

[0020] Step S13: Calculate the covariance matrix using the eigenvalue decomposition method The eigenvalues ​​and eigenvectors of are sorted from large to small to obtain the eigenvalues ​​λ1, λ2, λ3 and eigenvectors in is the normal vector.

[0021] Furthermore, the result optimization in step S2 comprises the following steps:

[0022] If the length of the point in the area in the direction of the normal vector is greater than 0.1m, it is judged that there may be a double wall, and a density-based clustering algorithm is called to cluster it. The k-dimensional tree is used for acceleration in space. The specific steps are as follows:

[0023] Step S21: set the parameter eps=0.05m, and adjust min_samples according to the density, where eps and min_samples are two parameters in the algorithm;

[0024] Step S22: randomly select a point and find all points whose distance to this point is ≤ eps. If the number of points is less than min_samples, the point is marked as noise, otherwise it is marked as a core and assigned a new cluster label.

[0025] Step S23: If they are marked as core, then visit all neighbors within the eps range. If they have not been assigned a cluster, assign the newly created cluster label to them. If they are core samples, then visit their neighbors in turn, and so on, until there are no more core samples within the eps distance of the cluster;

[0026] Step S24: Return to step S22 until all points are visited.

[0027] Furthermore, the step S2 of calculating the distribution of the interior points in space further includes the following steps:

[0028] Use principal component analysis to calculate the distribution of the interior points in space and obtain the eigenvector with the largest eigenvalue. Combined with the region normal vector Then we can get the rotation matrix R from the sub-region coordinate system to the global coordinate system wn and the rotation matrix R from the global coordinate system to the sub-region coordinate system nw :

[0029]

[0030]

[0031] Using R nw Rotate the points in the region to the sub-region coordinate system and sort them to get the median z value z=median(z i ) point, and use R wn Rotate back to the global coordinate system, and you get the point p that the plane passes through in the global coordinate system median .

[0032] Furthermore, the step S3 of calculating the contour boundary of the plane itself further includes the following sub-steps:

[0033] First use R nw Project the points of this plane to the local coordinate system and keep only the x and y coordinates. Use the alpha shape edge contour algorithm to make a rough boundary. You need to set the radius value alpha. The sub-steps are as follows:

[0034] S31: Establish Delaunay triangulation based on point set;

[0035] S32: If the length of a side of a triangle is greater than 2*alpha, delete the triangle;

[0036] S33: judge each side of the triangle: if a circle passing through two points of a certain side and with a radius of alpha contains other points, delete the triangle;

[0037] On the triangulated network obtained after the triangles mentioned in steps S32 and S33 that do not meet the requirements of the alpha shape edge contour algorithm, the edge of the triangulated network is obtained, and the edge is the edge line of the point set.

[0038] Furthermore, the step S4 further includes:

[0039] If there is an intersection line between two faces, assume that the normal vectors of the two planes are and Then define the rotation matrix:

[0040]

[0041]

[0042] Use R′ nw Rotate the two planes to a new local coordinate system, find the coordinates of the points through which the intersection line passes in the new coordinate system, and then use R′ wn Rotate back to the original coordinate system.

[0043] Furthermore, the step S4 also includes:

[0044] Project the domain points on both sides onto the straight line, and take the maximum and minimum values ​​of the two sides as the endpoints; at the same time, each face must record all the line segments obtained by its intersection, specifically:

[0045] Step S41: Use R for each face nw The normal vector is projected into two dimensions, and then all the lines on the two-dimensional plane are intersected with each other to get the intersection point, and the distance between the intersection point and the endpoint is compared. If they are close, the endpoint is pulled over. In this way, each line will have a corrected projection on each plane that generates it, and then use R wn Rotate back to the original coordinate system;

[0046] Step S42: In the global three-dimensional coordinate system, the endpoints of each line are averaged with respect to the endpoints of their correction values ​​on each plane.

[0047] Furthermore, the step S5 further includes the following sub-steps:

[0048] Step S51: for all the intersection boundaries of each face, find the two points on its own boundary that are closest to its two endpoints. If the distance is less than a threshold, and more than 80% of the points between the two endpoints of its own boundary are less than the same threshold from the line segment, then replace this rough boundary with this intersection line.

[0049] Step S52: After the replacement is completed, for the remaining self-boundaries, traverse and find the connected short line segments with similar slopes. If the endpoints on both sides of the line segment set belong to the intersection boundary, they are directly connected as a line segment; otherwise, the endpoints of the line segment set are used to fit the straight line to obtain the direction of the new line segment, and the points at both ends belonging to the self-boundary are projected onto the straight line to obtain a new line segment.

[0050] Furthermore, the ear cutting method in step S6 is as follows:

[0051] Step S61: Create a bidirectional linked list consisting of all vertices;

[0052] Step S62: Circular bidirectional linked list, for vertex Check whether it is a convex point and whether there are other points in the linked list in the triangle If it is a convex point and there are no other points in the linked list, the triangle Add to the grid and remove v from the linked list i ;

[0053] Step S63: loop until only the last triangle is left in the linked list and add it to the grid;

[0054] Among them, the method of judging whether it is a convex point is to calculate If it is regular, it is convex, otherwise it is concave; to determine whether other points are inside the triangle, the centroid method is used. Specifically, for any point Establish

[0055]

[0056] It can be solved

[0057]

[0058] If λ2=D1 / D, λ2=D2 / D, and 1-λ2-λ3 are all between 0 and 1, then the point is inside the triangle.

[0059] in, is a vertex on the plane, It is a triangle composed of three points. and is a vector composed of two points, and D, D1, D2, λ2, and λ3 are all ordinary scalars.

[0060] The present invention can improve and optimize the plane recognition algorithm; it can realize the dual-method generation and fusion of the plane polygon outline, which is a substantial improvement over the existing technology. It makes non-mandatory restrictions on the direction, so that it can adapt to some non-Manhattan structures, such as the "human" shaped building floors, while not being scattered; the generated boundary is based on its own contour and intersection relationship, ensuring the closure of each face and the sharpness of the intersection; the mesh generated by the ear cutting method is the most streamlined based on the provided polygon, ensuring the simplicity of the result.

[0061] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic diagram of a method flow chart of a preferred embodiment of the present invention;

[0063] Figure 2 is a schematic diagram of the fusion process of a preferred embodiment of the present invention;

[0064] Figure 3 It is a schematic diagram of a grid generated by a plane boundary contour in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0065] The following describes several preferred embodiments of the present invention with reference to the drawings in the specification, so that the technical content is clearer and easier to understand. The present invention can be embodied in many different forms of embodiments, and the protection scope of the present invention is not limited to the embodiments mentioned in the text.

[0066] In the drawings, components with the same structure are indicated by the same numerical reference numerals, and components with similar structures or functions are indicated by similar numerical reference numerals. The size and thickness of each component shown in the drawings are arbitrarily shown, and the present invention does not limit the size and thickness of each component. In order to make the illustration clearer, the thickness of the components is appropriately exaggerated in some places in the drawings.

[0067] The purpose of the present invention is to provide a method for generating a grid model in a three-dimensional reconstruction process, which can obtain a concise and reliable grid model based on the plane's own information and intersection relationship through the three-dimensional point cloud obtained by scanning.

[0068] The method flow of the present invention is as follows Figure 1 As shown, the method includes data preprocessing, plane recognition, determining the plane's own contour boundary, determining the plane intersection boundary, boundary fusion and mesh generation steps.

[0069] Step S1: Data preprocessing

[0070] The input data required by the present invention is general three-dimensional space point cloud data, which is generally obtained by scanning and fusion based on a three-dimensional sensor and a corresponding SLAM algorithm. The original data does not need to have a normal vector value because the data needs to be downsampled first to avoid the density of the point cloud affecting the calculation of the plane and to improve the calculation efficiency of the plane detection.

[0071] The downsampling method used in the present invention is voxel filtering, which classifies all points into different small cubes in three dimensions by voxelizing the three-dimensional space, and uses the center of gravity of the small cube to approximately express all the points in it, thereby obtaining a filtered three-dimensional point cloud. In the present invention, in order to accelerate plane recognition while maintaining the attack as much as possible, the length, width and height of the voxel cube are selected to be 0.03m.

[0072] After downsampling, the present invention uses the currently widely used principal component analysis to calculate the normal vector value of the point cloud, and its main steps are:

[0073] ① For the data set X = {x1, x2, ..., x n}Decentralize, that is, subtract the mean value from each feature dimension;

[0074] ② Calculate the covariance matrix

[0075] ③Use eigenvalue decomposition method to find the covariance matrix The eigenvalues ​​and eigenvectors of are sorted from large to small to obtain the eigenvalues ​​λ1, λ2, λ3 and eigenvectors in is the normal vector.

[0076] Among them, x is a vector, such as (x, y, z) of a point, the capital X is the matrix composed of vectors, that is, the entire point set, the T in the upper right corner is the transpose, λ1, λ2, λ3 are the eigenvalues, is the eigenvector.

[0077] The reason why the normal vector can be calculated using this statistical method is that all vectors on the plane should be perpendicular to the direction of the normal vector, that is:

[0078]

[0079] Step S2: Plane recognition

[0080] This paper uses an existing plane recognition algorithm, which was first proposed in the paper "Fastregularity-constrained plane fitting" in 2020. The core idea is to construct an energy function that takes both global and local into account, so that it can obtain locally consistent plane extraction results while limiting the total number of global directions.

[0081] The energy function as the core of this method can be expressed as:

[0082]

[0083] Where N is the number of points, N i is the neighborhood point set of the i-th point, V is the reconstructed normal vector set, z i is the index of the normal vector of the i-th point in V, I is the set of normal vectors calculated in the preprocessing stage, and I i is the original normal vector of the i-th point.

[0084] In this formula, ||V zi -I i || 2 and The purpose is to guide the output normal vector to be as consistent as possible with the input, and to limit adjacent points in the space to be assigned the same normal vector. The λ before the formula is the proportion of the limit in the energy function, which is usually adjusted between 1 and 10 according to the data. For the convenience of optimization, this problem is divided into two sub-problems:

[0085]

[0086]

[0087] That is, the first sub-problem focuses on optimizing the direction of the normal vector, and the second sub-problem is to limit the number of normal vector directions to within m while ensuring the accuracy of the normal vector as much as possible.

[0088] In this method, the first formula is optimized by merging adjacent plane domains (a set of points that form a plane), which calculates the change in the energy function when merging two subdomains:

[0089]

[0090] where c ij is the number of connected units in the two subdomains, and w i Then is the number of point sets in domain i. If the result of this formula is positive, the energy function will decrease, that is, the two subdomains are merged, otherwise they are not merged. The normal vector of the new subdomain after merging is updated as:

[0091]

[0092] In order to optimize the second formula, that is, to select the sub-region, we construct a system that satisfies:

[0093] The submodular function of :

[0094]

[0095] in is a set of disjoint regions, is the normal vector of the ith subregion, is included Then optimize according to the following steps:

[0096] ① Initialization

[0097] ② Traverse all areas where the number of points in the area is greater than the threshold, and for the i-th area like Then X←X∪{S i}, on the contrary

[0098] The final V is the result. Obviously, this is to select the sub-regions where the increased contribution is greater than the decreased contribution.

[0099] Compared with the traditional region growing, the results of this method have advantages as well as disadvantages. For example, due to the limitation of the number of normal vectors, double walls will be grouped together in the scanning results. In order to solve this problem, if the length of the points in the region in the direction of the normal vector is greater than 0.1m, it is judged that there may be double walls, and DBSCAN is called to cluster them. It uses kdtree acceleration in space. The general process is as follows:

[0100] ① Set the parameter eps = 0.05m, and adjust min_samples according to the density;

[0101] ② Randomly select a point and find all points whose distance to this point is ≤ eps. If the number of points is less than min_samples, the point is marked as noise, otherwise it is marked as a core and assigned a new cluster label;

[0102] ③ If they are marked as core, visit all neighbors within the eps range. If they have not been assigned a cluster, assign the newly created cluster label to them. If they are core samples, visit their neighbors in turn, and so on, until there are no more core samples within the eps distance of the cluster.

[0103] ④ Return to step 2 until all points have been visited.

[0104] Kdtree means k-dimensional tree, which simply means extending the concept of binary tree to k-dimensional space. All non-leaf nodes can be regarded as using a hyperplane to divide the points in the space into two parts.

[0105] Among them, DBSCAN is a density-based clustering algorithm, and eps and min_samples are two parameter names in the algorithm.

[0106] This method has two great advantages over traditional region growing: due to its global restrictions, the normal vectors of the plane will not be scattered, and the local restrictions drive it to not lose points near the plane intersection. Since the normal vectors of the plane intersection part are usually oblique when calculated by PCA, the result of traditional region growing will not include these points, but this method will include them.

[0107] In addition to the normal vector, the plane also has the points it passes through. In this regard, the present invention uses principal component analysis (PCA) to calculate the distribution of its internal points in space and obtain the eigenvector with the largest eigenvalue Combined with the region normal vector Then we can get the rotation matrix R from the sub-region coordinate system to the global coordinate system wn and the rotation matrix R from the global coordinate system to the sub-region coordinate system nw :

[0108]

[0109]

[0110] Using R nw Rotate the points in the region to the sub-region coordinate system and sort them to get the median z value z=median(z i ) point, and use R wn Rotate back to the global coordinate system, and you get the point p that the plane passes through in the global coordinate systemmedian .

[0111] At this point, the normal vector and the passing point obtained in the optimization step can represent the plane.

[0112] Step S3: plane contour boundary

[0113] First use R nw Project the points of this plane to the local coordinate system and keep only the x and y coordinates. Use alpha shape to make a rough boundary. It is an existing two-dimensional boundary calculation method. It is necessary to set the radius value alpha (generally set to 0.3m). The brief steps are as follows:

[0114] ① Establish a Delaunay triangulation based on the point set;

[0115] ②If the length of a side in the triangle is greater than 2*alpha, delete the triangle;

[0116] ③ Judge each side of the triangle: if a circle passing through two points of an edge and with a radius of alpha contains other points, delete the triangle;

[0117] On the triangulated network obtained after the triangles that do not meet the Alpha shape requirements mentioned in step 2-3, find the edge of the triangulated network, which is the edge line of the point set.

[0118] Among them, alpha shape is an algorithm for finding edge contours; Delaunay refers to a triangulation method that triangulates a point set into a triangulation that only contains a type of Delaunay edge. A Delaunay edge refers to a circle passing through the two endpoints of an edge that does not contain any other points in the point set.

[0119] Step S4: Plane intersection boundary

[0120] A kdtree is built for all points of each face, and then all faces are double-convenienced. For any two faces, the number of points whose distance from each other to the point set of the other face is calculated. If the number of points is less than 10, it means that the two faces do not intersect. If the number of points of both faces is greater than or equal to 10, the angle between the normal vectors of the two faces is calculated. If the angle is less than 20 degrees, they do not intersect, otherwise they are judged to intersect.

[0121] If there is an intersection line between two faces, assume that the normal vectors of the two planes are and Then define the rotation matrix:

[0122]

[0123]

[0124] Use R′ nw Rotate the two planes to a new local coordinate system, find the coordinates of the points through which the intersection line passes in the new coordinate system, and then use R′ wn Rotate back to the original coordinate system. The reason for this is that if you want to solve two plane equations in the original coordinate system to find the intersection point, you need to check whether the coefficients in front of all unknowns are 0. Otherwise, the denominator may be 0 if you divide directly, that is, you need to consider 2^6 / 2 cases, and then directly convert it into a plane similar to y=b in the new coordinate system, and substitute it into the other one and it's done.

[0125] After finding the equation of the line, project the points on both sides onto the line, and take the maximum and minimum values ​​of the two sides as the endpoints. At the same time, each face must record all the line segments obtained by its intersection.

[0126] Since operations such as rotation will produce calculation errors, and the endpoints themselves have errors due to sparsity, the next step is to merge the endpoints of the line segments that may be separated due to errors. Specifically:

[0127] ① Use R for each face nw The normal vector is projected into two dimensions, and then all the lines on the two-dimensional plane are intersected with each other to get the intersection point, and the distance between the intersection point and the endpoint is compared. If they are close, the endpoint is pulled over. In this way, each line will have a corrected projection on each plane that generates it, and then use R wn Rotate back to the original coordinate system.

[0128] ②Then in the global three-dimensional coordinate system, the endpoints of each line take the average of their corrected values ​​on each plane.

[0129] Step S5: Boundary fusion

[0130] For all the intersection boundaries of each face, find the two points on its own boundary that are closest to its two endpoints. If the distance is less than a threshold (0.5m is acceptable), and more than 80% of the points between the two endpoints of its own boundary are less than the same threshold from the line segment, then replace this rough boundary with this intersection. This comparison is mainly to prevent non-boundary intersections, such as the ceiling of a floor and a wall of a room in the center of the floor.

[0131] After the replacement is completed, for the remaining self-boundaries, traverse and find the connected short line segments with similar slopes. If the endpoints on both sides of the line segment set belong to the intersection boundary, they are directly connected as a line segment; otherwise, the endpoints of the line segment set are used to fit the straight line to obtain the direction of the new line segment, and the points at both ends belonging to the self-boundary are projected onto the straight line to obtain a new line segment.

[0132] In this way, a closed boundary of a plane is obtained. Figure 2 This is a simple illustration of the fusion process.

[0133] Step S6: Mesh generation

[0134] For each polygonal boundary of a plane, the Ear Clipping method is used to calculate its mesh. The process is as follows:

[0135] ① Establish a doubly linked list consisting of all vertices;

[0136] ②Circular doubly linked list, for vertex Check whether it is a convex point and whether there are other points in the linked list in the triangle If it is a convex point and there are no other points in the linked list, the triangle Add to the grid and remove v from the linked list i ;

[0137] ③ Loop until there is only one triangle left in the linked list and add it to the grid.

[0138] Among them, the method of judging whether it is a convex point is to calculate If it is regular, it is convex, otherwise it is concave; to determine whether other points are inside the triangle, the centroid method is used. Specifically, for any point Establish

[0139]

[0140] It can be solved as follows:

[0141]

[0142] If λ2=D1 / D, λ2=D2 / D, and 1-λ2-λ3 are all between 0 and 1, then the point is inside the triangle.

[0143] in, is a vertex on the plane, It is a triangle composed of three points. and is a vector composed of two points, and D, D1, D2, λ2, and λ3 are all ordinary scalars.

[0144] Figure 3 This is a schematic diagram of generating a mesh for a plane boundary contour.

[0145] Since the points of intersection between the planes have been corrected and are common vertices, the final environment mesh data can be obtained by directly merging the meshes of all the planes.

[0146] After creating a mesh using conventional methods, adjacent faces with similar normal vectors can also be merged.

[0147] The preferred specific embodiments of the present invention are described in detail above. It should be understood that ordinary technicians in the field can make many modifications and changes based on the concept of the present invention without creative work. Therefore, all technical solutions that can be obtained by technicians in the technical field based on the concept of the present invention through logical analysis, reasoning or limited experiments on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A method for generating a three-dimensional point cloud geometric grid structure based on plane recognition, characterized in that: The method comprises the following steps: Step S1: data preprocessing, the input data is general three-dimensional space point cloud data, the input data is downsampled, and the normal vector value of the point cloud is calculated using principal component analysis; Step S2: plane identification, constructing energy function, obtaining locally consistent plane extraction results, and optimizing the results. Using principal component analysis to calculate the distribution of its internal points in space, the normal vectors and passing points obtained in the optimization step can represent the plane; Step S3: solving the contour boundary of the plane itself; Step S4: Solve the plane intersection boundary, establish a k-dimensional tree for all points of each face, double traverse all faces, and for any two faces, calculate the number of points whose distance from each other to the point set of the other face is less than 0.05m. If the number of points is less than 10, it means that the two faces do not intersect; if the number of points of both faces is greater than or equal to 10, calculate the angle between the normal vectors of the two faces. If the angle is less than 20 degrees, they do not intersect, otherwise they are judged to intersect; Step S5: Boundary fusion to obtain a closed boundary of a plane; Step S6: Mesh generation: for each polygonal boundary of a plane, the mesh is calculated using the ear-cut method, and then the meshes of all planes are merged to obtain the final environment mesh data; The result optimization in step S2 comprises the following steps: If the length of the inner point in the direction of the normal vector is greater than 0.1m, it is judged that there may be a double wall, and a density-based clustering algorithm is called to cluster it. The k-dimensional tree is used for acceleration in space. The specific steps are as follows: Step S21: set the parameter eps=0.05m, and adjust min_samples according to the density, where eps and min_samples are two parameters in the algorithm; Step S22: randomly select a point and find all points whose distance to this point is ≤ eps. If the number of points is less than min_samples, the point is marked as noise, otherwise it is marked as a core and assigned a new cluster label. Step S23: If they are marked as core, then visit all neighbors within the eps range. If they have not been assigned a cluster, assign the newly created cluster label to them. If they are core samples, then visit their neighbors in turn, and so on, until there are no more core samples within the eps distance of the cluster; Step S24: Return to step S22 until all points are visited; The step S2 of calculating the distribution of the interior points in space further includes the following steps: Use principal component analysis to calculate the distribution of the interior points in space and obtain the eigenvector with the largest eigenvalue. Combined region normal Then we can get the rotation matrix R from the sub-region coordinate system to the global coordinate system wn and the rotation matrix R from the global coordinate system to the sub-region coordinate system nw : Using R nw Rotate the inner points of the region to the sub-region coordinate system, and sort them to get the median z value z=median(z i ) point, and use R wn Rotate back to the global coordinate system, and then get the point p through which the plane passes in the global coordinate system median .

2. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The downsampling method is voxel filtering, which classifies all points into different small blocks in three dimensions by voxelizing the three-dimensional space, and uses the center of gravity of the small block to approximately express all the points therein, thereby obtaining a filtered three-dimensional point cloud.

3. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The principal component analysis is used to calculate the normal vector value of the point cloud, and its main steps are: Step S11: For the data set X = {x1, x2, ..., x n }Decentralize, that is, subtract the mean value of each feature dimension, where x is a vector and X is a matrix composed of vectors; Step S12: Calculate the covariance matrix Step S13: Calculate the covariance matrix using the eigenvalue decomposition method The eigenvalues ​​and eigenvectors of are sorted from large to small to obtain the eigenvalues ​​λ1, λ2, λ3 and eigenvectors in is the normal vector.

4. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The calculation of the contour boundary of the plane itself in step S3 further includes the following sub-steps: First use the R nw Project the points of this plane to the local coordinate system and keep only the x and y coordinates. Use the alpha shape edge contour algorithm to make a rough boundary. You need to set the radius value alpha. The sub-steps are as follows: S31: Establish Delaunay triangulation based on point set; S32: If the length of a side of a triangle is greater than 2*alpha, delete the triangle; S33: judge each side of the triangle: if a circle passing through two points of a certain side and with a radius of alpha contains other points, delete the triangle; On the triangulated network obtained after the triangles mentioned in steps S32 and S33 that do not meet the requirements of the alpha shape edge contour algorithm, the edge of the triangulated network is obtained, and the edge is the edge line of the point set.

5. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The step S4 further comprises: If there is an intersection line between two faces, assume that the normal vectors of the two planes are and Then define the rotation matrix: Use R' nw Rotate the two planes to a new local coordinate system, find the coordinates of the points through which the intersection line passes in the new coordinate system, and then use R' wn Rotate back to the original coordinate system.

6. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The step S4 also includes: Project the domain points on both sides onto the straight line, and take the maximum and minimum values ​​of the two sides as the endpoints; at the same time, each face must record all the line segments obtained by its intersection, specifically: Step S41: Use R for each face nw Project the normal vector of the plane to two dimensions, then intersect all the lines on the plane in pairs on the two-dimensional plane and take the intersection point. Compare the distance between the intersection point and the endpoint. If they are close, pull the endpoint over. In this way, each line will have a corrected projection on each plane that generates it, and then use R wn Rotate back to the original coordinate system; Step S42: In the global three-dimensional coordinate system, the endpoints of each line are averaged with respect to the endpoints of their correction values ​​on each plane.

7. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The step S5 further comprises the following sub-steps: Step S51: for all the intersection boundaries of each face, find the two points on its own boundary that are closest to its two endpoints. If the distance is less than a threshold, and more than 80% of the points between the two endpoints of its own boundary are less than the same threshold from the line segment, then replace this rough boundary with this intersection line. Step S52: After the replacement is completed, for the remaining self-boundaries, traverse and find the connected short line segments with similar slopes. If the endpoints on both sides of the line segment set belong to the intersection boundary, they are directly connected as a line segment; otherwise, the endpoints of the line segment set are used to fit the straight line to obtain the direction of the new line segment, and the points at both ends belonging to the self-boundary are projected onto the straight line to obtain a new line segment.

8. The method for generating a three-dimensional point cloud geometric grid structure based on plane recognition according to claim 1, characterized in that: The ear cutting method process in step S6 is as follows: Step S61: Create a bidirectional linked list consisting of all vertices; Step S62: Circular bidirectional linked list, for vertex Check whether it is a convex point and whether there are other points in the linked list in the triangle If it is a convex point and there are no other points in the linked list, the triangle Add to the grid and remove v from the linked list i ; Step S63: loop until only the last triangle is left in the linked list and add it to the grid; Among them, the method of judging whether it is a convex point is to calculate If it is regular, it is convex, otherwise it is concave; to determine whether other points are inside the triangle, the centroid method is used. Specifically, for any point Establish It can be solved If λ2=D1 / D, λ2=D2 / D, and 1-λ2-λ3 are all between 0 and 1, then the point is inside the triangle; in, is a vertex on the plane, It is a triangle composed of three points. and is a vector composed of two points, and D, D1, D2, λ2, and λ3 are all ordinary scalars.

Citation Information

Patent Citations

  • Scattered point cloud Delaunay triangulation curved surface reconstruction method based on mapping method

    CN103985155A

  • Method for automatically identifying multiple planes in three-dimensional point cloud

    CN105046688A

  • Optimal reconstruction method for a complex three-dimensional building point cloud roof and a side surface

    CN109993783A

  • Method and device for generating panorama by optimizing depth map

    CN111563965A

  • Feature line fused laser point cloud and analog image registration method

    CN111709981A