Plane point cloud extraction method and device, electronic equipment and storage medium
By combining voxelization and supervoxel clustering with a neighborhood region growing algorithm, the problems of slow point cloud data processing speed and poor robustness in existing technologies are solved, and efficient extraction of planar point clouds is achieved, which is suitable for application scenarios such as autonomous driving and 3D modeling.
Patent Information
- Application Number
- CN202411557815.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2024-11-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies are cumbersome, slow, and have poor robustness when processing high-density, large-scale unordered point cloud data, making it difficult to extract planar point clouds quickly and efficiently.
Supervoxes are generated through voxelization. Then, by combining supervoxel clustering and neighborhood region growing algorithms, neighborhood region growing clustering is performed, followed by plane fitting and filtering to extract planar point cloud data.
It enables rapid and efficient extraction of planar point clouds from large amounts of unordered point cloud data, improving processing speed and robustness, and is applicable to fields such as autonomous driving, digital twin cities, and 3D modeling.
Smart Images

Figure CN119048788A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving technology, and in particular to a planar point cloud extraction method, device, electronic device and storage medium. Background Art
[0002] Point cloud data has been widely used in fields such as autonomous driving, real-life 3D modeling, and binocular vision due to its high point distribution density, accurate spatial relationships, and rich information. However, since point cloud data is usually disordered and large in volume, how to efficiently process this data has become a key technical issue in related fields. Different application scenarios have different requirements for point cloud data. For example, building facade and plane data in digital twin cities, road facility data in autonomous driving, and tree data in forestry all require targeted extraction and processing of point clouds.
[0003] Currently, point cloud data obtained from actual measurements often contain a variety of information (such as planes, road facilities, trees, etc.), and are in a disordered form and cannot be directly distinguished. To this end, domestic and foreign experts have proposed a variety of point cloud data classification and processing methods, mainly including supervised classification algorithms based on model training and unsupervised classification algorithms based on geometric features. Among them, supervised classification algorithms rely on prior knowledge input, are complex to implement, and limit their practical application; and although unsupervised classification algorithms do not require prior knowledge, most of them have slow processing speeds and are difficult to cope with large-scale, uneven quality point cloud data, resulting in deficiencies in real-time and accuracy.
[0004] Therefore, when processing high-density, large-scale unordered point cloud data, existing technologies face problems such as cumbersome algorithms, slow processing speeds, and limited applications. There is an urgent need for a solution that can efficiently extract specific features of point clouds. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a plane point cloud extraction method, device, electronic device and storage medium to solve the problems existing in the prior art that plane point clouds cannot be extracted quickly and efficiently from a large amount of disordered point cloud data, and the algorithm is cumbersome, the processing speed is slow, and the robustness is poor.
[0006] According to a first aspect of an embodiment of the present application, a method for extracting a plane point cloud is provided, comprising: obtaining original point cloud data, performing voxelization processing on the original point cloud data to divide the original point cloud data into multiple voxels; performing supervoxel clustering processing on the voxels based on the spatial neighborhood relationship between the voxels to generate multiple supervoxels; executing a neighborhood region growth clustering algorithm based on the neighborhood information between the supervoxels to perform plane clustering processing on the supervoxels to generate multiple plane clustering results; performing plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation, extracting plane point cloud data based on the plane fitting equation, and filtering the plane point cloud data to obtain filtered plane point cloud data.
[0007] According to a second aspect of an embodiment of the present application, a plane point cloud extraction device is provided, comprising: an acquisition module, configured to acquire original point cloud data, and voxelize the original point cloud data to divide the original point cloud data into multiple voxels; a supervoxel clustering module, configured to perform supervoxel clustering on voxels based on the spatial neighborhood relationship between voxels to generate multiple supervoxels; a plane clustering module, configured to execute a neighborhood region growth clustering algorithm based on the neighborhood information between supervoxels to perform plane clustering on supervoxels to generate multiple plane clustering results; a fitting filtering module, configured to perform plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation, extract plane point cloud data based on the plane fitting equation, and filter the plane point cloud data to obtain filtered plane point cloud data.
[0008] According to a third aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.
[0009] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0010] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: By acquiring the original point cloud data, the original point cloud data is voxelized to divide the original point cloud data into multiple voxels; based on the spatial neighborhood relationship between the voxels, the voxels are subjected to supervoxel clustering to generate multiple supervoxels; based on the neighborhood information between the supervoxels, the neighborhood region growth clustering algorithm is executed to perform plane clustering on the supervoxels to generate multiple plane clustering results; the cluster point set in the plane clustering result is plane fitted to obtain the plane fitting equation, the plane point cloud data is extracted based on the plane fitting equation, and the plane point cloud data is filtered to obtain the filtered plane point cloud data. The present application can quickly and efficiently extract plane point clouds from a large amount of disordered point cloud data, while reducing the amount of calculation and improving the processing speed and robustness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0012] Figure 1 It is a flow chart of the planar point cloud extraction method provided in the embodiment of the present application; Figure 2 It is a schematic diagram of the relationship between the 26 neighborhoods of a voxel and the k-order neighborhood of a point cloud provided in an embodiment of the present application; Figure 3 It is a schematic diagram of the processing flow of the neighborhood region growing clustering algorithm provided in the embodiment of the present application; Figure 4 is a schematic diagram of the operation flow of the planar filter module provided in an embodiment of the present application; Figure 5 is a schematic diagram of the structure of a planar point cloud extraction device provided in an embodiment of the present application; Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0014] Point cloud data has many characteristics such as high point distribution density, disordered data, accurate spatial relationship, large data volume and rich information. It has been widely used in related fields such as autonomous driving, real-life 3D modeling and binocular vision. Processing high-density, large-volume disordered point clouds is a step that cannot be avoided in these fields. The demand for point cloud data varies greatly in different application scenarios: for digital twin cities, the most concerned is the point cloud data of plane types such as building facades and road surfaces; for autonomous driving, it is more inclined to use point cloud data of road facilities such as lane lines, traffic lights, and signs; and for forestry, it may pay more attention to the point cloud data of trees.
[0015] However, the point cloud data actually measured in the field cannot directly distinguish information such as planes, road facilities, and trees. These point clouds are recorded by the measuring equipment as a whole and in a disordered order. In order to classify these point clouds, domestic and foreign experts have provided a lot of processing methods, which can be mainly divided into supervised classification algorithms based on model training and unsupervised classification algorithms based on geometric features. Among them, supervised classification algorithms require prior knowledge as input, and their application is relatively cumbersome; while most unsupervised classification algorithms have a slow processing speed and are difficult to apply to point cloud data with large data volumes and different quality.
[0016] In view of the problems existing in the above-mentioned prior art, this application proposes a method combining supervoxel clustering and region growing in an unsupervised classification algorithm based on geometric features, which can realize the rapid extraction of planar point clouds from point cloud data. The planar point cloud extraction method provided by this application mainly includes the following processing steps: S1: Input point cloud data, perform voxelization and supervoxel growth on the point cloud data through the supervoxel clustering algorithm, and output the supervoxel clustering results, the normal and curvature information of the supervoxel, and the spatial adjacency relationship of the supervoxel.
[0017] S2: Read the supervoxel clustering result output by the previous module, perform planar growth on the supervoxel through the k-order neighborhood region growing clustering algorithm, and generate a planar clustering result based on the processing of normal, curvature and spatial position relationship.
[0018] S3: Perform RANSAC (Random Sample Consensus) plane fitting on the clustering results output by the region growing clustering algorithm, obtain the corresponding plane fitting equation and input it into the plane filter module, and extract the ideal plane data through the relevant data.
[0019] The contents of the technical solution of the present application are described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] Figure 1Schematic diagram of the process of extracting a planar point cloud provided by an embodiment of the present application. Figure 1 As shown, the plane point cloud extraction method may specifically include: S101, obtaining original point cloud data, and performing voxel processing on the original point cloud data to divide the original point cloud data into a plurality of voxels; S102, performing supervoxel clustering processing on the voxels based on the spatial neighborhood relationship between the voxels to generate multiple supervoxels; S103, executing a neighborhood region growing clustering algorithm based on neighborhood information between supervoxels to perform planar clustering processing on the supervoxels to generate multiple planar clustering results; S104, performing plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation, extracting plane point cloud data based on the plane fitting equation, and filtering the plane point cloud data to obtain filtered plane point cloud data.
[0021] In some embodiments, voxelization is performed on the raw point cloud data, including: An octree is constructed based on the original point cloud data, and the original point cloud data is voxelized at a preset resolution to divide the original point cloud data into a plurality of voxels, wherein each voxel is used to represent a volume element in a three-dimensional space; A neighborhood search is performed based on the octree to obtain the spatial neighborhood relationship of each voxel, the eigenvalue decomposition is performed on the neighborhood data of each voxel, the normal and curvature information of each voxel is calculated, and the initial seed voxel for generating supervoxels is constructed.
[0022] Specifically, the embodiment of the present application provides a specific method for voxelizing raw point cloud data. First, an octree index structure is constructed based on the raw point cloud data, and an octree index structure is constructed with a preset resolution. The original point cloud data is voxelized. The purpose of voxelization is to divide the point cloud data in three-dimensional space into multiple voxels, each voxel represents a three-dimensional space volume unit, which serves as the basic unit for subsequent supervoxel clustering.
[0023] Furthermore, during the voxelization process, the spatial neighborhood relationship of each voxel is obtained through the neighborhood search of the octree. Specifically, Figure 2 26 neighborhoods of voxels and k-order neighborhoods of point clouds provided in the embodiment of the present application are shown in FIG. Figure 2 As shown, Figure 2 The left picture in the figure is the 26 neighborhood of the voxel. Figure 2The right figure in the figure is the k-order neighborhood of the supervoxel. The neighborhood search is performed through a 26-neighborhood structure, which represents the relationship between a voxel and its 26 neighboring voxels in three-dimensional space. After obtaining the voxel neighborhood, the neighborhood data of each voxel is decomposed by eigenvalues to calculate the normal and curvature information of each voxel. These feature information are used for subsequent clustering and region growing processing.
[0024] Furthermore, based on the 26 neighborhood relationship of voxels, a supervoxel clustering algorithm is used to generate supervoxels. The supervoxel clustering algorithm is a mature point cloud processing algorithm for clustering adjacent voxels into larger supervoxel units. In this embodiment, the algorithm does not depend on the RGB color space and simplifies the calculation process of some control factors. In this way, supervoxel clustering can process large-scale point cloud data more efficiently.
[0025] Furthermore, after completing the supervoxel clustering, the k-order neighborhood information of the supervoxel is further obtained by extending the neighborhood search (such as Figure 2 The k-order neighborhood relationship refers to the spatial relationship between a supervoxel and its surrounding multiple levels of neighboring supervoxels, which provides the necessary geometric basis for subsequent plane fitting and region growing.
[0026] Through the above-mentioned voxelization processing and supervoxel clustering, this embodiment can efficiently organize point cloud data and lay a foundation for subsequent steps (such as region growing clustering and plane fitting).
[0027] In some embodiments, constructing an initial seed voxel for generating a supervoxel includes: According to the coordinates of each voxel in the leaf node of the octree, the center point of each supervoxel grain is calculated; Search the nearest neighbor of each supervoxel grain and count the number of voxels within a preset neighborhood radius; When the number of voxels meets a predetermined condition, the voxels that meet the predetermined condition are marked as valid seed voxels, and the valid seed voxels are added to the seed voxel set.
[0028] Specifically, this embodiment also provides a method for constructing an initial seed voxel for generating a supervoxel. First, an octree index is constructed based on the original point cloud data. The octree index helps to efficiently organize and retrieve voxel data in three-dimensional space. The resolution of each supervoxel grain is set to , which defines the spatial size of each supervoxel grain.
[0029] In one example, the spatial coordinate information of each voxel is extracted from the leaf node of the octree, and the center point of each supervoxel grain is calculated using these coordinates. The center point is used for subsequent supervoxel growth and clustering operations.
[0030] Furthermore, the nearest neighbor of each supervoxel grain is searched through the neighborhood search algorithm. The radius range of the search is set to , that is, the number of voxels around the supervoxel grain within this radius is counted . The number of voxels is The statistical range is centered on the grain and relevant data is collected within its neighborhood. Through this search, the distribution of spatial points around the supervoxel grain can be determined.
[0031] Furthermore, in order to improve the selection accuracy of seed voxels, when the number of voxels obtained is counted When the value is less than the preset threshold, the supervoxel will be marked as a valid seed voxel. The calculation is based on the following formula:
[0032] in, is the voxel resolution. This formula is used to determine the voxel distribution density around each supervoxel grain, ensuring that only supervoxels with sparse distribution are selected as seed voxels.
[0033] Once the above predetermined conditions are met, the selected valid seed voxels will be added to the seed voxel set. The seed voxels in this set will be used for subsequent supervoxel cluster growth as the initial growth starting point. In this way, it can be ensured that the selection of the initial seed voxels is not only spatially reasonable, but also can improve the efficiency and accuracy of the clustering algorithm.
[0034] In some embodiments, performing supervoxel clustering on voxels based on spatial neighborhood relationships between voxels includes: Set the initial parameters of the supervoxel clustering algorithm, perform a spatial neighborhood search for each voxel, obtain the neighboring voxels of each voxel based on the octree index, and record the spatial neighborhood relationship of each voxel; Iterate each voxel and perform growth operations on all voxels belonging to the supervoxel unit cell; After the iteration is completed, a supervoxel clustering result is generated, and the spatial adjacency relationship between supervoxel cells is saved using an octree index, wherein the supervoxel clustering result includes the normal vector, curvature, and first-order neighborhood relationship of each supervoxel.
[0035] Specifically, we first set the initial parameters of the supervoxel clustering algorithm, including specifying the number of iterations. , as well as control factors of the growth operation, such as the distance threshold between voxels. The purpose of supervoxel clustering is to merge adjacent voxels into supervoxel units through iterative traversal.
[0036] Furthermore, a spatial neighborhood search is performed on each voxel in the point cloud based on the octree index structure. The octree index can efficiently organize point cloud data in three-dimensional space, ensuring that the neighborhood voxels of each voxel can be quickly obtained during the search process. The neighborhood relationship of each voxel is determined by the spatial relationship of the octree, and the indexes and positions of these neighborhood voxels are recorded for subsequent processing.
[0037] Furthermore, after the spatial neighborhood relationship is determined, an iterative traversal is performed. In each iteration, the supervoxel cell will perform a growth operation to gradually merge the voxels in its neighborhood into the supervoxel. The growth process is based on preset attribute distances, such as normal vectors, curvature, and spatial position information, to ensure that adjacent voxels have similar geometric and spatial characteristics before being merged into the same supervoxel.
[0038] Furthermore, in the iterative traversal, each voxel will calculate its attribute distance with the neighboring voxels. If the distance is less than the specified threshold, the voxel will be included in the current supervoxel cell, and the geometric center and related attributes of the supervoxel, such as the normal vector and curvature, will be updated. As the number of iterations increases, the growth of the supervoxel gradually stabilizes.
[0039] After processing is completed, the final supervoxel clustering result is generated Supervoxel clustering results Each supervoxel is contained in The unit normal vector , curvature And the first-order neighborhood relationship , ensuring that the geometric characteristics of each supervoxel are complete and accurate. In addition, with the help of the octree structure, the system can store the spatial adjacency relationship between each supervoxel unit cell for subsequent plane fitting or other point cloud processing operations.
[0040] The supervoxel clustering algorithm achieves grain fusion and core bias adjustment through iterative growth. The iterative growth of supervoxels ensures the stability and accuracy of clustering. After the clustering process is completed, the supervoxel clustering results output by the system can be used for subsequent data processing or three-dimensional modeling.
[0041] It should be noted that the embodiment of the present application can control the speed and accuracy of supervoxel growth by setting the number of iterations and the growth threshold to ensure the accuracy of clustering. The neighborhood voxel information of each voxel is obtained through the octree index to ensure that the geometric and spatial properties between voxels are similar each time they are merged, thereby reducing the occurrence of erroneous clustering. Each supervoxel will eventually contain key geometric features such as normal vectors and curvatures, and store its spatial adjacency with other supervoxels, providing a basis for subsequent processing.
[0042] In some embodiments, each voxel is iterated and a growth operation is performed on all voxels belonging to the supervoxel unit cell, including: Calculating the first attribute distance between each neighboring voxel and the center of the current supervoxel unit cell, and determining the second attribute distance between each neighboring voxel and the center of the original supervoxel unit cell; When the first attribute distance is less than the second attribute distance, the neighboring voxels are reallocated to the current supervoxel unit cell, and the center positions of all supervoxel unit cells are updated.
[0043] Specifically, each voxel is iterated through the preset spatial neighborhood relationship. For each voxel and its neighboring voxels, the system will calculate two key attribute distances respectively: First attribute distance: This distance refers to the distance between the current neighborhood voxel and the center of its nearest supervoxel cell; The second attribute distance: This distance is the distance between the neighboring voxel and the center of the supervoxel cell to which it originally belonged.
[0044] In each iteration, for each neighbor voxel, if the calculated first attribute distance is less than the second attribute distance, the voxel is reallocated to the current supervoxel cell. This reallocation process not only changes the voxel's ownership, but also updates the properties of the current supervoxel cell, including its geometric center and spatial relationship with other voxels.
[0045] For example, in one example, for each voxel and its neighboring voxels, the system first calculates the attribute distance between them D , the attribute distance D This can include spatial distance, normal vector angle, or curvature difference. D The calculation formula is:
[0046] in, They represent the proportion of the influence of Euclidean space distance and normal direction on attribute distance respectively; Respectively represent the Euclidean space three-dimensional coordinates of two voxels; Represent the unit normal of the two voxels respectively.
[0047] If the calculated attribute distance D If the distance between the neighbor voxel and its original supervoxel unit cell is smaller than that between the neighbor voxel and its original supervoxel unit cell, the neighbor voxel will be migrated to the current supervoxel unit cell. After the voxel is migrated, the geometric center of the current supervoxel unit cell will also be updated. The update of the geometric center is completed by recalculating the average coordinates of all voxels belonging to the supervoxel unit cell, so as to keep the spatial position of the supervoxel accurate.
[0048] When a growth iteration is completed, the system will update the center position of all supervoxel cells to ensure that the redistribution of voxels makes reasonable adjustments to the spatial position of each supervoxel cell. Through this gradual iterative growth, the accuracy of supervoxel clustering can be effectively improved and the accumulation of errors can be reduced.
[0049] It should be noted that the calculation of attribute distance includes the calculation of geometric distance, but it can also be extended to other attributes, such as the angle of the normal vector, curvature, etc., to ensure that the re-attribution of voxels conforms to geometric and physical characteristics. Each iteration will update the center coordinates of the supervoxel unit cell to ensure that each voxel can be assigned to the most appropriate supervoxel, and the number of iterations can be adjusted according to the amount of data and accuracy requirements. The attribution of voxels is dynamically adjusted to ensure that neighboring voxels are always assigned to the nearest and most similar supervoxel unit cell, ensuring the rationality of the clustering results.
[0050] In some embodiments, based on the neighborhood information between supervoxels, a neighborhood region growing clustering algorithm is executed to perform planar clustering processing on the supervoxels to generate multiple planar clustering results, including: Based on the supervoxel clustering result, a corresponding neighborhood mapping function is generated for each supervoxel, wherein the neighborhood mapping function is used to define the spatial relationship between the supervoxel and the adjacent supervoxels; Obtaining neighborhood information corresponding to each supervoxel, wherein the neighborhood information includes a spatial position relationship and geometric features of the supervoxel; Calling a neighborhood region growing clustering algorithm and taking the neighborhood information of the supervoxel as input, wherein the neighborhood region growing clustering algorithm clusters the supervoxels with similar geometric features into the same plane point cloud set based on the normal vector, curvature and spatial position relationship of the supervoxel; A plurality of plane clustering results consisting of the plane point cloud sets are generated, wherein each plane clustering result represents a supervoxel set with similar plane features.
[0051] Specifically, based on the preliminary supervoxel clustering results, a corresponding neighborhood mapping function is generated for each supervoxel. This mapping function is used to define the spatial relationship between a supervoxel and its neighboring supervoxels, especially the connection between geometrically adjacent supervoxels. The neighborhood mapping function is the basis for building the clustering process, ensuring that the relationship between supervoxels can accurately reflect their spatial contact and geometric characteristics.
[0052] Next, the neighborhood information of each supervoxel is obtained. This neighborhood information includes the spatial position, normal vector, curvature and other geometric features of the supervoxel. By analyzing this information, the similarity between each supervoxel and its neighboring supervoxels can be accurately described. For example, the similarity of normal vectors and curvatures can indicate whether the supervoxels are in the same plane or share similar geometric features.
[0053] Then, the neighborhood region growing clustering algorithm is called. This algorithm performs clustering based on the neighborhood information of supervoxels. It mainly clusters supervoxels with similar geometric features into a plane point cloud set by analyzing the normal vector, curvature and spatial position relationship of each supervoxel. Specifically, the neighborhood region growing clustering algorithm traverses the neighborhood data of the supervoxel and gradually expands the boundary of the plane area to ensure that all similar supervoxels are included in the same plane set.
[0054] In one example, in order to obtain wider neighborhood information of a supervoxel, a BFS (Breadth First Search) or DFS (Depth First Search) method is used to search and obtain [1, k ] order neighborhood. This neighborhood information is used to ensure that the relationship between supervoxels can be extended to a higher level, providing more accurate clustering results.
[0055] After the algorithm is executed, the system will generate multiple plane clustering results consisting of plane point cloud sets. Each plane clustering result represents a supervoxel set with similar plane features, which can be used for subsequent plane extraction or other data processing.
[0056] The neighborhood region growing clustering algorithm provided in this embodiment may include the following two main steps: Constructing a supervoxel neighborhood mapping function: Obtain multi-order neighborhood information of a supervoxel through BFS or DFS search, and generate a neighborhood mapping function for describing the spatial relationship between a supervoxel and its adjacent supervoxels.
[0057] Perform neighborhood growing clustering: Based on plane features such as normal vectors, curvature, and positional relationships, supervoxels with similar features are clustered together and multiple plane clustering results are output.
[0058] Through this method, supervoxels with similar planar features can be efficiently clustered into a planar point cloud set, thereby realizing plane extraction from complex point cloud data.
[0059] In another specific example, after obtaining the processed supervoxel clustering results and the adjacency relationship between supervoxels, the present application can enter [1, k ] order neighborhood region growing clustering algorithm, the algorithm uses plane features as clustering basis to output clustering results. The algorithm consists of two steps: constructing a supervoxel neighborhood mapping function and executing the neighborhood growing clustering algorithm. The following is a description of the specific steps: First, given each supervoxel generated by the supervoxel clustering algorithm in the above embodiment The corresponding first-order neighborhood function , you can use BFS (Breadth First Search) or DFS (Depth First Search) to get its [1, k ] order neighborhood. This application provides a method for obtaining supervoxels [1, k The algorithm of the ]-order neighborhood mapping function is as follows:
[0060] Furthermore, the processing results of the supervoxel clustering algorithm and the [1, k ] order neighborhood mapping function, the neighborhood region growth clustering algorithm provided in this application can be called to cluster the supervoxel clustering results based on the plane features of the point cloud, and output a point set consisting of multiple clustering results The neighborhood area growth clustering result point set is constructed.
[0061] The processing flow of the neighborhood region growing clustering algorithm is as follows Figure 3 shown. Figure 3 : is a schematic diagram of the processing flow of the neighborhood region growing clustering algorithm provided in an embodiment of the present application, wherein: are the curvature threshold and the normal angle threshold respectively, and each supervoxel of the two supervoxel points The normal angle It can be calculated by the following formula:
[0062] in, Represent the unit normal of the two voxels respectively.
[0063] In some embodiments, performing plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation includes: Performing plane fitting on the cluster point set in the plane clustering result based on a random sampling consensus algorithm to generate a plane fitting equation, wherein the plane fitting equation is constructed by the cluster point set, the plane normal vector and the plane offset; Apply the plane fitting equation to each point in the cluster point set, and project each point in the cluster point set onto the plane; Perform coordinate transformation on the points projected onto the plane, establish the local coordinate system of the plane, perform uniform transformation on the points based on the local coordinate system of the plane, and output the plane fitting result.
[0064] Specifically, the clustering result point set output by the region growing clustering operator Perform RANSAC plane fitting, obtain the corresponding plane fitting equation and input it into the plane filter module, and extract the ideal plane data through the relevant data. The required plane point cloud can be obtained by successively passing confidence filtering, area filtering, and direction filtering. However, these filters are preset filters and can be combined by themselves in actual applications. Figure 4 is a schematic diagram of the operation flow of the planar filter module provided in the embodiment of the present application, such as Figure 4 The plane equation used in this application is in the form of:
[0065] S41, plane fitting: for each cluster point set in the cluster result point set Perform RANSAC plane fitting to obtain the four equation coefficients of the above plane equation, and let the plane normal , the equation can be rewritten as a vector equation: ; Take the unit plane normal , then the following formula can be used to project the projection points in the cluster point set onto the plane corresponding to the plane equation:
[0066] in, Represents cluster point set The point in Represents the point after projection to the plane equation; after conversion, a plane coordinate system can also be established, and the projected points can be uniformly converted to the plane local coordinate system to reduce the amount of calculation.
[0067] S42, confidence filtering: After fitting a plane using RANSAC, the ratio of the number of inner points to the total number of points can be determined by the distance from the point to the plane. , and use this as the confidence of the plane, by setting the confidence threshold That is, some point clouds with weaker plane features can be filtered out in the plane filter.
[0068] S43, area filtering: Considering the discreteness and irregularity of point cloud data, it is often difficult to achieve robust results by calculating the area of plane projection points through traditional convex hull and concave hull; therefore, this application applies the principle of Monte Carlo scattering method to calculate the area of irregular areas composed of plane point sets in the form of grid approximation. The specific operation steps are: ① Calculate the bounding box of the plane point set; ② Construct a box with a size of s ③Distribute the plane point set in the grid and count the number of grids with non-zero points K , then the area of the irregular region can be described as: ; By setting the area threshold That is, some plane point clouds with areas that are too large or too small can be filtered out in the filter.
[0069] S44, Direction filtering: In different point cloud applications, there is a clear preference for the direction of the plane point cloud; for example, in the field of architecture, more attention may be paid to the direction perpendicular to the plane point cloud. xy The point cloud of the building facade is parallel to the plane. In the field of autonomous driving, more emphasis may be placed on the point cloud of the building facade. xy The processing of the plane road point cloud; therefore, by calculating the fitting plane normal and xy The angle between the plane normal (0,0,1) and the direction threshold , some plane point clouds that do not meet the group directional feature requirements can be filtered out in the filter.
[0070] This application uses a series of innovative processing methods to efficiently extract the plane point cloud data required for engineering applications from large-scale and disordered raw point cloud data. Specifically, this application combines the efficient processing capabilities of the supervoxel clustering algorithm with the improved region growing algorithm to achieve fast and accurate plane point cloud extraction. According to the technical solution provided in the embodiment of this application, the technical solution of this application has at least the following advantages: First, the supervoxel clustering algorithm can effectively process point cloud data in blocks at the voxel level, and with its efficient spatial neighborhood search capability, it significantly improves processing speed and data organization efficiency. Through supervoxel generation and clustering based on geometric features, the algorithm can quickly capture local geometric features in point cloud data, thus laying a solid foundation for subsequent plane extraction.
[0071] Secondly, the present application improves the traditional region growing algorithm by combining the domain information of supervoxels. When performing region growing, the improved algorithm can effectively suppress overgrowth according to the geometric feature relationship between supervoxels and ensure accurate extraction of plane features. This improvement performs well in reducing noise interference and improving the robustness of plane data.
[0072] Finally, the plane point cloud extraction method proposed in this application has achieved a good balance between computational accuracy and processing efficiency, and can be applied to point cloud processing requirements for large amounts of data and complex scenes. This method not only improves the accuracy and processing speed of plane extraction, but also enhances its adaptability to different types of point cloud data, making it widely applicable to a variety of scenarios in engineering practice, such as autonomous driving, digital twin cities, and 3D modeling.
[0073] The following is an embodiment of the device of the present application at the bottom of the window, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application. Figure 5 Schematic diagram of the structure of the planar point cloud extraction device provided in the embodiment of the present application. Figure 5 As shown, the plane point cloud extraction device includes: The acquisition module 501 is configured to acquire original point cloud data and perform voxelization processing on the original point cloud data to divide the original point cloud data into a plurality of voxels; The supervoxel clustering module 502 is configured to perform supervoxel clustering processing on the voxels based on the spatial neighborhood relationship between the voxels to generate a plurality of supervoxels; The plane clustering module 503 is configured to execute a neighborhood region growing clustering algorithm based on neighborhood information between supervoxels to perform plane clustering processing on the supervoxels and generate multiple plane clustering results; The fitting and filtering module 504 is configured to perform plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation, extract plane point cloud data based on the plane fitting equation, and filter the plane point cloud data to obtain filtered plane point cloud data.
[0074] In some embodiments, Figure 5 The acquisition module 501 constructs an octree based on the original point cloud data, and voxelizes the original point cloud data at a preset resolution, dividing the original point cloud data into multiple voxels, wherein each voxel is used to represent a volume element in a three-dimensional space; performs a neighborhood search based on the octree, obtains the spatial neighborhood relationship of each voxel, performs eigenvalue decomposition on the neighborhood data of each voxel, calculates the normal and curvature information of each voxel, and constructs an initial seed voxel for generating a super voxel.
[0075] In some embodiments, Figure 5 The acquisition module 501 calculates the center point of each supervoxel grain according to the coordinates of each voxel in the leaf node of the octree; searches for the nearest neighbor point of each supervoxel grain, and counts the number of voxels within a preset neighborhood radius; when the number of voxels meets a predetermined condition, marks the voxel that meets the predetermined condition as a valid seed voxel, and adds the valid seed voxel to the seed voxel set.
[0076] In some embodiments, Figure 5 The supervoxel clustering module 502 sets the initial parameters of the supervoxel clustering algorithm, performs a spatial neighborhood search for each voxel, obtains the neighboring voxels of each voxel based on the octree index, and records the spatial neighborhood relationship of each voxel; it iterates each voxel, and performs a growth operation on all voxels belonging to the supervoxel unit cell; after the iteration is completed, a supervoxel clustering result is generated, and the spatial adjacency relationship between the supervoxel units is saved using the octree index, wherein the supervoxel clustering result includes the normal vector, curvature and first-order neighborhood relationship of each supervoxel.
[0077] In some embodiments, Figure 5The supervoxel clustering module 502 calculates the first attribute distance between each neighboring voxel and the center of the current supervoxel cell, and determines the second attribute distance between each neighboring voxel and the center of the original supervoxel cell; when the first attribute distance is less than the second attribute distance, the neighboring voxel is reallocated to the current supervoxel cell, and the center positions of all supervoxel cells are updated.
[0078] In some embodiments, Figure 5 The plane clustering module 503 generates a corresponding neighborhood mapping function for each supervoxel based on the supervoxel clustering result, wherein the neighborhood mapping function is used to define the spatial relationship between the supervoxel and the adjacent supervoxels; obtains the neighborhood information corresponding to each supervoxel, wherein the neighborhood information includes the spatial position relationship and geometric features of the supervoxel; calls the neighborhood region growing clustering algorithm, and uses the neighborhood information of the supervoxel as input, wherein the neighborhood region growing clustering algorithm clusters the supervoxels with similar geometric features into the same plane point cloud set based on the normal vector, curvature and spatial position relationship of the supervoxel; generates multiple plane clustering results composed of plane point cloud sets, wherein each plane clustering result represents a supervoxel set with similar plane features.
[0079] In some embodiments, Figure 5 The fitting filtering module 504 performs plane fitting on the cluster point set in the plane clustering result based on the random sampling consistency algorithm, generates a plane fitting equation, wherein the plane fitting equation is constructed by the cluster point set, the plane normal vector and the plane offset; applies the plane fitting equation to each point in the cluster point set, and projects each point in the cluster point set onto the plane; performs coordinate transformation on the points projected onto the plane, establishes a plane local coordinate system, uniformly transforms the points based on the plane local coordinate system, and outputs the plane fitting result.
[0080] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0081] Figure 6 Schematic diagram of the structure of the electronic device 6 provided in the embodiment of the present application. Figure 6 As shown, the electronic device 6 of this embodiment includes: a processor 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program 603, the steps in the above-mentioned various method embodiments are implemented. Alternatively, when the processor 601 executes the computer program 603, the functions of each module / unit in the above-mentioned various device embodiments are implemented.
[0082] Exemplarily, the computer program 603 may be divided into one or more modules / units, which are stored in the memory 602 and executed by the processor 601 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 603 in the electronic device 6.
[0083] The electronic device 6 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 6 may include, but is not limited to, a processor 601 and a memory 602. Those skilled in the art will appreciate that Figure 6 It is only an example of the electronic device 6 and does not constitute a limitation of the electronic device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0084] The processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0085] The memory 602 may be an internal storage unit of the electronic device 6, for example, a hard disk or memory of the electronic device 6. The memory 602 may also be an external storage device of the electronic device 6, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. Further, the memory 602 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 602 is used to store computer programs and other programs and data required by the electronic device. The memory 602 may also be used to temporarily store data that has been output or is to be output.
[0086] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0087] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0088] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0089] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0090] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0091] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0092] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0093] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for extracting a plane point cloud, characterized in that: include: Acquire original point cloud data, and perform voxelization processing on the original point cloud data to divide the original point cloud data into a plurality of voxels; Based on the spatial neighborhood relationship between the voxels, performing supervoxel clustering processing on the voxels to generate a plurality of supervoxels; Based on the neighborhood information between the supervoxels, a neighborhood region growing clustering algorithm is executed to perform planar clustering processing on the supervoxels to generate a plurality of planar clustering results; Performing plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation, extracting plane point cloud data based on the plane fitting equation, and filtering the plane point cloud data to obtain filtered plane point cloud data.
2. The method according to claim 1, characterized in that: The voxelization processing of the original point cloud data comprises: An octree is constructed based on the original point cloud data, and the original point cloud data is voxelized at a preset resolution to divide the original point cloud data into a plurality of voxels, wherein each voxel is used to represent a volume element in a three-dimensional space; A neighborhood search is performed based on the octree to obtain the spatial neighborhood relationship of each voxel, eigenvalue decomposition is performed on the neighborhood data of each voxel, the normal and curvature information of each voxel is calculated, and an initial seed voxel for generating a supervoxel is constructed.
3. The method according to claim 2, characterized in that The method of constructing an initial seed voxel for generating a supervoxel comprises: Calculate the center point of each supervoxel grain according to the coordinates of each voxel in the leaf node of the octree; Searching for the nearest neighbor point of each supervoxel grain, and counting the number of voxels within a preset neighborhood radius; When the number of voxels meets a predetermined condition, the voxels that meet the predetermined condition are marked as valid seed voxels, and the valid seed voxels are added to the seed voxel set.
4. The method according to claim 1, characterized in that The performing supervoxel clustering processing on the voxels based on the spatial neighborhood relationship between the voxels comprises: Set the initial parameters of the supervoxel clustering algorithm, perform a spatial neighborhood search for each voxel, obtain the neighboring voxels of each voxel based on the octree index, and record the spatial neighborhood relationship of each voxel; Iterate each voxel and perform growth operations on all voxels belonging to the supervoxel unit cell; After the iteration is completed, a supervoxel clustering result is generated, and the spatial adjacency relationship between the supervoxel cells is saved using an octree index, wherein the supervoxel clustering result includes a normal vector, a curvature, and a first-order neighborhood relationship of each supervoxel.
5. The method according to claim 4, characterized in that The iterative traversal of each voxel and the growth operation of all voxels belonging to the supervoxel unit cell include: Calculating a first attribute distance between each of the neighboring voxels and the center of the current supervoxel unit cell, and determining a second attribute distance between each of the neighboring voxels and the center of the original supervoxel unit cell; When the first attribute distance is smaller than the second attribute distance, the neighboring voxels are reallocated to the current supervoxel unit cell, and the center positions of all supervoxel unit cells are updated.
6. The method according to claim 1, characterized in that The executing a neighborhood region growing clustering algorithm based on the neighborhood information between the supervoxels to perform planar clustering processing on the supervoxels to generate a plurality of planar clustering results includes: Based on the supervoxel clustering result, generating a corresponding neighborhood mapping function for each supervoxel, wherein the neighborhood mapping function is used to define a spatial relationship between a supervoxel and adjacent supervoxels; Acquire neighborhood information corresponding to each supervoxel, wherein the neighborhood information includes a spatial position relationship and geometric features of the supervoxel; Calling the neighborhood region growing clustering algorithm and taking the neighborhood information of the supervoxel as input, wherein the neighborhood region growing clustering algorithm clusters the supervoxels with similar geometric features into the same plane point cloud set based on the normal vector, curvature and spatial position relationship of the supervoxel; A plurality of plane clustering results consisting of a set of plane point clouds are generated, wherein each of the plane clustering results represents a supervoxel set with similar plane features.
7. The method according to claim 1, characterized in that The performing plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation includes: Performing plane fitting on the cluster point set in the plane clustering result based on a random sampling consensus algorithm to generate a plane fitting equation, wherein the plane fitting equation is constructed by the cluster point set, the plane normal vector and the plane offset; Applying the plane fitting equation to each point in the cluster point set, and projecting each point in the cluster point set onto the plane; The coordinates of the points projected onto the plane are transformed to establish a local coordinate system of the plane, the points are uniformly transformed based on the local coordinate system of the plane, and the plane fitting result is output.
8. A planar point cloud extraction device, characterized in that: include: An acquisition module is configured to acquire original point cloud data and perform voxelization processing on the original point cloud data to divide the original point cloud data into a plurality of voxels; A supervoxel clustering module is configured to perform supervoxel clustering processing on the voxels based on the spatial neighborhood relationship between the voxels to generate a plurality of supervoxels; A plane clustering module is configured to execute a neighborhood region growing clustering algorithm based on neighborhood information between the supervoxels to perform plane clustering processing on the supervoxels and generate a plurality of plane clustering results; The fitting and filtering module is configured to perform plane fitting on the cluster point set in the plane clustering result to obtain a plane fitting equation, extract plane point cloud data based on the plane fitting equation, and filter the plane point cloud data to obtain filtered plane point cloud data.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Point cloud plane segmentation method based on rapid adjacent voxel query
CN110443810A
Three-dimensional building model construction method and device, electronic equipment and storage medium
CN112927370A
High-temperature point cloud super voxel segmentation method based on multi-objective optimization
CN117710391A
Point cloud segmentation method, device and equipment based on voxel and point set fusion
CN118135220A
Method and system for processing point-cloud data
US20230419659A1
Cited By
Fluid simulation method and device based on Niagarsa particle system
CN119294215A
Pavement flatness detection method and system based on binocular vision
CN119784817A
Displacement monitoring device and method for building deep foundation pit auxiliary supervision
CN120970502A
