Point cloud data simplification method and device, computer device, readable storage medium and program product
By constructing a spatial search structure for surface structured light point cloud data, marking and calculating the planar error of point cloud pairs, and updating vertex positions, the problem of high computational resource consumption in high-density point cloud data processing is solved, achieving a balance between high efficiency and feature preservation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN POWER3D TECH
- Filing Date
- 2026-01-08
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies struggle to efficiently simplify high-density point cloud data generated by structured light 3D scanners while preserving model accuracy and key geometric features, resulting in high computational resource consumption and long processing times.
By constructing a spatial search structure for structured light point cloud data, marking the nearest neighbor points of each point cloud, calculating the planar error between point cloud pairs, determining the target point cloud pairs that need to be simplified, updating the vertex positions, and replacing the target point cloud pairs to obtain simplified point cloud data.
It achieves a precise balance between feature preservation and simplification efficiency while effectively preserving the geometric features of point clouds, reducing data volume and improving processing efficiency.
Smart Images

Figure CN122156449A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of point cloud data processing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for simplifying point cloud data. Background Technology
[0002] With the rapid development of 3D measurement technology, surface structured light 3D scanning technology has been widely used in industrial inspection, reverse engineering, cultural relic digitization, virtual reality and other fields due to its advantages such as high precision, high speed and non-contact operation.
[0003] Structured light 3D scanning technology projects an coded grating pattern onto the surface of an object, and a camera captures the distorted pattern caused by surface deformation. Then, phase deconstruction and 3D reconstruction algorithms are used to calculate the coordinates of dense 3D points on the object's surface, i.e., point cloud data. Structured light scanners can acquire hundreds of thousands or even millions of data points at once, generating extremely dense point cloud data that can precisely describe the geometric features of an object's surface. However, while this high-density point cloud provides high-precision detail, it also brings enormous pressure on data storage, transmission, and processing. Directly performing subsequent processing such as surface reconstruction, feature recognition, and registration on massive point cloud data significantly increases computational resource consumption and processing time, reducing overall efficiency.
[0004] Therefore, there is an urgent need for a solution that can simplify surface structured light point cloud data while ensuring model accuracy and key geometric features. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product that can efficiently simplify point cloud data and effectively preserve the geometric features of point cloud data in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a method for simplifying point cloud data, the method comprising:
[0007] A spatial search structure for surface structured light point cloud data is constructed, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud;
[0008] Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair;
[0009] Based on the aforementioned planar error, determine the target point cloud pairs that need to be simplified;
[0010] The vertex positions of the target point cloud pair are updated to obtain new vertices;
[0011] The new vertices replace the target point cloud pair to obtain simplified surface structured light point cloud data.
[0012] In one embodiment, determining the planar error between each point cloud and its corresponding nearest neighbor point includes:
[0013] Construct a set of point cloud pairs based on each point cloud and its nearest neighbor.
[0014] Traverse each point cloud pair in the set of point cloud pairs, and take the two point clouds in the point cloud pair as the center points to perform a radius search and / or nearest neighbor search at a preset resolution to obtain M neighbor points, where M is a natural number greater than a preset value.
[0015] Starting from any of the M neighboring points, calculate the angles between one neighboring point and the center point, and between the center point and another neighboring point.
[0016] The M neighboring points are sorted according to the angle between them to obtain neighboring points with an ordered relationship.
[0017] Based on the neighbor points with the given sequential relationship, determine the plane error of multiple planes formed by all adjacent neighbor points and the center point;
[0018] The overall error of the point cloud pair is determined based on the planar errors of all planes of the point cloud pair.
[0019] In one embodiment, determining the target point cloud pair to be simplified based on the planar error includes:
[0020] The overall error of the point cloud pair is compared with a preset error threshold range;
[0021] If the overall error of the point cloud pair falls within the preset error threshold range, the point cloud pair is determined as the target point cloud pair. The preset error threshold range is determined based on a dynamic error threshold, which is a variable calculated in real time according to the algorithm state during the point cloud simplification iteration process. The dynamic error threshold is related to the basic error value, the number of iterations, the baseline number of iterations, and the aggressiveness.
[0022] In one embodiment, updating the vertex positions of the target point cloud pair to obtain new vertices includes any of the following methods:
[0023] Use one of the point clouds in the point cloud pair as the new vertex;
[0024] Calculate the midpoint of the point cloud pair and use the midpoint as the new vertex;
[0025] Calculate the minimum value of the fixed-point error of the point cloud pair, and use the minimum value of the fixed-point error as the new vertex;
[0026] Multiple vertices of the point cloud pair are determined using various methods, and the point with the smallest error is selected as the new vertex from among the multiple vertices.
[0027] In one embodiment, before constructing the spatial search structure for the surface structured light point cloud data, the method further includes:
[0028] The coded grating pattern is projected onto the surface of the object to be tested, and the pattern on the surface of the object to be tested is obtained. The pattern on the surface of the object to be tested contains the deformation information of the surface of the object to be tested.
[0029] Based on the pattern on the surface of the object under test, the original point cloud data of the surface of the object under test is determined by phase deconvolution and three-dimensional reconstruction algorithms.
[0030] After inspecting the original point cloud data and removing erroneous point cloud data, surface structured light point cloud data is obtained.
[0031] In one embodiment, after replacing the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data, the method further includes:
[0032] The simplified surface structured light point cloud data is optimized by mean filtering and / or bilateral filtering to obtain optimized surface structured light point cloud data.
[0033] Secondly, this application also provides a point cloud data simplification device, the device comprising:
[0034] A construction module is used to construct a spatial search structure for surface structured light point cloud data, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud.
[0035] The first determining module is used to determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair;
[0036] The second determining module is used to determine the target point cloud pairs that need to be simplified based on the plane error;
[0037] The update module is used to update the vertex positions of the target point cloud pair to obtain new vertices;
[0038] The replacement module is used to replace the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data.
[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0040] A spatial search structure for surface structured light point cloud data is constructed, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud;
[0041] Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair;
[0042] Based on the aforementioned planar error, determine the target point cloud pairs that need to be simplified;
[0043] The vertex positions of the target point cloud pair are updated to obtain new vertices;
[0044] The new vertices replace the target point cloud pair to obtain simplified surface structured light point cloud data.
[0045] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0046] A spatial search structure for surface structured light point cloud data is constructed, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud;
[0047] Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair;
[0048] Based on the aforementioned planar error, determine the target point cloud pairs that need to be simplified;
[0049] The vertex positions of the target point cloud pair are updated to obtain new vertices;
[0050] The new vertices replace the target point cloud pair to obtain simplified surface structured light point cloud data.
[0051] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0052] A spatial search structure for surface structured light point cloud data is constructed, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud;
[0053] Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair;
[0054] Based on the aforementioned planar error, determine the target point cloud pairs that need to be simplified;
[0055] The vertex positions of the target point cloud pair are updated to obtain new vertices;
[0056] The new vertices replace the target point cloud pair to obtain simplified surface structured light point cloud data.
[0057] The aforementioned point cloud data simplification method, apparatus, computer equipment, computer-readable storage medium, and computer program product construct a spatial search structure for the surface structured light point cloud data. This spatial search structure is used to mark the nearest neighbor points of each point cloud, thereby facilitating the search for nearest neighbor points and improving search efficiency. The planar error between each point cloud and its corresponding nearest neighbor point is determined, where each point cloud and its corresponding nearest neighbor point constitute a point cloud pair. This allows for the correction of nearest neighbor points by quantifying the planar error of each point cloud pair, achieving efficient point cloud simplification while preserving as many effective geometric features as possible. Based on the planar error, a target point cloud pair requiring simplification is determined. The vertex positions of the target point cloud pair are updated to obtain new vertices. This allows for targeted point cloud simplification processing based on the planar error, reducing the data volume of the surface structured light point cloud data. The new vertices replace the target point cloud pair, resulting in simplified surface structured light point cloud data. This allows for the precise quantification of the geometric complexity of local regions by calculating the planar error of point cloud pairs and their neighborhoods. This enables the point cloud pairs in flat areas to be simplified first, while point cloud pairs in feature regions such as edges and corners to be preserved, ultimately achieving a precise balance between feature preservation and simplification efficiency. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a flowchart illustrating a method for simplifying point cloud data in one embodiment;
[0060] Figure 2 This is a schematic diagram of the point cloud neighborhood in one embodiment;
[0061] Figure 3 This is a flowchart illustrating a point cloud data simplification method in another embodiment;
[0062] Figure 4This is a flowchart illustrating a point cloud data simplification method in yet another embodiment.
[0063] Figure 5 This is a structural block diagram of a point cloud data simplification device in one embodiment;
[0064] Figure 6 This is a structural block diagram of a point cloud data simplification device in another embodiment;
[0065] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0067] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0068] To facilitate understanding of the technical solutions in the various embodiments of this application, a brief explanation of the technical terms that may appear in the various embodiments of this application will be given first.
[0069] A point cloud is a massive collection of points that represent the spatial distribution and surface characteristics of a target within the same spatial reference frame. It is typically generated by LiDAR, photogrammetry, or 3D scanning equipment.
[0070] Mean filtering is a commonly used smoothing technique that reduces noise by replacing the value of each point with the average value of its neighboring points. While Open3D doesn't provide a direct function for mean filtering, a similar effect can be achieved through some basic operations. The basic principle of mean filtering is to calculate the average value of these neighboring points and replace the current point's value with that average. This method effectively removes isolated noise points while preserving the overall structure of the point cloud.
[0071] The bilateral filtering algorithm corrects the position of the current sampling point by taking neighboring sampling points and using a weighted average, thus achieving a filtering effect. It also selectively removes neighboring sampling points that differ too much from the current sampling point, thereby preserving the original features. However, the computation time is long, and both parameters require multiple trials and adjustments.
[0072] In related technologies, downsampling is generally used for point cloud data generated from hundreds of thousands or even millions of data points acquired by a structured light scanner. For example, voxel mesh downsampling divides the 3D space containing the point cloud into a series of uniform tiny cubes (voxels). Then, a representative point (usually the centroid or center point) is calculated for all points within each voxel to replace all points within that voxel. Uniform downsampling retains a point at regular intervals in 3D space. Nearest neighbor points can be quickly found and overly close points can be deleted by constructing a spatial index structure (such as a KD-Tree). Random downsampling randomly discards points in the point cloud with a certain probability.
[0073] It should be understood that relevant downsampling methods (such as uniform grid methods and random sampling methods) do not fully consider the geometric feature information carried by the point cloud when simplifying data, resulting in "bluntization" of feature edges. Specifically, in areas with drastic curvature changes, such as critical boundaries, edges, and hole edges of the model, the point cloud density is excessively reduced, causing the geometric information of these features to be lost or become blurred. This distortion directly leads to a decrease in the accuracy of subsequent 3D model reconstruction and unreliable results for point cloud-based dimensional measurements and geometric tolerance detection, failing to meet the needs of high-precision applications such as industrial inspection and precision reverse engineering.
[0074] It should be understood that when using the aforementioned methods to process massive point clouds with surface scanning, it is difficult to achieve a good balance between data processing efficiency and feature preservation quality. Uniform downsampling is fast but loses features; high-precision curvature calculation can preserve features, but it is computationally intensive and time-consuming.
[0075] To address the problems existing in related technologies, this application aims to provide a method for simplifying point cloud data. This method involves constructing a spatial search structure for the structured light point cloud data, which is used to mark the nearest neighbor points of each point cloud; determining the planar error between each point cloud and its corresponding nearest neighbor point, where each point cloud and its corresponding nearest neighbor point constitute a point cloud pair; determining the target point cloud pair to be simplified based on the planar error; updating the vertex positions of the target point cloud pair to obtain new vertices; and replacing the target point cloud pair with the new vertices to obtain the simplified structured light point cloud data. This method effectively preserves the geometric features of the point cloud while efficiently reducing its data volume, achieving a balance between efficiency and accuracy.
[0076] In one exemplary embodiment, such as Figure 1 As shown, a method for simplifying point cloud data is provided. The method in this embodiment may include the following steps S101 to S105. Wherein:
[0077] Step S101: Construct a spatial search structure for the surface structured light point cloud data. The spatial search structure is used to mark the nearest neighbor points of each point cloud.
[0078] In this embodiment, the spatial search structure may include structures such as R-trees, quadtrees, octrees, network indexes, and KD-trees. For example, representing the structured light point cloud data using a KD-tree facilitates rapid searching and labeling of the nearest neighbor points for each point cloud.
[0079] Step S102: Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair.
[0080] In this embodiment, plane error refers to the degree of deviation of the actual surface from the ideal plane. It is usually accurately evaluated by the minimum containment area method (such as the triangle criterion or the intersection criterion), or by approximate methods such as the diagonal method or the three-point method.
[0081] In this embodiment, planar error is calculated for all point cloud pairs. Point cloud pairs with smaller errors are simplified, while point cloud pairs with larger (excessive) errors are retained.
[0082] Optionally, a set of point cloud pairs is constructed based on each point cloud and its corresponding nearest neighbor point; each point cloud pair in the set is traversed, and a radius search and / or nearest neighbor search with a preset resolution is performed using the two point clouds in the pair as center points to obtain M neighbor points, where M is a natural number greater than a preset value; taking any one of the M neighbor points as a starting point, the angles between one neighbor point and the center point and between the center point and another neighbor point are calculated sequentially; the M neighbor points are sorted according to the angles to obtain neighbor points with an ordered relationship; based on the neighbor points with an ordered relationship, the plane errors of all planes formed by two adjacent neighbor points and the center point are determined; and the overall error of the point cloud pair is determined based on the plane errors of all planes of the point cloud pair.
[0083] For example, Figure 2 This is a schematic diagram of the point cloud neighborhood in one embodiment, such as... Figure 2As shown, Pi and Pj are a pair of point clouds. We need to calculate the planar error of this pair. First, using Pi and Pj as center points and a radius of 1.5 times the point cloud resolution, we perform a radius search. If the radius search yields fewer than 3 points, we then use a nearest neighbor search to find 3 points, ensuring that each point has at least 3 neighbors. Using any neighbor point as a starting point, we calculate the angle between the starting point and Pi, and another neighbor point. Assuming the starting point is q0, and there are m neighbor points, we calculate the angles of q0Piq1, q0Piq2, q0Piq3...q0Piqm sequentially, arranged in ascending order, thus obtaining the neighbor points with a sequential relationship. Each pair of adjacent neighbors and Pi constitutes a plane. The plane equation of the point cloud (x, y, z) is as follows:
[0084] ax+by+cz+d=0
[0085] In the formula: a, b, c, and d are the four coefficients of the plane equation, which satisfy a 2 +b 2 +c 2 +d 2 =1.
[0086] The error cost of point cloud is:
[0087]
[0088] in, , For the set of all neighboring points, Let v be the error cost of the current vertex Pi point cloud pair, and v be its second coordinate vector. v T Let v be the transpose of v, and q(v) be the set of all planes associated with vertex v.
[0089] The quadratic error measure matrix of vertex Pi is as follows:
[0090]
[0091] Similarly, the quadratic error measure matrix of Pj can be calculated, and then the overall error of the point cloud pair can be calculated. The formula for calculating the overall error is as follows:
[0092]
[0093] In the formula, Δv n For the overall error, v n Let Q be the homogeneous coordinate vector of the new vertex (after merging). i Let Q be the quadratic error measure matrix of vertex pi. j Let v be the quadratic error measure matrix of vertex pj. nT For the new vertex v n The transpose of .
[0094] In this embodiment, a triangular plane is constructed by “sorting neighboring points by included angle”. This method can better describe the local surface structure, making the error calculation more reflective of the real geometric features and avoiding the erroneous merging of points on different surfaces.
[0095] Step S103: Determine the target point cloud pairs that need to be simplified based on the plane error.
[0096] In simple terms, data simplification is the process of combining two point clouds into one, thereby reducing the number of point clouds. To retain more geometric features, the nearest neighbor points of each point cloud are typically searched, and then the two point clouds are combined into one. Therefore, it is necessary to know the nearest neighbor points of each point cloud.
[0097] For example, a nearest neighbor search can be performed on each point cloud to find the nearest point cloud, and then these two points can be used as the target point cloud pair to be simplified.
[0098] For example, the overall error of the point cloud pair is compared with a preset error threshold range; if the overall error of the point cloud pair falls within the preset error threshold range, the point cloud pair is determined as the target point cloud pair; wherein, the preset error threshold range is determined based on a dynamic error threshold, which refers to a variable calculated in real time according to the algorithm state during the point cloud simplification iteration process, and this dynamic error threshold is related to the basic error value, the number of iterations, the baseline number of iterations, and the aggressiveness.
[0099] In this embodiment, the simplification of point cloud pairs is determined based on the magnitude of the error. The simplification result is related to an error threshold; a threshold that is too large will result in a loss of accuracy, while a threshold that is too small will not achieve the desired simplification effect. Therefore, the error threshold is calculated as follows:
[0100]
[0101] in, The base error value, where i is the iteration number. The baseline iteration count is given by , and k represents the aggression level. The simplification process is controlled based on the thr value to achieve maximum feature preservation and optimal simplification results.
[0102] It should be understood that the dynamic error threshold is not a fixed value, but a variable calculated in real time based on the algorithm's state during the point cloud simplification iteration process. Its purpose is to intelligently control the simplification process. This allows for optimal simplification efficiency while ensuring maximum preservation of overall geometric features (high accuracy), thus avoiding the two inherent drawbacks of traditional fixed-threshold methods:
[0103] 1) An excessively large threshold can cause the algorithm to merge too early and too coarsely, prematurely simplifying feature regions (such as edges and corners) that should be preserved, resulting in irreversible loss of geometric accuracy.
[0104] 2) Too small a threshold: This will make the algorithm too conservative. In the later stages of iteration, it will still perform unnecessary simplification calculations on flat or minor regions, which have a negligible effect on the overall model quality. This will lead to a waste of computing resources, a lengthy simplification process, and an inability to achieve the ideal simplification rate within a limited number of iterations.
[0105] This embodiment abandons the limitations of traditional fixed thresholds and introduces a dynamic error threshold mechanism. This error threshold is intelligently adjusted as the iteration process progresses. In the early stages of iteration, a smaller threshold is used to prioritize merging flat regions and strictly preserve features; as the iteration progresses, the threshold is gradually widened to simplify regions with more complex structures.
[0106] In addition, users can intuitively adjust the simplification level through the "aggressiveness" parameter, thereby achieving a precise balance between feature preservation and simplification efficiency.
[0107] Step S104: Update the vertex positions of the target point cloud pair to obtain new vertices.
[0108] In this embodiment, for the target point cloud pair that needs simplification, new vertex positions need to be recalculated, and the point cloud pair is replaced with the new vertex positions. Various different methods can be used to update the vertex positions of the target point cloud pair, including, for example, any of the following methods:
[0109] Method 1: Use one of the point clouds in the point cloud pair as the new vertex.
[0110] Method 2: Calculate the midpoint of the point cloud pair and use the midpoint as the new vertex.
[0111] Method 3: Calculate the minimum value of the fixed-point error of the point cloud pair, and use the minimum value of the fixed-point error as the new vertex.
[0112] Method 4: Use multiple different methods to determine multiple vertices of the point cloud pair, and select the point with the smallest error from the multiple vertices as the new vertex.
[0113] For example, for method 4 above, one vertex can be determined by methods 1 to 3 above, and then the error of the three vertices can be calculated, and the vertex with the smallest error can be selected as the new vertex.
[0114] Step S105: Replace the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data.
[0115] In this embodiment, for all target point cloud pairs selected in the point cloud pair set, new vertices are recalculated, and then the new vertices replace the corresponding target point cloud pairs. Optionally, two criteria can be set. The first is the number of iterations: after all target point cloud pairs are replaced, a new point cloud data can be formed. For this new point cloud data, steps S101 to S105 can be executed again to obtain another new point cloud data. Each time steps S101 to S105 are executed, the corresponding iteration count increments by 1. When the preset number of iterations is met, the obtained point cloud data is the simplified surface structured light point cloud data. The second criterion is the number of points in the point cloud data. That is, when the number of points in the total point cloud data after simplification is not greater than a preset value, the simplification of the point cloud pairs is stopped, and the simplified surface structured light point cloud data is obtained.
[0116] It should be understood that this embodiment effectively preserves the geometric features of the point cloud while efficiently reducing the amount of data through multiple constraints of error, number of iterations and simplification objectives.
[0117] In the aforementioned point cloud data simplification method, a spatial search structure for the structured light point cloud data is constructed. This spatial search structure is used to mark the nearest neighbor points of each point cloud, thus facilitating the search for nearest neighbor points and improving search efficiency. The planar error between each point cloud and its corresponding nearest neighbor point is determined. Each point cloud and its corresponding nearest neighbor point constitute a point cloud pair. Therefore, by quantifying the planar error of each point cloud pair, the nearest neighbor points can be corrected, achieving efficient point cloud simplification while preserving as many effective geometric features as possible. The target point cloud pair to be simplified is determined based on the planar error. The vertex positions of the target point cloud pair are updated to obtain new vertices. This allows for targeted point cloud simplification based on the planar error, reducing the data volume of the structured light point cloud data. The new vertices replace the target point cloud pair, resulting in the simplified structured light point cloud data. This allows for the precise quantification of the geometric complexity of local regions by calculating the planar error of point cloud pairs and their neighborhoods. This enables the point cloud pairs in flat areas to be simplified first, while point cloud pairs in feature regions such as edges and corners to be preserved, ultimately achieving a precise balance between feature preservation and simplification efficiency.
[0118] In another exemplary embodiment, such as Figure 3 As shown, a method for simplifying point cloud data is provided. The method in this embodiment may include the following steps S301 to S308. Wherein:
[0119] Step S301: Project the encoded grating pattern onto the surface of the object to be measured and obtain the pattern on the surface of the object to be measured. The pattern on the surface of the object to be measured contains the deformation information of the surface of the object to be measured.
[0120] Step S302: Based on the pattern on the surface of the object to be measured, the original point cloud data of the surface of the object to be measured is determined by phase deconstruction and three-dimensional reconstruction algorithms.
[0121] Step S303: After checking the original point cloud data and removing erroneous point cloud data, the surface structured light point cloud data is obtained.
[0122] In this embodiment, before constructing the surface structured light point cloud data, the original point cloud data needs to be inspected to remove incorrect point cloud data and retain only the correct point cloud data. This avoids introducing unnecessary errors and improves the accuracy of subsequent point cloud data simplification.
[0123] Step S304: Construct a spatial search structure for the surface structured light point cloud data. The spatial search structure is used to mark the nearest neighbor points of each point cloud.
[0124] Step S305: Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair.
[0125] Step S306: Determine the target point cloud pairs that need to be simplified based on the plane error.
[0126] Step S307: Update the vertex positions of the target point cloud pair to obtain new vertices.
[0127] Step S308: Replace the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data.
[0128] In this embodiment, please refer to the detailed implementation process and technical effects of steps S304 to S308. Figure 1 The relevant descriptions of steps S101 to S105 in the method embodiment shown will not be repeated here.
[0129] In this embodiment, the geometric complexity of a local region can be accurately quantified by calculating the planar error formed by point pairs and their neighborhoods. Point pairs in flat regions have smaller errors and are simplified first, while point pairs in feature regions such as edges and corners have larger errors and are retained, thus achieving a good balance between simplification efficiency and accuracy.
[0130] In yet another exemplary embodiment, such as Figure 4 As shown, a method for simplifying point cloud data is provided. The method in this embodiment may include the following steps S401 to S406. Wherein:
[0131] Step S401: Construct a spatial search structure for the surface structured light point cloud data. The spatial search structure is used to mark the nearest neighbor points of each point cloud.
[0132] Step S402: Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair.
[0133] Step S403: Determine the target point cloud pairs that need to be simplified based on the plane error.
[0134] Step S404: Update the vertex positions of the target point cloud pair to obtain new vertices.
[0135] Step S405: Replace the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data.
[0136] In this embodiment, please refer to the detailed implementation process and technical effects of steps S401 to S405. Figure 1 The relevant descriptions of steps S101 to S105 in the method embodiment shown will not be repeated here.
[0137] Step S406: The simplified surface structured light point cloud data is optimized by mean filtering and / or bilateral filtering to obtain optimized surface structured light point cloud data.
[0138] In this embodiment, all point cloud pairs with small errors are marked as point clouds that need simplification. Then, the newly calculated point cloud is used to replace these point cloud pairs, thereby updating the entire point cloud data. Finally, the point cloud data is optimized through mean filtering or bilateral filtering to obtain the final simplified ideal point cloud.
[0139] In this embodiment, a spatial search structure for point cloud data is first constructed to mark the nearest neighbor of each point; then the planar error between each point and its nearest neighbor is calculated; then the nearest neighbor is marked and modified based on the planar error, and its coordinates are updated; the above process is iterated until the preset error threshold is met or the expected number of simplified points is reached, and finally the optimized and updated vertex coordinates are output.
[0140] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0141] Based on the same inventive concept, this application also provides a point cloud data simplification apparatus for implementing the point cloud data simplification method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more point cloud data simplification apparatus embodiments provided below can be found in the limitations of the point cloud data simplification method described above, and will not be repeated here.
[0142] In one exemplary embodiment, such as Figure 5 As shown, a point cloud data simplification device is provided, comprising: a construction module 501, a first determination module 502, a second determination module 503, an update module 504, and a replacement module 505, wherein:
[0143] Module 501 is used to construct a spatial search structure for the surface structured light point cloud data. The spatial search structure is used to mark the nearest neighbor points of each point cloud.
[0144] The first determining module 502 is used to determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair;
[0145] The second determining module 503 is used to determine the target point cloud pairs that need to be simplified based on the plane error;
[0146] Update module 504 is used to update the vertex positions of the target point cloud pair to obtain new vertices;
[0147] Replacement module 505 is used to replace the target point cloud pair with new vertices to obtain simplified surface structured light point cloud data.
[0148] For example, the first determining module 502 is specifically used for: constructing a set of point cloud pairs based on each point cloud and its corresponding nearest neighbor point; traversing each point cloud pair in the set of point cloud pairs, and performing a radius search and / or nearest neighbor search at a preset resolution with the two point clouds in the point cloud pair as the center point, to obtain M neighbor points, where M is a natural number greater than a preset value; taking any one of the M neighbor points as the starting point, sequentially calculating the angle between one neighbor point and the center point and between the center point and another neighbor point; sorting the M neighbor points according to the angle size to obtain neighbor points with an ordered relationship; determining the plane error of all planes formed by all adjacent two neighbor points and the center point based on the neighbor points with an ordered relationship; and determining the overall error of the point cloud pair based on the plane error of all planes of the point cloud pair.
[0149] For example, the second determining module 503 is specifically used to: compare the overall error of the point cloud pair with a preset error threshold range; if the overall error of the point cloud pair falls within the preset error threshold range, determine the point cloud pair as the target point cloud pair; wherein, the preset error threshold range is determined based on a dynamic error threshold, the dynamic error threshold being a variable calculated in real time according to the algorithm state during the point cloud simplification iteration process, and the dynamic error threshold is related to the basic error value, the number of iterations, the baseline number of iterations, and the aggressiveness.
[0150] For example, update module 504 is specifically used to perform steps in any of the following ways:
[0151] Use one of the point clouds in the point cloud pair as the new vertex;
[0152] Calculate the midpoint of the point cloud pair and use the midpoint as the new vertex;
[0153] Calculate the minimum value of the fixed-point error of the point cloud pair, and use the minimum value of the fixed-point error as the new vertex;
[0154] Multiple vertices of a point cloud pair are determined using various methods, and the point with the smallest error among these vertices is selected as the new vertex.
[0155] For example, the above-mentioned device may further include: an optimization module 506, used to optimize the simplified surface structured light point cloud data by means filtering and / or bilateral filtering to obtain optimized surface structured light point cloud data.
[0156] In another exemplary embodiment, such as Figure 6 As shown, a device for simplifying point cloud data is provided. Figure 5 Based on the device shown, it may also include:
[0157] The acquisition module 507 projects the encoded grating pattern onto the surface of the object to be measured and acquires the pattern on the surface of the object to be measured. The pattern on the surface of the object to be measured contains the deformation information of the surface of the object to be measured.
[0158] The processing module 508 is used to determine the original point cloud data of the surface of the object under test based on the pattern on the surface of the object under test through phase deconvolution and three-dimensional reconstruction algorithms.
[0159] The inspection module 509 is used to inspect the original point cloud data and remove erroneous point cloud data to obtain surface structured light point cloud data.
[0160] The modules in the aforementioned simplified point cloud data device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0161] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores point cloud data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a method for simplifying point cloud data.
[0162] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0163] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0164] A spatial search structure for the surface structured light point cloud data is constructed, which is used to mark the nearest neighbor point of each point cloud. The planar error between each point cloud and its corresponding nearest neighbor point is determined, where each point cloud and its corresponding nearest neighbor point constitute a point cloud pair. The target point cloud pair to be simplified is determined based on the planar error. The vertex positions of the target point cloud pair are updated to obtain new vertices. The new vertices replace the target point cloud pair to obtain the simplified surface structured light point cloud data.
[0165] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0166] Based on each point cloud and its corresponding nearest neighbor, a set of point cloud pairs is constructed. Each point cloud pair in the set is traversed, and a radius search and / or nearest neighbor search at a preset resolution is performed, using the two point clouds in the pair as center points, to obtain M neighbor points, where M is a natural number greater than a preset value. Starting from any of the M neighbor points, the angles between one neighbor point and the center point, and between the center point and another neighbor point, are calculated sequentially. The M neighbor points are sorted according to the angles to obtain neighbor points with an ordered relationship. Based on these ordered neighbor points, the planar errors of all planes formed by two adjacent neighbor points and the center point are determined. Based on the planar errors of all planes in the point cloud pair, the overall error of the point cloud pair is determined.
[0167] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0168] The overall error of the point cloud pair is compared with a preset error threshold range. If the overall error of the point cloud pair falls within the preset error threshold range, the point cloud pair is determined as the target point cloud pair. The preset error threshold range is determined based on a dynamic error threshold. The dynamic error threshold is a variable calculated in real time according to the algorithm state during the point cloud simplification iteration process. The dynamic error threshold is related to the basic error value, the number of iterations, the baseline number of iterations, and the aggressiveness.
[0169] In one embodiment, the processor, when executing a computer program, also performs any of the following steps:
[0170] Use one of the point clouds in the point cloud pair as the new vertex;
[0171] Calculate the midpoint of the point cloud pair and use the midpoint as the new vertex;
[0172] Calculate the minimum value of the fixed-point error of the point cloud pair, and use the minimum value of the fixed-point error as the new vertex;
[0173] Multiple vertices of a point cloud pair are determined using various methods, and the point with the smallest error among these vertices is selected as the new vertex.
[0174] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0175] Before constructing the spatial search structure for the surface structured light point cloud data, an encoded grating pattern is projected onto the surface of the object to be measured, and the pattern of the object's surface is obtained. The pattern of the object's surface contains deformation information of the object's surface. Based on the pattern of the object's surface, the original point cloud data of the object's surface is determined by phase deconvolution and 3D reconstruction algorithms. After checking the original point cloud data and removing erroneous point cloud data, the surface structured light point cloud data is obtained.
[0176] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0177] The simplified structured light point cloud data is optimized by mean filtering and / or bilateral filtering to obtain optimized structured light point cloud data.
[0178] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method steps of the various embodiments described above.
[0179] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the method steps of the various embodiments described above.
[0180] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0181] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0182] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for simplifying point cloud data, characterized in that, The method includes: A spatial search structure for surface structured light point cloud data is constructed, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud; Determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair; Based on the aforementioned planar error, determine the target point cloud pairs that need to be simplified; The vertex positions of the target point cloud pair are updated to obtain new vertices; The new vertices replace the target point cloud pair to obtain simplified surface structured light point cloud data.
2. The method according to claim 1, characterized in that, The determination of the planar error between each point cloud and its corresponding nearest neighbor point includes: Construct a set of point cloud pairs based on each point cloud and its nearest neighbor. Traverse each point cloud pair in the set of point cloud pairs, and take the two point clouds in the point cloud pair as the center points to perform a radius search and / or nearest neighbor search at a preset resolution to obtain M neighbor points, where M is a natural number greater than a preset value. Starting from any of the M neighboring points, calculate the angles between one neighboring point and the center point, and between the center point and another neighboring point. The M neighboring points are sorted according to the angle between them to obtain neighboring points with an ordered relationship. Based on the neighbor points with the given sequential relationship, determine the plane error of multiple planes formed by all adjacent neighbor points and the center point; The overall error of the point cloud pair is determined based on the planar errors of all planes of the point cloud pair.
3. The method according to claim 2, characterized in that, The step of determining the target point cloud pair that needs to be simplified based on the plane error includes: The overall error of the point cloud pair is compared with a preset error threshold range; If the overall error of the point cloud pair falls within the preset error threshold range, the point cloud pair is determined as the target point cloud pair. The preset error threshold range is determined based on a dynamic error threshold, which is a variable calculated in real time according to the algorithm state during the point cloud simplification iteration process. The dynamic error threshold is related to the basic error value, the number of iterations, the baseline number of iterations, and the aggressiveness.
4. The method according to claim 1, characterized in that, The step of updating the vertex positions of the target point cloud pair to obtain new vertices includes any of the following methods: Use one of the point clouds in the point cloud pair as the new vertex; Calculate the midpoint of the point cloud pair and use the midpoint as the new vertex; Calculate the minimum value of the fixed-point error of the point cloud pair, and use the minimum value of the fixed-point error as the new vertex; Multiple vertices of the point cloud pair are determined using various methods, and the point with the smallest error is selected as the new vertex from among the multiple vertices.
5. The method according to any one of claims 1 to 4, characterized in that, Before constructing the spatial search structure for the surface structured light point cloud data, the method further includes: The coded grating pattern is projected onto the surface of the object to be tested, and the pattern on the surface of the object to be tested is obtained. The pattern on the surface of the object to be tested contains the deformation information of the surface of the object to be tested. Based on the pattern on the surface of the object under test, the original point cloud data of the surface of the object under test is determined by phase deconvolution and three-dimensional reconstruction algorithms. After inspecting the original point cloud data and removing erroneous point cloud data, surface structured light point cloud data is obtained.
6. The method according to any one of claims 1 to 4, characterized in that, The method further includes replacing the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data. The simplified surface structured light point cloud data is optimized by mean filtering and / or bilateral filtering to obtain optimized surface structured light point cloud data.
7. A device for simplifying point cloud data, characterized in that, The device includes: A construction module is used to construct a spatial search structure for surface structured light point cloud data, wherein the spatial search structure is used to mark the nearest neighbor points of each point cloud. The first determining module is used to determine the planar error between each point cloud and its corresponding nearest neighbor point, wherein each point cloud and its corresponding nearest neighbor point constitute a point cloud pair; The second determining module is used to determine the target point cloud pairs that need to be simplified based on the plane error; The update module is used to update the vertex positions of the target point cloud pair to obtain new vertices; The replacement module is used to replace the target point cloud pair with the new vertices to obtain simplified surface structured light point cloud data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.