A point cloud skeleton extraction method and computer storage medium
By preprocessing and position update methods for point clouds, the problem that point cloud skeleton extraction algorithm in the existing technology is difficult to deal with data loss and noise points, and the complete skeleton structure is extracted on point clouds with complex topological structures is achieved. .
Patent Information
- Application Number
- CN202111170720.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing point cloud skeleton extraction algorithm is difficult to effectively process point cloud data with a large number of missing data, uneven density and noise points, especially in point clouds with complex topology. It is difficult to extract correct topology and geometric details. skeleton.
By preprocessing the original point cloud, the location of each point is updated using the neighborhood information of each point, so that it moves to the central axis inside the point cloud, thereby obtaining the skeletonized point cloud. The specific steps include building K nearest European neighbor graph, calculating the shortest path, updating the location of the point until the iteration is over.
This method can preserve as much geometric details as possible while retaining the correct topology of the object, making the extracted point cloud skeleton more complete. At the same time, the problem of point cloud skeleton extraction with large variations in thickness spans is solved, and the skeleton can be obtained quickly and completely.
Smart Images

Figure CN113888623B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a point cloud skeleton extraction method and a computer storage medium. Background Art
[0002] In recent years, with the development of 3D laser scanning technology, the cost of obtaining 3D point clouds has continued to decline, and point cloud data has become increasingly accessible. To a certain extent, it overcomes the limitations of traditional manual data collection methods, such as cumbersome, slow, and inefficient. However, due to the occlusion of some objects themselves, the systematic error of the scanning equipment, and the random error introduced during scanning, the acquired point clouds often have more data missing and have the characteristics of uneven density and noise points. In order to reduce the adverse effects of point cloud quality on the final results, many researchers have begun to choose to extract the skeleton of the point cloud model for scientific research. This is because the skeleton is an abstract representation of the key features of the 3D model, which can best reflect the shape, structure, and topological connection between each point of the 3D model, and the skeleton can also be used to fill in data and enhance the point cloud model. Since the skeleton can relatively completely retain the topological structure of the object while discarding some redundant information, it helps to understand the shape, process the shape, and analyze the shape of the object. At present, the skeleton extracted from the 3D point cloud of the object is widely used in game development, natural scene simulation, urban landscape development, animation, digital navigation, medical image display, surveying and mapping, and agricultural research.
[0003] However, existing point cloud skeleton extraction algorithms are either not well suited to point cloud data with a large amount of missing data, uneven density and noise points, or they can solve the above problems but cannot extract skeletons with correct topological structure and relatively complete geometric details from point clouds with more complex topological structures. Summary of the invention
[0004] In order to overcome the defects in the above-mentioned prior art, the purpose of the present invention is to provide a point cloud skeleton extraction method and a computer storage medium.
[0005] In order to achieve the above-mentioned object of the present invention, the present invention provides a point cloud skeleton extraction method, comprising the following steps:
[0006] Preprocess the original scanned point cloud;
[0007] Based on the preprocessed point cloud, the position of each point is updated using the neighborhood information of each point, so that each point continuously moves toward the central axis inside the point cloud, thereby obtaining a skeleton point cloud;
[0008] A point cloud skeleton line is generated according to the skeletonized point cloud.
[0009] In the preferred embodiment of the point cloud skeleton extraction method, the steps of obtaining the skeletonized point cloud are as follows:
[0010] Construct a K-nearest Euclidean neighbor graph G for the point cloud, and calculate other point-to-point p in the graph on the K-nearest Euclidean neighbor graph G i The shortest path of the point p is sorted by length, and the first K' points with the smallest shortest path length are selected as the point p i The shortest path neighbor point is obtained i The neighborhood information of K'≥K is obtained to obtain the neighborhood information of each point in the point cloud, where K and K' are positive integers;
[0011] The neighborhood information of each point in the point cloud is used to update the position of each point so that it moves into the point cloud. The K' value is iteratively updated each time each point moves into the point cloud. Based on the iteratively updated K' value, the new shortest path neighbor point of each point is obtained, and the position of each point is updated again to move it into the point cloud until the iteration is completed to obtain a skeletonized point cloud.
[0012] This preferred solution can find sufficient neighbor points for a point and the point and its neighbor points are distributed in the same position as much as possible, thus avoiding the subsequent occurrence of wrong skeleton results.
[0013] Preferably, the displacement formula is: Δd is point p i The displacement vector, Representative point p i The K' shortest path neighbor points, x refers to the displacement vector.
[0014] The optimal solution obtains point p i The median of the vector set T pointing to its neighboring points minimizes the sum of the distances to all vectors in the set, thereby reducing the point p i The distance moved in the displacement direction avoids the problem of the point's displacement span being too large in the later stage and jumping over the central axis inside the point cloud without changing the overall direction trend of the original displacement.
[0015] The preferred solution of the point cloud skeleton extraction method: constructing a covariance matrix p i and p' j are all row vectors, N'(p i ) is point p i The set of neighbor points in a circular area with a radius of r on the K nearest Euclidean neighbor graph G;
[0016] Solve for the covariance matrix M i Get three eigenvalues as well as They correspond to the first main direction, the second main direction and the normal direction respectively, where the first main direction is point p i The main direction vector
[0017] Remove the p i The displacement component of the displacement vector in its main direction, p i The displacement vector is:
[0018] The formula is iteratively applied to all points in the point cloud to move them toward the inside of the point cloud.
[0019] The optimal solution reduces the point p in the point cloud i The offset component in its main direction prevents the moved point cloud from deviating from the original topological structure, can obtain the skeleton structure of the point cloud to a greater extent, and avoids the loss of part of the skeleton structure.
[0020] The preferred solution of the point cloud skeleton extraction method is: setting the threshold τ, point p i Threshold When point p i τ i When the value is greater than the threshold value, the point is fixed and no longer moves.
[0021] The preferred solution of the point cloud skeleton extraction method is to use point p i The neighborhood information of the point is used to determine the K' value corresponding to the point. The update formula of K' is:
[0022] in and They are point p i The K' value corresponding to the nth and n+1th updates of its position, n is a positive integer, is the average value of the threshold τ of all points.
[0023] This preferred solution uses the neighborhood information of the point itself to determine the K' value corresponding to the point, and can automatically adapt to point clouds of different coarse and fine parts, thereby ensuring that the skeleton topology structure is generally correct while capturing as much detail information as possible.
[0024] The preferred solution of the point cloud skeleton extraction method is: if the ratio of fixed points reaches the ratio setting value within the specified number of iterations m, the iteration process is stopped;
[0025] On the contrary, if the ratio of the fixed point does not reach the ratio setting value, directly find K' for the point that has not been fixed yet pi,m The nearest Euclidean neighbor point is used to update the position of each unfixed point and move it into the point cloud until the ratio of fixed points reaches the set ratio value, thus obtaining a skeletonized point cloud.
[0026] This method can not only extract skeleton point clouds with correct topological structure and relatively complete geometric details from objects with high topological complexity, but also accelerate the extraction of skeleton point clouds of objects with low topological complexity but large thickness span, with better robustness and generalization.
[0027] The preferred solution of the point cloud skeleton extraction method: when constructing the K nearest Euclidean neighbor graph G of the point cloud, the K value is selected according to the point cloud of the thinnest part of the object to construct the K nearest Euclidean neighbor graph G. When the span of the thickness variation of the object is large, the preferred solution can retain the skeleton of the thinner part, avoiding the loss of the skeleton structure of the thinner part.
[0028] The preferred solution of the point cloud skeleton extraction method is as follows: when generating skeleton lines, first calculate a minimum cube that encloses the skeletonized point cloud, divide the cube into multiple sub-cubes of the same size, and if there is a sub-cube that contains less than a preset value of the number of points, discard the points in the sub-cube, and for each remaining sub-cube, calculate the center of its contained point set as the skeleton point, connect the skeleton points, and complete the extraction of the point cloud skeleton line.
[0029] The present invention also proposes a computer storage medium, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned point cloud skeleton extraction method.
[0030] The beneficial effects of the present invention are as follows: the invention takes into account the skeleton acquisition of different thicknesses of the object, and can retain as many geometric details as possible while retaining the correct topological structure of the object, so that the extracted point cloud skeleton is more complete; at the same time, the present application also solves the problem of extracting point cloud skeletons with large thickness span variations, and can obtain the skeleton relatively quickly and completely.
[0031] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0033] Figure 1 is a schematic diagram of the process of this method;
[0034] Figure 2 It is a schematic diagram of the approximate displacement direction of the source point determined by referring to the neighbor point information;
[0035] Figure 3 It is a schematic diagram of point cloud skeletonization. DETAILED DESCRIPTION
[0036] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0037] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.
[0038] like Figure 1 As shown, the present invention provides an embodiment of a method for extracting skeletons from point clouds. The main steps of this embodiment include data preprocessing, obtaining skeletonized point clouds, and generating skeleton lines.
[0039] The first step is data preprocessing. Since the original scanned point cloud often has a lot of noise and has problems such as large data volume and uneven density, it needs to be downsampled and homogenized. Suppose the input point cloud is N is the number of points. This embodiment preferably, but not limited to, uses a density-weighted local optimal projection operator (WLOP) to downsample, denoise and homogenize the point cloud to obtain the final point cloud. N' is the number of points after preprocessing.
[0040] Regarding the acquisition of the skeletonized point cloud, this embodiment mainly updates the position of each point based on the preprocessed point cloud using the neighborhood information of each point, so that each point continuously moves toward the central axis inside the point cloud to obtain the skeletonized point cloud.
[0041] Specifically,
[0042] Construct a K-nearest Euclidean neighbor graph G for the point cloud. When constructing the K-nearest Euclidean neighbor graph G, select an appropriate K value, which can be set manually according to the actual distribution of the point cloud. Appropriate means that the neighbor points of a point will not appear in another part. Calculate the other point-to-point p in the graph on the K-nearest Euclidean neighbor graph G. i The shortest path of the point p is sorted by length, and the first K' points with the smallest shortest path length are selected as the point p i The shortest path neighbor point is obtained i The neighborhood information of K'≥K, K and K' are both positive integers, and the initial value of K' can be preset, such as the initial value of K'=K+A, A is a positive integer, such as 2. In this embodiment, the shortest path is preferably found by using, but not limited to, the Dijkstra algorithm.
[0043] After determining how to obtain the neighborhood information of each point, the neighborhood information can be used to update the position of the point and move it into the point cloud.
[0044] The K' value is iteratively updated each time each point in the point cloud moves into the point cloud. Based on the iteratively updated K' value, the new shortest path neighbor point of each point is obtained, and the position of each point is updated again to move it into the point cloud until the iteration is completed to obtain a skeletonized point cloud.
[0045] This embodiment proposes that each point p i The displacement formula is: Δd is point p i The displacement vector, Representative point p i The K' shortest path neighbors of the equation are x, which is the displacement vector. Δd is the x that minimizes the entire formula.
[0046] From point p i The vector set T pointing to its neighboring points indicates its displacement direction and displacement magnitude to a certain extent, and the overall trend of this direction tends to point to the inside of the point cloud, such as Figure 2 As shown in the figure, the point in the middle represents the source point, the surrounding points represent its neighboring points, and the dotted line represents its approximate displacement direction. Without changing the original overall displacement trend, in order to avoid the point from having a large span in the later displacement and jumping over the central axis inside the point cloud, this embodiment obtains the median of the vector set T to minimize the sum of its distances to all vectors in the set, thereby reducing the distance that the point moves in the displacement direction.
[0047] Although applying the above displacement formula to all points can make the point cloud move inward, the moved point cloud may deviate from the original topological structure or even cluster into a cluster. For example, considering the surface point cloud of a cylinder, we only want the point cloud to move inward along the horizontal direction, but not in the vertical direction (main direction), because this will cause the upper point cloud to move downward and the lower point cloud to move upward, thus losing part of the skeleton structure.
[0048] Therefore, in order to prevent the point cloud from deviating from the original topological structure or even clustering into a cluster after being moved, this embodiment defines a control vector c(p i ), to reduce each point p in the point cloud i The offset component in its main direction, and before that, it is necessary to first determine the point p i main direction.
[0049] To determine the point p i The main direction of this embodiment constructs the covariance matrix In this embodiment, the covariance matrix M i is a 3×3 covariance matrix, which is determined by principal component analysis (PCA). i and p' j are all row vectors, N'(p i ) is point p i The set of neighbor points within the circular area with a radius of r on the K nearest Euclidean neighbor graph G, where r depends on the specific situation of the point cloud.
[0050] Use the existing method to solve the covariance matrix M i Get three eigenvalues as well as Corresponding to the first main direction, the second main direction and the normal direction respectively, where, The first main direction is point p i The main direction vector
[0051] Define the control vector Its essence is point p i The displacement component of the displacement vector in its main direction. After removing the influence of this component, the control point can cancel the movement in its main direction.
[0052] After adding this control vector, the p i The displacement vector is:
[0053] The formula is iteratively applied to all points in the point cloud to move them toward the inside of the point cloud.
[0054] However, considering that the thickness of different parts of an object is different, the point cloud of the thinner part will move closer to the central axis faster than the thicker part. Therefore, for the points that have moved closer to the central axis, their positions need to be fixed and they do not need to participate in the subsequent iteration process. The three eigenvalues obtained above are They represent the density of point distribution in their respective main directions. The closer these three values are, the closer the point p is. i The more dispersed the points in the neighborhood are, the more Much greater than and Then point p i The points in the neighborhood are concentrated in the same direction, which to some extent reflects the i It has moved to near the central axis.
[0055] Therefore, in order to determine which points have moved to the vicinity of the central axis, a threshold τ is set in this embodiment, and the point p i Threshold When point p i τ iWhen the value is greater than the threshold value, the point is fixed and no longer moves. i >0.98, then the fixed point p i , so that it will not move any more later.
[0056] In addition, there is also a problem of selecting the value of the shortest path neighbor point K' for different coarse and fine parts of the object. A smaller K' value helps capture the skeleton of a small part, and avoids the neighbor points appearing in another part when a larger K' value is selected, which causes the skeleton of that part to merge with another part and disappear. However, a smaller K' value makes it difficult to guide the point cloud of a coarser part to move correctly. Therefore, this embodiment uses the neighborhood information of the point itself to determine the K' value corresponding to the point, so that it automatically adapts to the point cloud of different coarse and fine parts, thereby capturing as much detail information as possible while ensuring that the skeleton topology is generally correct. The update method of K' is as follows: in and They are point p i The K' value corresponding to the nth and n+1th updates of its position, is the average value of the threshold τ of all points. As the position of the point is continuously updated, it will continue to approach the central axis of the point cloud, so its corresponding τ i The value will gradually increase until the point is fixed. Correspondingly, the change of the corresponding K' value should also gradually slow down until there is almost no need to change it later. During this period, in order to avoid the K' value changing too fast, a Gaussian function is added to the above formula to make its change smoother, that is,
[0057] In the process of each point moving into the point cloud, if the ratio of fixed points reaches the ratio setting value within the specified number of iterations m, the iteration process is stopped. One movement of all points is counted as one iteration, and fixed points do not participate in the iteration. m is a positive integer. In this embodiment, the ratio setting value is preferably but not limited to 90%.
[0058] On the contrary, if the ratio of the fixed point does not reach the ratio setting value, directly search for the point that has not been fixed yet. The nearest Euclidean neighbor point is used to update the position of each unfixed point using the information of the Euclidean neighbor point. The calculation method is: let n = m-1, using the above The calculation formula can be used to calculate the K' value and displacement vector of the unfixed point, but the neighbor point is no longer the shortest path neighbor point but the nearest Euclidean neighbor point. When the ratio of the fixed point reaches the set ratio value, the whole process ends and the skeletonized point cloud is obtained, such as Figure 3 shown.
[0059] This embodiment can obtain an initial skeleton point cloud with relatively complete geometric details from an object point cloud with a smooth transition between thick and thin. However, for point cloud models with a large span of thickness changes, this method will be subject to certain limitations. This is because when looking for the K' shortest path neighbors of a point, this embodiment is performed on the constructed K nearest Euclidean neighbor graph G. When the span of the thickness change of an object is large, in order to retain the skeleton of the thinner part, it is necessary to select a smaller K value to avoid merging the skeleton. However, when looking for K' shortest path neighbors for a point in a thicker part on the graph, its neighbor points are likely to be distributed only on the same side of the part where the point is located. The neighbor points of a point are very important for calculating the displacement vector of the point. If the neighbor points are only distributed on one side, the point will move very slowly, requiring a larger K' value or more movements to complete.
[0060] Therefore, in order to apply to point cloud models with a large span of thickness changes, the present application proposes a preferred solution of the above embodiment, which selects a suitable K value according to the point cloud of the thinnest part of the object to construct a K nearest Euclidean neighbor graph G, and then calculates the K' value corresponding to each point on the graph G according to the above method of calculating the K' value and finds its corresponding shortest path neighbor point, and then uses these shortest path neighbor points of each point to obtain the moving direction and distance of the point according to the above method of calculating the displacement vector, thereby moving the point. When the point's τ i When the value is greater than 0.98, the point is fixed and no longer moved. If the ratio of fixed points reaches 90% within the specified number of iterations m, the iteration process is stopped. Otherwise, if it does not reach 90%, it proves that the thickness span of the point cloud is large. At this time, directly fix the point p that has not been fixed yet. i Search The nearest Euclidean neighbor point is used to move the point position. Similarly, the same formula is used to calculate the K' value and displacement vector of the unfixed point, except that the neighbor point is no longer the shortest path neighbor point but the nearest Euclidean neighbor point. When the ratio of fixed points reaches 90%, the whole process ends and a skeletonized point cloud is obtained.
[0061] After moving the point cloud using the above method, the point cloud will converge near the central axis to form a skeleton point cloud. At this time, it is not the final skeleton line, and the skeleton point cloud needs to be further processed to obtain the skeleton line.
[0062] First, the skeleton point cloud needs to be downsampled, and a minimum cube that surrounds the skeletonized point cloud needs to be calculated. Then the cube is divided into multiple sub-cubes. If the number of points contained in a sub-cube is less than the preset value of the number of points, such as 3, the points in the sub-cube are discarded. For each remaining sub-cube, the center of the point set is calculated as the skeleton point. After the calculation is completed, all the skeleton points of the object can be obtained. There are existing methods for connecting the skeleton points, which can be selected according to the actual situation. At this point, the skeleton line extraction of the point cloud model can be completed.
[0063] The present invention also proposes an embodiment of a computer storage medium, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned point cloud skeleton extraction method.
[0064] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0065] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A point cloud skeleton extraction method, characterized in that: The following steps are involved: Preprocess the original scanned point cloud; Based on the preprocessed point cloud, the position of each point is updated using the neighborhood information of each point, so that each point continuously moves toward the central axis inside the point cloud, thereby obtaining a skeleton point cloud; Generating a point cloud skeleton line according to the skeletonized point cloud; When generating skeleton lines, first calculate a minimum cube that encloses the skeletonized point cloud, and divide the cube into multiple sub-cubes of the same size. If there is a sub-cube that contains less than the preset value of the number of points, the points in the sub-cube are discarded. For each remaining sub-cube, calculate the center of its contained point set as the skeleton point, connect the skeleton points, and complete the extraction of the point cloud skeleton line.
2. The point cloud skeleton extraction method according to claim 1, characterized in that: The steps to obtain the skeletonized point cloud are: Construct a K-nearest Euclidean neighbor graph G for the point cloud, and calculate other point-to-point p in the graph on the K-nearest Euclidean neighbor graph G i The shortest path of the point p is sorted by length, and the first K' points with the smallest shortest path length are selected as the point p i The shortest path neighbor point is obtained i The neighborhood information of K'≥K is obtained to obtain the neighborhood information of each point in the point cloud, and K and K' are both positive integers; The neighborhood information of each point in the point cloud is used to update the position of each point so that it moves into the point cloud. The K' value is iteratively updated each time each point moves into the point cloud. Based on the iteratively updated K' value, the new shortest path neighbor point of each point is obtained, and the position of each point is updated again to move it into the point cloud until the iteration is completed to obtain a skeletonized point cloud.
3. The point cloud skeleton extraction method according to claim 2, characterized in that: The displacement formula is: Δd is point p i The displacement vector, Representative point p i The K' shortest path neighbor points, x refers to the displacement vector.
4. The point cloud skeleton extraction method according to claim 3, characterized in that: Constructing the covariance matrix p i and p' j are all row vectors, N'(p i ) is point p i The set of neighbor points in a circular area with a radius of r on the K nearest Euclidean neighbor graph G; Solve for the covariance matrix M i Get three eigenvalues as well as They correspond to the first main direction, the second main direction and the normal direction respectively, where the first main direction is point p i The main direction vector Remove the dot p i The displacement component of the displacement vector in its main direction, p i The displacement vector is: The formula is iteratively applied to all points in the point cloud to move them toward the inside of the point cloud.
5. The point cloud skeleton extraction method according to claim 4, characterized in that: Set the threshold τ, point p i Threshold When point p i τ i When the value is greater than the threshold value, the point is fixed and no longer moves.
6. The point cloud skeleton extraction method according to claim 5, characterized in that: Using point p i The neighborhood information of the point is used to determine the K' value corresponding to the point. The update formula of K' is: in and They are point p i The K' value corresponding to the nth and n+1th updates of its position, n is a positive integer, is the average value of the threshold τ of all points.
7. The point cloud skeleton extraction method according to claim 6, characterized in that: If the ratio of the fixed points reaches the set ratio value within the specified number of iterations m, the iteration process is stopped; On the contrary, if the ratio of the fixed point does not reach the ratio setting value, directly find K' for the point that has not been fixed yet pi,m The nearest Euclidean neighbor point is used to update the position of each unfixed point and move it into the point cloud until the ratio of fixed points reaches the set ratio value, thus obtaining a skeletonized point cloud.
8. The point cloud skeleton extraction method according to claim 2, characterized in that: When constructing the K nearest Euclidean neighbor graph G of the point cloud, the K value is selected according to the point cloud of the finest part of the object to construct the K nearest Euclidean neighbor graph G.
9. A computer storage medium, characterized in that The storage medium stores at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the point cloud skeleton extraction method according to any one of claims 1-8.
Citation Information
Patent Citations
Method and device for extracting point cloud framework
CN103268631A