Point cloud data lightweight method and system, and medium

By performing feature extraction, density partition downsampling and fusion processing on point cloud data, a balanced octree is built and point cloud accuracy is simplified, which solves the problems of low efficiency and unabated data volume in traditional point cloud slicing methods, and efficient point cloud data processing and loading is achieved.

CN119672134APending Publication Date: 2025-03-21GUANGZHOU FRONTOP DIGITAL ORIGINALITY TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411670178.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The traditional point cloud slicing method is inefficient and time-consuming when processing massive point cloud data, and fails to effectively reduce the amount of data. Especially for point cloud data with uneven data distribution, the loading efficiency is low.

Method used

By extracting the point cloud data feature, the first point cloud collection containing distributed features is obtained; the point cloud data is density partitioned and downsampled to obtain the second point cloud collection; the two are fused to build a balanced octree and simplify the point cloud accuracy to achieve effective reduction of data volume and improvement of slicing efficiency.

Benefits of technology

While effectively retaining the distribution characteristics of point cloud data, the amount of point cloud data is significantly reduced, and the efficiency and loading speed of point cloud slicing are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672134A_ABST
    Figure CN119672134A_ABST
Patent Text Reader

Abstract

The invention discloses a point cloud data lightweight method and system and a medium, and the method comprises the steps: carrying out the analysis of an obtained point cloud file, and extracting corresponding point cloud data; feature extraction is carried out on the point cloud data to obtain a first point cloud set, and the first point cloud set comprises distribution features of the point cloud data; performing density partitioning on the point cloud data to obtain a plurality of corresponding partitions, and performing down-sampling processing on the point cloud data in the partitions to obtain a second point cloud set; and fusing the first point cloud set and the second point cloud set to obtain a target point cloud set. According to the method, the data volume of the point cloud data can be effectively reduced while the distribution characteristics of the point cloud data are effectively reserved, and the point cloud slicing effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method, system and medium for lightweighting point cloud data. Background Art

[0002] Point cloud data refers to data composed of multiple discrete 3D points, which is widely used in 3D modeling, terrain mapping, urban planning, autonomous driving and other fields. However, there are still many difficulties in quickly processing massive point cloud data and then achieving fast rendering.

[0003] In order to quickly process point cloud data and quickly load and render point cloud data on the front-end platform, it is usually necessary to organize it into 3D Tiles format through a slicing scheme, ultimately achieving more efficient data storage, transmission and visualization of point cloud data. Traditional point cloud slicing requires a simple denoising preprocessing of the point cloud data before directly dividing it into spaces. However, this preprocessing does not effectively reduce the amount of data, and requires a large amount of storage space. There are problems such as low slicing efficiency and long time consumption. In addition, traditional point cloud slicing does not take into account the distribution characteristics of point cloud data. Therefore, for point cloud data with uneven data distribution, low loading efficiency may occur.

[0004] Application Contents

[0005] The present application provides a point cloud data lightweight method, system and medium, which can effectively reduce the data volume of point cloud data while effectively retaining the distribution characteristics of point cloud data, thereby improving the point cloud slicing effect.

[0006] In a first aspect, the present application provides a method for lightweighting point cloud data, comprising:

[0007] Parse the acquired point cloud file and extract the corresponding point cloud data;

[0008] Performing feature extraction on the point cloud data to obtain a first point cloud set, wherein the first point cloud set contains distribution features of the point cloud data;

[0009] Density partitioning is performed on the point cloud data to obtain a plurality of corresponding partitions, and down-sampling is performed on the point cloud data in the partitions to obtain a second point cloud set;

[0010] The first point cloud set and the second point cloud set are fused to obtain a target point cloud set.

[0011] The embodiment of the present application can accurately obtain corresponding point cloud data by parsing the acquired point cloud file, thereby facilitating subsequent processing of the point cloud data; can effectively retain the distribution characteristics of the point cloud data by performing feature extraction on the point cloud data; can effectively reduce the data volume of the point cloud data by density partitioning the point cloud data and downsampling the point cloud data of different partitions respectively; and can effectively reduce the data volume of the point cloud data while effectively retaining the distribution characteristics of the point cloud data by fusing the first point cloud set and the second point cloud set, thereby improving the point cloud slicing effect.

[0012] Furthermore, the feature extraction is performed on the point cloud data to obtain a first point cloud set, specifically:

[0013] Calculate the normal vector corresponding to each point in the point cloud data by a principal component analysis method, and calculate the angle between the normal vector of each point and the normal vector of the neighborhood point to obtain the normal vector angle, wherein the neighborhood point is a point cloud in a preset first neighborhood;

[0014] Calculating the point cloud distance between each point in the point cloud data and the neighborhood point;

[0015] Point cloud features are extracted based on the normal vector angle and the point cloud distance to obtain a first point cloud set.

[0016] In this way, by extracting features from point cloud data, the distribution characteristics of point cloud data can be effectively retained.

[0017] Furthermore, the normal vector corresponding to each point in the point cloud data is calculated by the principal component analysis method, specifically:

[0018] Calculating a first centroid corresponding to the first neighborhood in the point cloud data;

[0019] Based on the coordinate difference between the neighborhood point and the first centroid, construct a corresponding covariance matrix;

[0020] Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvalue vectors, and determine the normal vector corresponding to each point based on the eigenvalues ​​and the eigenvalue vectors.

[0021] In this way, the principal component analysis method can accurately find the optimal normal direction at each point, with high calculation efficiency, which is convenient for subsequent processing of point cloud data.

[0022] Furthermore, the calculation formula for extracting point cloud features based on the normal vector angle and the point cloud distance is specifically:

[0023]

[0024] In the formula, Ei is the weighted covariance matrix, k is the point P i The number of neighboring points, w ij To consider the comprehensive weight of the normal vector angle and the point cloud distance, P j is the neighborhood point, P i is any point in the point cloud data, and T is the transpose.

[0025] Furthermore, the point cloud data is density partitioned to obtain a number of corresponding partitions, specifically:

[0026] Calculating a local density in a second neighborhood preset in the point cloud data, and determining a first cluster center based on the local density;

[0027] Calculate a first distance between each point and the first cluster center, and assign each point to the first cluster center closest to the first distance;

[0028] The coordinate mean of each point in the first cluster center is continuously calculated, and the second cluster center is iteratively updated based on the coordinate mean until the second cluster center of the current iteration meets the preset conditions, and then the corresponding plurality of partitions are determined based on the second cluster center.

[0029] In this way, by density partitioning the point cloud data and down-sampling the point cloud data in different partitions respectively, the amount of point cloud data can be effectively reduced.

[0030] Furthermore, downsampling the point cloud data in the partition to obtain a second point cloud set is specifically:

[0031] Calculating an average distance of the point cloud data in the partition, and determining a voxel size in the partition based on the average distance;

[0032] Creating a corresponding voxel grid based on the voxel size, and assigning the point cloud in the partition to the voxel grid to obtain a plurality of voxel blocks;

[0033] The second centroid corresponding to each of the voxel blocks is calculated, and the point cloud corresponding to the second centroid is retained to obtain a second point cloud set.

[0034] In this way, the amount of point cloud data can be effectively reduced by downsampling the point cloud data of different partitions respectively.

[0035] Furthermore, after fusing the first point cloud set and the second point cloud set to obtain a target point cloud set, the method further includes:

[0036] The target point cloud set is spatially divided to construct a balanced octree, wherein the balanced octree includes a root node and a plurality of child nodes;

[0037] The point cloud precision corresponding to each node in the balanced octree is calculated, and the point cloud precision corresponding to each node is simplified according to a preset simplification ratio.

[0038] In this way, by constructing a balanced octree and simplifying the octree, it is convenient to quickly load and render the point cloud data later.

[0039] Furthermore, the target point cloud set is spatially divided to construct a balanced octree, specifically:

[0040] Calculating the boundary value of the target point cloud set, and constructing a first cube based on the boundary value, wherein the first cube is the root node of the balanced octree;

[0041] The first cube corresponding to the root node is divided to obtain a plurality of second cubes, and it is determined whether the corresponding point cloud density in the second cube meets a preset threshold; if the point cloud density does not meet the preset threshold, the second cube is divided until the point cloud density corresponding to the newly divided third cube meets the preset threshold, and the octree is constructed based on the first cube, the second cube and the third cube, wherein the second cube and the third cube are child nodes of the balanced octree.

[0042] In this way, the amount of data of each node in each layer of the balanced octree is ensured to be close. At the same time, since the level of the balanced octree will be smaller, it is convenient to quickly load and render the point cloud data later.

[0043] In a second aspect, the present application provides a point cloud data lightweight system, including: a parsing module, an extraction module, a downsampling module and a fusion module;

[0044] The parsing module is used to parse the acquired point cloud file and extract the corresponding point cloud data;

[0045] The extraction module is used to perform feature extraction on the point cloud data to obtain a first point cloud set, wherein the first point cloud set contains distribution features of the point cloud data;

[0046] The downsampling module is used to perform density partitioning on the point cloud data to obtain a plurality of corresponding partitions, and perform downsampling processing on the point cloud data in the partitions to obtain a second point cloud set;

[0047] The fusion module is used to fuse the first point cloud set and the second point cloud set to obtain a target point cloud set.

[0048] The embodiment of the present application can accurately obtain corresponding point cloud data by parsing the acquired point cloud file, thereby facilitating subsequent processing of the point cloud data; can effectively retain the distribution characteristics of the point cloud data by performing feature extraction on the point cloud data; can effectively reduce the data volume of the point cloud data by density partitioning the point cloud data and downsampling the point cloud data of different partitions respectively; and can effectively reduce the data volume of the point cloud data while effectively retaining the distribution characteristics of the point cloud data by fusing the first point cloud set and the second point cloud set, thereby improving the point cloud slicing effect.

[0049] In a third aspect, the present application also provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the point cloud data lightweight method described in the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a flowchart of an embodiment of the point cloud data lightweight method provided by the present application;

[0051] Figure 2 yes Figure 1 A schematic flow chart of step S102 in FIG.

[0052] Figure 3 It is a schematic diagram of downsampling point cloud data in a partition provided by the present application;

[0053] Figure 4 It is a flowchart of step S401 to step S402 provided by this application;

[0054] Figure 5 It is a structural schematic diagram of an embodiment of the point cloud data lightweight system provided in the present application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0056] It should be understood that the step numbers used in this article are only for the convenience of description and are not intended to limit the order in which the steps are executed.

[0057] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.

[0058] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0059] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.

[0060] Point cloud data consists of discrete three-dimensional points and is used for three-dimensional modeling, mapping, planning, autonomous driving, etc. However, there are still many difficulties in how to quickly process point cloud data. It is usually organized into a 3DTiles format through a slicing scheme to quickly process point cloud data. However, the traditional slicing method requires a simple denoising preprocessing of the point cloud data before directly dividing it into spaces. However, this preprocessing cannot effectively reduce the amount of data and requires a large amount of storage space. In addition, traditional point cloud slicing does not take into account the distribution characteristics of point cloud data, so there is a problem of low loading efficiency for uneven point cloud data.

[0061] Next, the nouns involved in this application are analyzed:

[0062] Point cloud slicing refers to cutting point cloud data through a set of parallel planes, and obtaining a set of intersection lines by intersecting this set of planes with the point cloud data. Its essence is to use a plane set with a certain pattern to perform intersection calculations with the three-dimensional point cloud data, and the obtained intersection lines are the slicing results.

[0063] The principal component analysis (PCA) method transforms a set of variable data that may be correlated into a set of linearly unrelated variables through orthogonal transformation. These transformed variables are called principal components. Mathematically, this is expressed as transforming the covariance matrix of the original random vector into a diagonal matrix, and geometrically, it is expressed as transforming the original coordinate system into a new orthogonal coordinate system, so that it points to the orthogonal direction with the largest sample point distribution.

[0064] The point cloud normal vector is a vector defined at each point in the point cloud data, which is used to indicate the direction and orientation of the surface where the point is located. The normal provides important information about the geometric structure of the point cloud and is very useful for point cloud processing and analysis. In three-dimensional space, the normal vector of a regular surface at a certain point is a vector perpendicular to the tangent plane at that point, and the point cloud is sampled as a point on the surface, and its normal vector is the normal vector of the sampled surface.

[0065] Voxel downsampling is a method of downsampling point clouds. It divides the point cloud into voxel blocks of equal size and then retains only one representative point in each voxel block, thereby reducing the overall data volume of the point cloud and achieving lightweight processing of the point cloud.

[0066] Clustering algorithms are the core technology in data mining and pattern recognition. They group objects in a data set so that objects in the same group have a high degree of similarity, while objects in different groups have a low degree of similarity. These algorithms can be widely used in image processing, market analysis, bioinformatics and other fields. Through clustering, people can understand the structure and characteristics of data, discover patterns and laws hidden in the data, and thus conduct more effective data analysis and decision-making.

[0067] Based on this, the embodiments of the present application provide a point cloud data lightweight method, system and medium, which can effectively reduce the data volume of point cloud data while effectively retaining the distribution characteristics of point cloud data, thereby improving the point cloud slicing effect.

[0068] A point cloud data lightweight method, system and medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the point cloud data lightweight method in the embodiments of the present application is described.

[0069] The point cloud data lightweight method provided in the embodiment of the present application relates to the field of power system communication. The point cloud data lightweight method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements a point cloud data lightweight method, etc., but is not limited to the above forms.

[0070] The present application can also be used in numerous general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0071] Embodiment 1

[0072] Please refer to Figure 1 , Figure 1 It is a flowchart of an embodiment of the point cloud data lightweight method provided by the present application, including steps S101 to S104;

[0073] Step S101, parsing the acquired point cloud file to extract corresponding point cloud data;

[0074] It is understandable that point cloud files can be obtained directly from the acquisition party but are not limited to them, wherein the formats of point cloud files include but are not limited to .pcd, .ply, .las, .pts, .asc, *.dat, .stl and other formats; after obtaining the point cloud file, it is necessary to select a suitable parsing tool or library according to the format corresponding to the point cloud file, wherein for point cloud files in .pcd format, the PCL (Point Cloud Library) library can be used for parsing, and for point cloud files in .ply format, Python's plyfile library or C++'s PLY library can be used for parsing, and for point cloud files in .las format, the LASzip library can be used for parsing but is not limited to it; when a suitable parsing tool or library is determined, the point cloud data and its attributes can be extracted from the point cloud file by writing parsing code, wherein the attributes include but are not limited to color or intensity.

[0075] It should be noted that after the corresponding point cloud data is extracted, it needs to be denoised to delete some points in the point cloud data that are obviously not in the valid area. This can be done, but is not limited to, by calculating the average value and standard deviation of points within a certain radius around each point in the point cloud data. If the distance from the point to the average value is greater than a certain multiple of the standard deviation, the point is determined to be a noise point and removed.

[0076] Step S102: extracting features from the point cloud data to obtain a first point cloud set, wherein the first point cloud set contains distribution features of the point cloud data;

[0077] It is understandable that after extracting the point cloud data, it is necessary to analyze the basic structural relationship and shape features in the point cloud data to achieve feature extraction of each area.

[0078] See also Figure 2 In some embodiments, step S102 may include, but is not limited to, steps S201 to S203:

[0079] Step S201, calculating the normal vector corresponding to each point in the point cloud data by a principal component analysis method, and calculating the angle between the normal vector of each point and the normal vector of a neighborhood point to obtain the normal vector angle, wherein the neighborhood point is a point cloud in a preset first neighborhood;

[0080] It is understandable that before calculating the normal vector corresponding to each point, it is necessary to pre-set the point P i The spherical first neighborhood with a center and a radius of r can then be calculated by the principal component analysis method for each point P in the point cloud data. i Specifically, first, the first centroid corresponding to the first neighborhood in the point cloud data is calculated, wherein the first centroid is the average value of each coordinate in the first neighborhood, and the calculation formula for calculating the first centroid is: In the formula, is the first centroid, k is the number of points in the first neighborhood, and p j It's point P i Secondly, based on the neighborhood point p j With the first centroid The coordinate difference of , constructs the corresponding covariance matrix C, where the expression of the covariance matrix C is: Where C is the covariance matrix, k is the number of points in the first neighborhood, and p j It's point P i The jth neighboring point of is the first centroid, and T is the transpose. Finally, the covariance matrix is ​​subjected to eigenvalue decomposition to obtain eigenvalues ​​and eigenvalue vectors, and the normal vector n corresponding to each point is determined based on the eigenvalues ​​and the eigenvalue vectors. i , by way of example and not limitation, after decomposition, the eigenvalues ​​λ1, λ2, λ3 and the corresponding eigenvalue vectors e1, e2, e3 are obtained, and then the eigenvalues ​​λ1, λ2, λ3 are sorted to determine the smallest eigenvalue. If the smallest eigenvalue is λ3, then its corresponding eigenvector e3 is determined as point P iThe normal vector n i .

[0081] In this way, the principal component analysis method can accurately find the optimal normal direction at each point, with high calculation efficiency, which is convenient for subsequent processing of point cloud data.

[0082] Since the normal vector n of a single point i , can only represent the point cloud information of a single point, and cannot obtain more point cloud information, so it is necessary to use the spatial relationship between the point cloud and its neighborhood to strengthen the feature description of the point cloud, so it is necessary to calculate the normal vector angle θ ij Specifically, when determining each point P i The corresponding normal vector n i Afterwards, the neighborhood point p is calculated in a similar way. j The corresponding normal vector n j , and calculate the normal vector n of each point i and the normal vector n of the neighboring point j The angle θ between ij , where the angle calculation formula is: In the formula, θ ij is the normal vector angle, n i is the normal vector of each point, n j is the normal vector of the neighborhood point; in order to facilitate the subsequent calculation of the covariance matrix, the normal vector angle θ ij Transformed into a normal difference weight, where the normal difference weight w norm (θ ij ) is calculated as: In the formula, w norm (θ ij ) is the normal difference weight, θ ij is the normal vector angle, and σ is a parameter that controls the decay speed of the normal difference weight.

[0083] Step S202, calculating the point cloud distance between each point in the point cloud data and the neighborhood point;

[0084] It is understood that the calculation point P can be but is not limited to i With the neighborhood point p j The Euclidean distance between them is used. Since closer points are more conducive to the subsequent feature extraction, the square of the reciprocal of the Euclidean distance is used as the point cloud distance. The calculation formula of the point cloud distance is: Where, d ij For point P i With neighboring point p j The point cloud distance, ∈ is a small positive number that can control the decay speed of the weight as the distance increases, w dist (d ij) is the point cloud distance weight.

[0085] Step S203: extracting point cloud features based on the normal vector angle and the point cloud distance to obtain a first point cloud set.

[0086] After obtaining the normal vector angle θ ij The distance d from the point cloud ij , and the corresponding normal difference weight w norm (θ ij ) and point cloud distance weight w dist (d ij ) After that, the weighted covariance matrix E can be calculated i , and the weighted covariance matrix E i By performing eigenvalue decomposition, the distribution eigenvalues ​​corresponding to the point cloud data can be decomposed. After the distribution eigenvalues ​​corresponding to all the point cloud data are extracted, the first point cloud set is obtained.

[0087] Among them, the weighted covariance matrix E i The calculation formula is:

[0088]

[0089] In the formula, E i is the weighted covariance matrix; k is the point P i The number of neighboring points of w ij To consider the comprehensive weight of the normal vector angle and the point cloud distance, w ij =w dist (d ij )·w norm (θ ij );P j is the neighborhood point; i is any point in the point cloud data; T is the transpose.

[0090] In this way, by extracting features from point cloud data, the distribution characteristics of point cloud data can be effectively retained.

[0091] Step S103, performing density partitioning on the point cloud data to obtain a plurality of corresponding partitions, and performing downsampling processing on the point cloud data in the partitions to obtain a second point cloud set;

[0092] Before performing density partitioning on point cloud data, let’s first explain the traditional voxel downsampling method. Assume that there are n points in the point cloud data, among which point P i The coordinates of (x i ,y i ,z i), the traditional method divides the point cloud data into cubic voxel blocks of equal size, each voxel block has a side length of l, and calculates the center coordinates (x c ,y c ,z c ): In the formula, represents the rounding down operation, and l is the side length of the voxel block. Then, for each voxel block, only one representative point is retained, and all the retained representative points are combined into a new point cloud set, which is the result of downsampling. This method divides all point cloud data into voxel blocks of equal size, and cannot make targeted adjustments to point clouds of different numbers and densities, which may cause the loss of key information of the point cloud.

[0093] In order to prevent the loss of key information in the point cloud data, this application needs to perform density partitioning on the point cloud data and perform downsampling on each partition. Specifically, first, calculate the local density in the second neighborhood pre-set in the point cloud data, and determine the first cluster center based on the local density, wherein it is necessary to pre-set the point P i As the center, according to the set neighborhood radius threshold d c Search the nearest point to obtain the second neighborhood N; then calculate the local density within the second neighborhood In the formula, ρ i is the local density, d ij For point P i and the neighboring point P j The Euclidean distance between c is the neighborhood radius threshold set; and according to the calculated local density ρ i , select m points with large density and far distance as the first cluster center, denoted as R1, R2, ..., R m, It should be noted that the first neighborhood and the second neighborhood can be the same or different, and this application does not limit this. Secondly, the first distance between each point and the first cluster center is calculated, and each point is assigned to the first cluster center closest to the first distance to initially divide the point cloud data. Finally, the coordinate mean of each point in the first cluster center is continuously calculated, and the second cluster center is iteratively updated based on the coordinate mean until the second cluster center of the current iteration meets the preset conditions, then the corresponding number of partitions is determined based on the second cluster center, where the coordinate mean The calculation formula is Where n is the number of point clouds in the first cluster center. The coordinate mean is calculated repeatedly and used as the second cluster center until the distance between the second cluster center and the first cluster center is less than or equal to the preset distance threshold. This indicates that the cluster center no longer changes significantly, so the iteration can be stopped. The final number of cluster centers is the number of partitions.

[0094] After the point cloud data is density partitioned, it is necessary to perform downsampling processing on the point cloud data in the partition. The schematic diagram of downsampling processing on the point cloud data in the partition is as follows: Figure 3 Specifically, first, the average distance of the point cloud data in the partition is calculated, and the voxel size in the partition is determined based on the average distance, wherein N points are randomly sampled from the partition point cloud data, and the average distance of each point to its nearest k neighbors can be calculated by, but not limited to, the k-nearest neighbor method, and then the average value is averaged again to obtain the average distance estimate d of all point clouds in the partition mean , and determine the voxel size V in the partition based on the average distance j , where the voxel size V j The calculation formula is V j =α·d mean , where Vj is the voxel size of the jth partition and α is a scaling factor. Next, a corresponding voxel grid is created based on the voxel size and the partition N j The point cloud in is distributed to the voxel grid to obtain a plurality of voxel blocks; finally, the second centroid corresponding to each of the voxel blocks is calculated, and the point cloud corresponding to the second centroid is retained to obtain a second point cloud set.

[0095] It should be noted that the scaling factor α can adjust the voxel size to match specific needs or preferences, and can be adjusted according to actual conditions. For example, if you want the point cloud after voxel filtering to be sparser, you can increase α. Conversely, if you want to retain more details, you can reduce α.

[0096] It should be noted that the calculation of the center of mass can be achieved through existing technologies and is not the focus of this application, so it will not be expanded here.

[0097] Step S104: Fusing the first point cloud set and the second point cloud set to obtain a target point cloud set.

[0098] It is understandable that after obtaining the first point cloud set and the second point cloud set respectively, the two point cloud sets need to be fused to obtain the target point cloud set. It should be noted that the fusion method may include but is not limited to simple fusion and weighted average fusion, etc., and this application does not limit this.

[0099] See also Figure 4 In some embodiments, after obtaining the target point cloud set in step S104, including but not limited to steps S401 to S402, the target point cloud set needs to be divided to facilitate subsequent rendering.

[0100] Step S401, spatially divide the target point cloud set to construct a balanced octree, wherein the balanced octree includes a root node and a plurality of child nodes, wherein each node of each layer in the balanced octree corresponds to a tile file; first, calculate the boundary value of the target point cloud set, and construct a first cube based on the boundary value, wherein the first cube is the root node of the balanced octree, and the boundary value is the maximum value and the minimum value of the point cloud data on the XYZ axis; then, divide the first cube corresponding to the root node in three directions of the XYZ axis to obtain a plurality of second cubes, wherein the number of point clouds in the second cubes is close; and calculate the point cloud density ρ in the second cube i , point cloud density ρ i The calculation formula is Among them, m i is the total number of point clouds in node i, B i is the volume of the minimum bounding box of node i; and determines whether the corresponding point cloud density in the second cube meets the preset threshold. If the point cloud density does not meet the preset threshold, the second cube is divided until the point cloud density corresponding to the newly divided third cube meets the preset threshold. Then, the octree is constructed based on the first cube, the second cube and the third cube, wherein the second cube and the third cube are child nodes of the balanced octree.

[0101] It should be noted that the volume of the minimum bounding box B i The determination method is to traverse the point cloud in each node and find the maximum value X on the X, Y, and Z axes. max , Y max , Z max and minimum value X min , Y min , Y min , the diagonal point (X max , Y max , Z max ), (X min , Y min , Y min ) defines the minimum bounding box, whose volume is |X max -X min ||Y max -Y min ||Z max -Z min |.

[0102] It should be noted that the traditional octree divides the spatial range into two equal parts on each axis on xyz, thus dividing a whole into 8 partitions. The spatial size of each partition is the same, but the amount of data in the partition may vary greatly. The present application divides according to the amount of data, which can ensure that the amount of data of each node in each layer is close, so that when the front-end HTML5 page loads and renders the data later, the corresponding node can be found faster, thereby improving the rendering speed.

[0103] Step S402: Calculate the point cloud accuracy corresponding to each node in the balanced octree, and simplify the point cloud accuracy corresponding to each node according to a preset simplification ratio.

[0104] It can be understood that the accuracy of the point cloud uses the average distance d between the point clouds. mean It means that the point cloud in the node can be converted into PCL format and the average distance d between the point clouds can be calculated using the kd tree algorithm in the PCL library. mean , calculate the average distance d through the KD tree algorithm mean The specific steps are as follows: (1) For each point in the point cloud, use the nearest neighbor search function of the kd tree to find the nearest neighbor point; (2) Calculate the distance between each point and its nearest neighbor point, accumulate these distances, and divide them by the total number of points in the point cloud to obtain the average distance d mean .

[0105] It is understandable that a simplification ratio of the number of points can be set for each level to reduce the number of point clouds. One way to calculate the simplification ratio is: first, if the density of each layer of point cloud is raised to the cube, the number of points contained in each unit meter is calculated as C1; secondly, according to the resolution of the corresponding level of C*Web Mercator projection, the number of points corresponding to one pixel is obtained C2; then, the simplification rate is obtained based on the visible factor, simplification rate = visible factor / C2)*100%, where the visible coefficient represents the expected value of the number of points displayed in one pixel. For example, when the number of points C1 is 1000 points / meter, the number of points C2 is 10 points / pixel, and the visible coefficient is 2 [2 means that it is hoped that the screen will display a maximum of 2 points per pixel], then the simplification ratio = (10 / 1000)*100% = 1%, so the point cloud data at this level is sampled to 1% of the original data.

[0106] It should be noted that the resolution of the corresponding levels of the Web Mercator projection is calculated as follows: 20037508.3427892*2 / 256 / 1 for level 0, 20037508.3427892*2 / 256 / 2 for level 1, and 20037508.3427892*2 / 256 / 2 for level n.

[0107] It should be noted that after simplifying the point cloud accuracy corresponding to each node, it includes: (1) saving the point cloud data in each node in the number-balanced octree as a pnts file; (2) calculating the geometric error corresponding to each level in each balanced octree to determine when a more detailed tile file should be used to replace the current tile file; (3) generating an index file and metadata file for each tile to quickly locate and access tile data during subsequent loading and rendering. Specifically, the index information is saved as a json file, and its index structure is the number-balanced octree, and the index structure is saved as a tileset file. (4) Finally, after replacing the current tile file with the obtained tile file, the converted 3D Tiles data can be tested and verified using a three-dimensional visualization platform (such as Cesium) to ensure that the data can be correctly loaded and rendered. These steps are all common steps for generating 3D Tiles files, which are not the focus of this application, so they will not be expanded here.

[0108] The embodiment of the present application can accurately obtain corresponding point cloud data by parsing the acquired point cloud file, thereby facilitating subsequent processing of the point cloud data; can effectively retain the distribution characteristics of the point cloud data by performing feature extraction on the point cloud data; can effectively reduce the data volume of the point cloud data by density partitioning the point cloud data and downsampling the point cloud data of different partitions respectively; and can effectively reduce the data volume of the point cloud data while effectively retaining the distribution characteristics of the point cloud data by fusing the first point cloud set and the second point cloud set, thereby improving the point cloud slicing effect.

[0109] Embodiment 2

[0110] Please refer to Figure 5 , Figure 5 1 is a schematic diagram of the structure of an embodiment of a point cloud data lightweight system provided in the present application, including a parsing module 100, an extraction module 200, a downsampling module 300 and a fusion module 400;

[0111] The parsing module 100 is used to parse the acquired point cloud file and extract the corresponding point cloud data;

[0112] The extraction module 200 is used to extract features from the point cloud data to obtain a first point cloud set;

[0113] The downsampling module 300 is used to perform density partitioning on the point cloud data to obtain a plurality of corresponding partitions, and perform downsampling processing on the point cloud data in the partitions to obtain a second point cloud set;

[0114] The fusion module 400 is used to fuse the first point cloud set and the second point cloud set to obtain a target point cloud set.

[0115] Since the information interaction, execution process and other contents between the modules within the above-mentioned point cloud data lightweight method system are based on the same concept as the embodiment of the point cloud data lightweight method of the first aspect of the present invention, the technical effects achieved are basically the same. For specific contents, please refer to the description in the first embodiment of the method of the present invention, and will not be repeated here.

[0116] The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, i.e., may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the method of this embodiment.

[0117] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the point cloud data lightweight method as described in the above-mentioned embodiment 1 is implemented.

[0118] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-monitorable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0119] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application.

[0120] It is particularly pointed out that for those skilled in the art, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A method for lightweighting point cloud data, characterized in that: include: Parse the acquired point cloud file and extract the corresponding point cloud data; Performing feature extraction on the point cloud data to obtain a first point cloud set, wherein the first point cloud set contains distribution features of the point cloud data; Density partitioning is performed on the point cloud data to obtain a plurality of corresponding partitions, and down-sampling is performed on the point cloud data in the partitions to obtain a second point cloud set; The first point cloud set and the second point cloud set are fused to obtain a target point cloud set.

2. The point cloud data lightweight method according to claim 1, characterized in that: The feature extraction of the point cloud data to obtain a first point cloud set is specifically: Calculate the normal vector corresponding to each point in the point cloud data by a principal component analysis method, and calculate the angle between the normal vector of each point and the normal vector of the neighborhood point to obtain the normal vector angle, wherein the neighborhood point is a point cloud in a preset first neighborhood; Calculating the point cloud distance between each point in the point cloud data and the neighborhood point; Point cloud features are extracted based on the normal vector angle and the point cloud distance to obtain a first point cloud set.

3. The point cloud data lightweight method according to claim 2, characterized in that: The normal vector corresponding to each point in the point cloud data is calculated by the principal component analysis method, specifically: Calculating a first centroid corresponding to the first neighborhood in the point cloud data; Based on the coordinate difference between the neighborhood point and the first centroid, construct a corresponding covariance matrix; Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvalue vectors, and determine the normal vector corresponding to each point based on the eigenvalues ​​and the eigenvalue vectors.

4. The point cloud data lightweight method according to claim 2, characterized in that: The calculation formula for extracting point cloud features based on the normal vector angle and the point cloud distance is specifically: In the formula, E i is the weighted covariance matrix, k is the point P i The number of neighboring points, w ij To consider the comprehensive weight of the normal vector angle and the point cloud distance, P j is the neighborhood point, P i is any point in the point cloud data, and T is the transpose.

5. The point cloud data lightweight method according to claim 1, characterized in that: The point cloud data is subjected to density partitioning to obtain a number of corresponding partitions, specifically: Calculating a local density in a second neighborhood preset in the point cloud data, and determining a first cluster center based on the local density; Calculate a first distance between each point and the first cluster center, and assign each point to the first cluster center closest to the first distance; The coordinate mean of each point in the first cluster center is continuously calculated, and the second cluster center is iteratively updated based on the coordinate mean until the second cluster center of the current iteration meets the preset conditions, and then the corresponding plurality of partitions are determined based on the second cluster center.

6. The point cloud data lightweight method according to claim 1, characterized in that: The downsampling process is performed on the point cloud data in the partition to obtain a second point cloud set, specifically: Calculating an average distance of the point cloud data in the partition, and determining a voxel size in the partition based on the average distance; Creating a corresponding voxel grid based on the voxel size, and assigning the point cloud in the partition to the voxel grid to obtain a plurality of voxel blocks; The second centroid corresponding to each of the voxel blocks is calculated, and the point cloud corresponding to the second centroid is retained to obtain a second point cloud set.

7. The point cloud data lightweight method according to claim 1, characterized in that: After fusing the first point cloud set and the second point cloud set to obtain a target point cloud set, the method further includes: The target point cloud set is spatially divided to construct a balanced octree, wherein the balanced octree includes a root node and a plurality of child nodes; The point cloud precision corresponding to each node in the balanced octree is calculated, and the point cloud precision corresponding to each node is simplified according to a preset simplification ratio.

8. The point cloud data lightweight method according to claim 7, characterized in that: The target point cloud set is spatially divided to construct a balanced octree, specifically: Calculating the boundary value of the target point cloud set, and constructing a first cube based on the boundary value, wherein the first cube is the root node of the balanced octree; The first cube corresponding to the root node is divided to obtain a plurality of second cubes, and it is determined whether the corresponding point cloud density in the second cube meets a preset threshold; if the point cloud density does not meet the preset threshold, the second cube is divided until the point cloud density corresponding to the newly divided third cube meets the preset threshold, and the octree is constructed based on the first cube, the second cube and the third cube, wherein the second cube and the third cube are child nodes of the balanced octree.

9. A point cloud data lightweight system, characterized in that: include: Parsing module, extraction module, downsampling module and fusion module; The parsing module is used to parse the acquired point cloud file and extract the corresponding point cloud data; The extraction module is used to extract features from the point cloud data to obtain a first point cloud set; The downsampling module is used to perform density partitioning on the point cloud data to obtain a plurality of corresponding partitions, and perform downsampling processing on the point cloud data in the partitions to obtain a second point cloud set; The fusion module is used to fuse the first point cloud set and the second point cloud set to obtain a target point cloud set.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the point cloud data lightweight method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Method and system for modeling luggage and accessories thereof based on three-dimensional point cloud

    CN120107515A

  • Modeling Method and System for Luggage and Its Accessories Based on 3D Point Cloud

    CN120107515B