High-precision point cloud normal calculation method

文档序号:551856 发布日期:2021-05-14 浏览:9次 中文

阅读说明:本技术 一种高精度点云法向计算方法 (High-precision point cloud normal calculation method ) 是由 潘威 卢盛林 曹玲 于 2021-01-12 设计创作,主要内容包括:本发明属于点云处理技术领域,具体公开了一种高精度点云法向计算方法,包括以下步骤:读取点云数据;设一个包含N个点的三维点云为P,三维点云P中第i个点记为P-i(x-i,y-i,z-i),在空间邻域中确定P-i的3个尺度k-1,k-2,k-3为近邻点,遍历点云,确定三维点云P中所有点的每个尺度对应的初始法向量;通过邻域点法向信息替代无效法向,采用最小生成树算法使得所有邻域点法向朝向一致,确定P中所有点的最终法向。本发明首次提出了采用多尺度信息对法向分别进行计算,并融合的机制,有效避免了参数K选取带来的不稳定影响,抑制了噪声的影响,在边界部分也更好地保持了细节,有效解决了带噪点云数据的法向计算问题。(The invention belongs to the technical field of point cloud processing, and particularly discloses a high-precision point cloud normal calculation method, which comprises the following steps: reading point cloud data; setting a three-dimensional point cloud containing N points as P, and recording the ith point in the three-dimensional point cloud as P i (x i ,y i ,z i ) Determining P in spatial neighborhood i 3 dimensions k of 1 ,k 2 ,k 3 Traversing the point cloud for the adjacent points, and determining an initial normal vector corresponding to each scale of all the points in the three-dimensional point cloud P; and replacing the invalid normal direction by the normal direction information of the neighborhood points, and determining the final normal direction of all the points in the P by adopting a minimum spanning tree algorithm to ensure that the normal directions of all the neighborhood points are consistent. The invention firstly provides a mechanism for respectively calculating and fusing normal directions by adopting multi-scale information, thereby effectively avoiding the instability caused by the selection of the parameter KThe influence inhibits the influence of noise, better maintains details at the boundary part, and effectively solves the normal calculation problem of cloud data with noise points.)

1. A high-precision point cloud normal calculation method is characterized by comprising the following steps:

step 1: a depth camera or a three-dimensional laser scanner is adopted to carry out object scanning, and point cloud data are read;

step 2: setting a three-dimensional point cloud containing N points as P, and recording the ith point in the three-dimensional point cloud as Pi(xi,yi,zi) Determining P in spatial neighborhoodi3 dimensions k of1,k2,k3Traversing the point cloud for adjacent points, and determining an initial normal vector corresponding to each scale of all the points in the three-dimensional point cloud P, wherein k is1=15,k2=30,k3=45;xi,yi,ziAre respectively a point PiX, Y and Z coordinate values of;

and step 3: replacing an invalid normal direction by using the normal direction information of the neighborhood points, and enabling the normal directions of all the neighborhood points to be consistent by adopting a minimum spanning tree algorithm;

and 4, step 4: the final normal for all points in P is determined according to the following equation,

wherein the content of the first and second substances,

is a central point, pjFor other points in the neighborhood, σdIs a distance weight, which is constant, usually taking the maximum radius, σnIs a normal weight, which is constant, z is 1, 2 or 3.

2. The method of claim 1, wherein the method comprises the following steps:

traversing the point cloud in the step 2, and determining an initial normal vector corresponding to each scale of all the points in the P, which is specifically as follows:

with PiAs a central point, from the neighborhood point P to the central point PiCalculating the weight of Euclidean distance, and constructing a weighted covariance matrix expression of the neighborhood points as follows:

wherein M is a 3 multiplied by 3 real symmetric semi-positive definite matrix, and 3 eigenvalues lambda of M are calculated0、λ1And λ2And arranged in descending order such that2≥λ1≥λ03 eigenvalues λ0、λ1And λ2Respectively corresponding to the feature vectors v0,v1And v2(ii) a Setting a judgment condition:

λ2>0&&(λ20)/(λ02)<0.75

when the above conditions are satisfied, the eigenvector v corresponding to the minimum eigenvalue is taken0As a point piInitial normal vector ofOtherwise, n0 iIs set to the invalid normal.

3. The method of claim 1, wherein the method comprises the following steps:

replacing the invalid normal by the normal information of the neighborhood points in the step 3, and enabling the normal directions of all the neighborhood points to be consistent by adopting a minimum spanning tree algorithm, which is specifically as follows:

traversing the point cloud P, replacing the invalid normal direction by the normalized neighborhood point normal weighted average value for the invalid normal direction, ensuring that each point in the point cloud P has a stable valid normal vector,

constructing a minimum spanning tree of the P point cloud by using Prim algorithm, wherein the angle weight between the normal directions of all points isThe specific mode is as follows:

step 3-1: sequentially solving the weights of j other points and root nodes in the neighborhood by taking any point in the point cloud P as the root node of the tree, calculating to obtain a minimum weight, setting the minimum weight as f1, storing another point forming f1 in a set V, and storing f1 in a set E;

step 3-2: sequentially calculating the weights of the (j-1) points remaining in the neighborhood and each point in the set V, calculating to obtain a minimum weight, setting the minimum weight as fn, storing the other point forming fn in the set V, and storing fn in the set E; wherein n is 2, 3, 4, 5 … … j;

step 3-3: repeating the step 3-2 until no residual points exist in the neighborhood, wherein the set E is the set of the neighborhood minimum spanning tree weight;

step 3-4: starting from a root node of the minimum spanning tree, gradually transmitting a normal vector normal to each leaf node of the tree, wherein the specific transmission mode is as follows:

wherein n isiNormal vector, n, representing parent node in neighborhoodi+1And if the sum of the dot product of the two vectors is less than zero, the normal vector direction of the child node is reversed.

Technical Field

The invention belongs to the technical field of point cloud processing, and particularly relates to a high-precision point cloud normal calculation method.

Background

With the progress of the three-dimensional sensor technology, the acquisition of the three-dimensional point cloud is easier. The information described by the three-dimensional space coordinates of the single use points is very limited, and the normal method is the most widely used and most important characteristic of the point cloud, and the method is widely applied to the aspects of data analysis, registration, segmentation and the like.

In the related art, the three-dimensional point cloud data of the acquired image usually has noise erosion, and in terms of hardware, noise occurs due to precision errors of a depth camera or a three-dimensional laser scanner; on the software side, the point may be placed in the wrong position during the algorithm that generates the point cloud due to the error in the angle measurement or the inaccuracy of the floating point number operation. In terms of environment, the collected point cloud may be affected due to environmental factors (e.g., dust in the air, diffuse reflection occurring on the surface of an object, etc.).

At present, the direction of the normal vector of the point cloud midpoint is commonly calculated by the following method: and calculating the covariance matrix eigenvalue and eigenvector of one point and the adjacent points to estimate the direction of the normal vector of the point in the point cloud. The selection of the nearest neighbor parameter K in the method is very critical, details are lost when the nearest neighbor parameter K is too large, details are sensitive to noise when the nearest neighbor parameter K is too small, and the point cloud data often contains a large amount of noise, so that a large error is easily introduced when the normal vector of the midpoint of the point cloud is estimated by adopting the method, and the point cloud data carries a large amount of noise.

Disclosure of Invention

The invention aims to: aiming at the defects of the prior art, a high-precision point cloud normal calculation method is provided, and calculation methods such as anisotropic weighting and multi-scale normal fusion are introduced into point cloud data, so that stable and high-precision normal vectors are obtained, stable calculation parameters are provided for registration, clustering, segmentation and the like of the point cloud, and the noise suppression capability is improved.

In order to achieve the purpose, the invention adopts the following technical scheme:

a high-precision point cloud normal calculation method comprises the following steps:

step 1: a depth camera or a three-dimensional laser scanner is adopted to carry out object scanning, and point cloud data are read;

step 2: setting a three-dimensional point cloud containing N points as P, and recording the ith point in the three-dimensional point cloud as Pi(xi,yi,zi) Determining P in spatial neighborhoodi3 dimensions k of1,k2,k3Traversing the point cloud for adjacent points, and determining an initial normal vector corresponding to each scale of all the points in the three-dimensional point cloud P, wherein k is1=15,k2=30,k3=45;xi,yi,ziAre respectively a point PiX, Y and Z coordinate values of;

and step 3: replacing an invalid normal direction by using the normal direction information of the neighborhood points, and enabling the normal directions of all the neighborhood points to be consistent by adopting a minimum spanning tree algorithm;

and 4, step 4: the final normal for all points in P is determined according to the following equation,

wherein the content of the first and second substances,

is a central point, pjFor other points in the neighborhood, σdIs a distance weight, which is constant, usually taking the maximum radius, σnIs a normal weight, which is constant, z is 1, 2 or 3.

Further, traversing the point cloud in the step 2, and determining an initial normal vector corresponding to each scale of all the points in P, which is specifically as follows:

with PiAs a central point, from the neighborhood point P to the central point PiCalculating the weight of Euclidean distance, and constructing a weighted covariance matrix expression of the neighborhood points as follows:

wherein M is a 3 multiplied by 3 real symmetric semi-positive definite matrix, and 3 eigenvalues lambda of M are calculated0、λ1And λ2And arranged in descending order such that2≥λ1≥λ03 eigenvalues λ0、λ1And λ2Respectively corresponding to the feature vectors v0,v1And v2(ii) a Setting a judgment condition:

λ2>0&&(λ20)/(λ02)<0.75

when the above conditions are satisfied, the eigenvector v corresponding to the minimum eigenvalue is taken0As a point piInitial normal vector ofOtherwise, n0 iIs set to the invalid normal.

Further, the invalid normal is replaced by the normal information of the neighborhood points in the step 3, and the normal directions of all the neighborhood points are consistent by adopting a minimum spanning tree algorithm, which specifically includes:

traversing the point cloud P, replacing the invalid normal direction by the normalized neighborhood point normal weighted average value for the invalid normal direction, ensuring that each point in the point cloud P has a stable valid normal vector,

constructing a minimum spanning tree of the P point cloud by using Prim algorithm, wherein the angle weight between the normal directions of all points isThe specific mode is as follows:

step 3-1: sequentially solving the weights of j other points and root nodes in the neighborhood by taking any point in the point cloud P as the root node of the tree, calculating to obtain a minimum weight, setting the minimum weight as f1, storing another point forming f1 in a set V, and storing f1 in a set E;

step 3-2: sequentially calculating the weights of the (j-1) points remaining in the neighborhood and each point in the set V, calculating to obtain a minimum weight, setting the minimum weight as fn, storing the other point forming fn in the set V, and storing fn in the set E; wherein n is 2, 3, 4, 5 … … j;

step 3-3: repeating the step 3-2 until no residual points exist in the neighborhood, wherein the set E is the set of the neighborhood minimum spanning tree weight;

step 3-4: starting from a root node of the minimum spanning tree, gradually transmitting a normal vector normal to each leaf node of the tree, wherein the specific transmission mode is as follows:

wherein n isiNormal vector, n, representing parent node in neighborhoodi+1And if the sum of the dot product of the two vectors is less than zero, the normal vector direction of the child node is reversed.

The invention has the beneficial effects that:

1. the invention discloses a high-precision point cloud normal calculation method, and firstly provides a mechanism for respectively calculating and fusing normal by adopting multi-scale information. The nearest neighbor number, namely the unstable influence caused by the selection of the parameter K, is effectively avoided, the influence of noise is inhibited, the details are better kept at the boundary part, and the problem of normal calculation of cloud data with noise points is effectively solved.

2. The invention uses the anisotropic principal component analysis method, namely, the distance and the normal direction are weighted simultaneously in the calculation process of the covariance matrix, and the result is more accurate.

3. The invention realizes the normal direction correction by using the minimum spanning tree structure.

4. Compatible with TBB (IntelA parallel programming development tool developed by a company) and the like, and the parallel acceleration is performed by using the parallel programming development tool, so that the operation process is accelerated, and the working time is effectively saved.

Drawings

FIG. 1 is a flow chart of the operation of the normal calculation method of high-precision point cloud of the present invention;

FIG. 2 is a diagram of a stanford bunny point cloud model used in the experiment of the present invention;

FIG. 3 is one of the rabbit model normal vector effect graphs after one iteration;

FIG. 4 is a second exemplary rabbit model normal vector effect graph;

FIG. 5 is one of the rabbit model normal vector effect graphs for three iterations;

FIG. 6 is a second rabbit model normal vector effect graph after three iterations;

FIG. 7 is a diagram of a rabbit curved surface three-dimensional point cloud model;

FIG. 8 is a diagram of a rabbit model before normal correction;

FIG. 9 is a diagram of a rabbit model after normal correction.

Detailed Description

As used in this specification and the appended claims, certain terms are used to refer to particular components, and it will be appreciated by those skilled in the art that a manufacturer may refer to a component by different names. This specification and claims do not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to. "substantially" means within an acceptable error range, and a person skilled in the art can solve the technical problem within a certain error range to substantially achieve the technical effect.

The present invention will be described in further detail with reference to the following drawings and specific examples, but the present invention is not limited thereto.

Referring to fig. 1, fig. 1 is a flowchart illustrating an operation of a high-precision point cloud normal calculation method according to the present invention.

Step 1: a depth camera or a three-dimensional laser scanner is adopted to scan a real object, a point cloud model with estimation is input, and point cloud data are read; and setting a path for reading and storing a file, wherein the project is realized by adopting C + + language, and Kd tree and matrix calculation are directly accessed into C + +.

Step 2: setting a three-dimensional point cloud containing N points as P, and recording the ith point in the three-dimensional point cloud as Pi(xi,yi,zi) Determining P in spatial neighborhoodi3 dimensions k of1,k2,k3Traversing the point cloud for adjacent points, and determining an initial normal vector corresponding to each scale of all the points in the three-dimensional point cloud P, wherein x isi,yi,ziAre respectively a point PiX, Y and Z coordinate values of;

setting three neighborhood sizes k of points as 15, 30 and 45, and distance weight as sigmadThe sum normal weight is sigman

And step 3: the nearest neighbors are quickly retrieved using the Kd tree.

And 4, step 4: solving a covariance matrix according to all the points in the neighborhood

Can be developed as follows:

multiplying the weight by the matrix M to obtain a weighted matrix, wherein the weight is as follows:

spatial weightingr=||pi-p||,

r is the Euclidean distance from other points in the neighborhood to the central point.

And 5: solving the eigenvector and the eigenvalue of the covariance matrix, and obtaining an initial normal vector estimation result of the point according to the eigenvector corresponding to the minimum eigenvalue; and determining whether the normal vector is valid or not by using a judgment condition.

Step 6: and traversing each point of the point cloud, using neighborhood normal weighting substitution for invalid normal vectors, and using a minimum spanning tree algorithm to enable all normal directions to be consistent.

And 7: traversing each point of the point cloud, and solving a final normal direction of the point cloud according to the operation of the step 4;

the point cloud model of stanford bunny used in the experiment is shown in fig. 2, the rabbit model method vector estimation after one iteration is shown in fig. 3 and 4, and the normal vector estimation result of the rabbit model after 3 iterations is shown in fig. 5 and 6.

And 8: FIG. 5 and FIG. 6 show the case of inconsistent direction of point cloud normal estimation, firstly using geometric correction vector direction, taking the geometric center point of point cloud, and taking the direction vector d from the center point to a certain point of point cloudiAnd comparing the estimated normal vector and the direction vector of each point, if the included angle is more than 90 degrees, turning the normal vector of the point, and traversing each point of the point cloud to perform the operation.

And step 9: constructing a minimum spanning tree from each point of the point cloud, wherein the weight of the tree is w-1- | ni·ni′Establishing a neighborhood inner point normal vector orientation similarity adjacency relation, transmitting the normal vector direction of the root node to each child node, specifically, when the included angle between the child node and the parent node normal vector is more than 90 degrees, turning over the child node normal vector, traversing each point of the point cloud, and performing the operation on the neighborhood of each point;

when the normal correction effect is displayed, the curved surface three-dimensional point cloud model is used, the normal calculation method is shown in figure 7, the method before the normal correction is shown in figure 8, and the method after the normal correction is shown in figure 9.

Variations and modifications to the above-described embodiments may also occur to those skilled in the art, which fall within the scope of the invention as disclosed and taught herein. Therefore, the present invention is not limited to the above-mentioned embodiments, and any obvious improvement, replacement or modification made by those skilled in the art based on the present invention is within the protection scope of the present invention. Furthermore, although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:深度图生成方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!