Disclosure of Invention
The invention aims to provide a curvature and neighborhood reconstruction based weighted guided point cloud model denoising method which is high in denoising precision, can keep model characteristics and has better robustness for noises of different degrees.
The technical solution for realizing the purpose of the invention is as follows: a curvature and neighborhood reconstruction-based weighted guide point cloud model denoising method comprises the following steps:
step 1, calculating curvature information of each point in a point cloud model, and extracting characteristic points in the model according to a set threshold value;
step 2, reconstructing neighborhood points on the basis of neighborhoods acquired by a K neighbor method according to the extracted feature points, and enabling the reconstructed neighborhoods to be on one surface;
step 3, according to the reconstructed neighborhood, using the three-dimensional position information of each point as a guide signal, and simultaneously adding curvature information as a weighting signal into the position guide signal, thereby performing linear transformation on each point in the point cloud model;
and 4, performing linear transformation on each point according to the linear transformation coefficient calculated in the step 3, and denoising the point cloud model.
Further, the curvature information of each point in the point cloud model is calculated in the step 1, and the feature points in the model are extracted according to a set threshold, specifically as follows:
step 1.1, for each point piCalculate that it corresponds to neighborhood NiCurvature value of (a) (N)i) Is composed of
Wherein λ is0、λ1、λ2Is NiOf the covariance matrix of, and λ0<λ1<λ2Reflect NiDistribution of three orthogonal singular vectors;
step 1.2, setting a threshold value t, wherein points with curvature values larger than the threshold value t are characteristic points, and points with curvature values smaller than the threshold value t are non-characteristic points.
Further, the step 2 reconstructs the neighborhood points on the basis of the neighborhood acquired by the K-nearest neighbor method according to the extracted feature points, and the reconstructed neighborhood is on one surface, which specifically includes the following steps:
step 2.1, using K nearest neighbor method to each feature point piIs given an initial valueNeighborhood N of (2);
step 2.2, for each neighborhood point p in the initial neighborhood N
ijObtaining the neighborhood point p by using the K nearest neighbor method
ijNeighborhood N of
ijWhile simultaneously applying the feature points p
iAt p
ijCandidate neighborhood of (c)
Initialised to contain only its own p
ijAnd a feature point p
iTwo points;
step 2.3, scan N
ijEach point in (1) determines whether the point can join the candidate neighborhood
In the method, the following judgment standard is constructed according to the curvature value of the current neighborhood and the position relation of the points:
wherein,
a standard value for measuring the curvature value of the current neighborhood and the position relation of the middle point of the neighborhood is expressed,
represents p
ijIn the neighborhood
Curvature value of the lower, K representing the neighborhood
The number of all the points, alpha and beta, are the user-defined control coefficients; p is a radical of
ijkRepresenting a neighborhood
K-th point in (1), 2, …, K representing the neighborhood
The total number of midpoints;
step 2.4, if the addition of this point is made in formula (2)
Is decreased, it represents that the point can join the candidate neighborhood
And 5 points nearest to the point are also added into the candidate neighborhood
Performing the following steps;
step 2.5, obtaining a characteristic point p for the rest points in the N
iThe candidate neighborhoods within, for each candidate neighborhood, are calculated according to equation (2)
Wherein the neighborhood corresponding to the minimum value is the feature point p
iReconstructed neighborhood N'.
Further, according to the reconstructed neighborhood, the three-dimensional position information of each point is used as a guide signal, and the curvature information is used as a weighting signal and added to the position guide signal, so that each point in the point cloud model is linearly transformed, which specifically comprises the following steps:
the cost function E of the weighted guided filtering algorithm is:
γ(i)=(σ-t)s(i)+χ (4)
s(i)=-sgn(σ-t)×μ×σ (5)
wherein, N (p)
i) Indicates the current point p
iNeighborhood of p
ijIs a point in the neighborhood, a
iAnd b
iFor linear transformation coefficients to be solved, ε is the control filter effectParameters of the fruit; sigma is a curvature value of a point calculated before neighborhood reconstruction, and t is a threshold value for judging a characteristic point; χ is a positive number for preventing the weight γ (i) from being 0; mu is a magnification factor of
And (4) dynamically determining.
Further, in step 4, each point is linearly transformed according to the linear transformation coefficient calculated in step 3, so as to implement point cloud model denoising, specifically as follows:
step 4.1, coefficient a of linear transformation obtained in step 3i、biComprises the following steps:
wherein:
wherein, | N (p)
i) I represents a point p
iP, the number of points contained in the neighborhood of
ijIs p
iNeighborhood of N (p)
i) At one point of the inner side of the body,
is the central point of the neighborhood, and epsilon is a parameter for controlling the filtering effect;
step 4.2, according to the obtained linear transformation coefficient aiAnd biAnd performing linear transformation on each characteristic point to obtain the position of the denoised point, and obtaining the denoised point cloud model after all the points are updated.
Compared with the prior art, the invention has the following remarkable advantages: (1) the input is simple, only the position information of the point cloud model point is needed to be input, and the initial normal estimation is not needed to be relied on; (2) curvature information is introduced as a weighting signal, and a characteristic region and a flat region of the model are processed separately, so that the sharp characteristic of the model is better reserved; (3) by reconstructing the neighborhood of the characteristic point, each point obtains a relatively smooth and consistent neighborhood, so that the method has robustness to noises with different degrees.
Detailed Description
The invention relates to a curvature and neighborhood reconstruction-based weighted guide point cloud model denoising method, which comprises the following steps:
step 1, calculating curvature information of each point in a point cloud model, and extracting characteristic points in the model according to a set threshold value;
step 2, reconstructing neighborhood points on the basis of neighborhoods acquired by a K neighbor method according to the extracted feature points, and enabling the reconstructed neighborhoods to be on one surface;
step 3, according to the reconstructed neighborhood, using the three-dimensional position information of each point as a guide signal, and simultaneously adding curvature information as a weighting signal into the position guide signal, thereby performing linear transformation on each point in the point cloud model;
and 4, performing linear transformation on each point according to the linear transformation coefficient calculated in the step 3, and denoising the point cloud model.
As a specific example, the curvature information of each point in the point cloud model is calculated in step 1, and the feature points in the model are extracted according to a set threshold, specifically as follows:
step 1.1, for each point piCalculate that it corresponds to neighborhood NiCurvature value of (a) (N)i) Is composed of
Wherein λ is0、λ1、λ2Is NiOf the covariance matrix of, and λ0<λ1<λ2Reflect NiDistribution of three orthogonal singular vectors;
step 1.2, setting a threshold value t, wherein points with curvature values larger than the threshold value t are characteristic points, and points with curvature values smaller than the threshold value t are non-characteristic points.
Further, the step 2 reconstructs the neighborhood points on the basis of the neighborhood acquired by the K-nearest neighbor method according to the extracted feature points, and the reconstructed neighborhood is on one surface, which specifically includes the following steps:
step 2.1, using K nearest neighbor method to each feature point piAssigning an initial neighborhood N;
step 2.2, for each neighborhood point p in the initial neighborhood N
ijObtaining the neighborhood point p by using the K nearest neighbor method
ijNeighborhood N of
ijWhile simultaneously applying the feature points p
iAt p
ijCandidate neighborhood of (c)
Initialised to contain only its own p
ijAnd a feature point p
iTwo points;
step 2.3, scan N
ijEach point in (1) determines whether the point can join the candidate neighborhood
In the method, the following judgment standard is constructed according to the curvature value of the current neighborhood and the position relation of the points:
wherein,
a standard value for measuring the curvature value of the current neighborhood and the position relation of the middle point of the neighborhood is expressed,
represents p
ijIn the neighborhood
Curvature value of the lower, K representing the neighborhood
The number of all the points, alpha and beta, are the user-defined control coefficients; p is a radical of
ijkRepresenting a neighborhood
K-th point in (1), 2, …, K representing the neighborhood
The total number of midpoints;
step 2.4, if the addition of this point is made in formula (2)
Is decreased, it represents that the point can join the candidate neighborhood
And 5 points nearest to the point are also added into the candidate neighborhood
Performing the following steps;
step 2.5, obtaining a characteristic point p for the rest points in the N
iIn whichCandidate neighborhoods, each calculated according to equation (2)
Wherein the neighborhood corresponding to the minimum value is the feature point p
iReconstructed neighborhood N'.
As a specific example, according to the reconstructed neighborhood described in step 3, the three-dimensional position information of each point is used as a guiding signal, and the curvature information is added to the position guiding signal as a weighting signal, so as to perform linear transformation on each point in the point cloud model, which is specifically as follows:
the cost function E of the weighted guided filtering algorithm is:
γ(i)=(σ-t)s(i)+χ (4)
s(i)=-sgn(σ-t)×μ×σ (5)
wherein, N (p)
i) Indicates the current point p
iNeighborhood of p
ijIs a point in the neighborhood, a
iAnd b
iIs a linear transformation coefficient to be solved, and epsilon is a parameter for controlling the filtering effect; sigma is a curvature value of a point calculated before neighborhood reconstruction, and t is a threshold value for judging a characteristic point; χ is a positive number for preventing the weight γ (i) from being 0; mu is a magnification factor of
And (4) dynamically determining.
As a specific example, in step 4, each point is linearly transformed according to the linear transformation coefficient calculated in step 3, so as to implement point cloud model denoising, which is specifically as follows:
step 4.1, coefficient a of linear transformation obtained in step 3i、biComprises the following steps:
wherein:
wherein, | N (p)
i) I represents a point p
iP, the number of points contained in the neighborhood of
ijIs p
iNeighborhood of N (p)
i) At one point of the inner side of the body,
is the central point of the neighborhood, and epsilon is a parameter for controlling the filtering effect;
step 4.2, according to the obtained linear transformation coefficient aiAnd biAnd performing linear transformation on each characteristic point to obtain the position of the denoised point, and obtaining the denoised point cloud model after all the points are updated.
The invention is described in further detail below with reference to the figures and the embodiments.
Examples
With reference to fig. 1, the weighted guide point cloud model denoising method based on curvature and neighborhood reconstruction of the present invention includes the following steps:
step 1, calculating curvature information of each point in a point cloud model, and extracting characteristic points in the model according to a set threshold, wherein the curvature information comprises the following specific steps:
step 1.1, for each point piCalculate that it corresponds to neighborhood NiCurvature value of (a) (N)i) Comprises the following steps:
wherein λ is0、λ1、λ2Is NiOf the covariance matrix of, and λ0<λ1<λ2Reflect NiDistribution of three orthogonal singular vectors;
step 1.2, setting a threshold value t, wherein points with curvature values larger than the threshold value t are characteristic points, and points with curvature values smaller than the threshold value t are non-characteristic points.
Step 2, reconstructing neighborhood points on the basis of neighborhoods acquired by a K neighbor method according to the extracted feature points, and enabling the reconstructed neighborhoods to be on one surface, wherein the method is as follows by combining the graph 2:
step 2.1, using K nearest neighbor method to each feature point piAssigning an initial neighborhood N;
step 2.2, for each neighborhood point p in the initial neighborhood N
ijObtaining the neighborhood point p by using the K nearest neighbor method
ijNeighborhood N of
ijWhile simultaneously applying the feature points p
iAt p
ijCandidate neighborhood of (c)
Initialised to contain only its own p
ijAnd a feature point p
iTwo points;
step 2.3, scan N
ijEach point in (1) determines whether the point can join the candidate neighborhood
In the method, the following judgment standard is constructed according to the curvature value of the current neighborhood and the position relation of the points:
wherein,
a standard value for measuring the curvature value of the current neighborhood and the position relation of the middle point of the neighborhood is expressed,
represents p
ijIn the neighborhood
Curvature value of the lower, K representing the neighborhood
The number of all the points, alpha and beta, are the user-defined control coefficients; p is a radical of
ijkRepresenting a neighborhood
K-th point in (1), 2, …, K representing the neighborhood
The total number of midpoints;
step 2.4, if the addition of this point is made in formula (2)
Is decreased, it represents that the point can join the candidate neighborhood
And 5 points nearest to the point are also added into the candidate neighborhood
Performing the following steps;
step 2.5, obtaining a characteristic point p for the rest points in the N
iThe candidate neighborhoods within, for each candidate neighborhood, are calculated according to equation (2)
Wherein the neighborhood corresponding to the minimum value is the feature point p
iReconstructed neighborhood N'.
And 3, according to the reconstructed neighborhood, using the three-dimensional position information of each point as a guide signal, and simultaneously adding curvature information as a weighting signal into the position guide signal, so as to perform linear transformation on each point in the point cloud model, wherein the method specifically comprises the following steps in combination with the graph 3:
in the traditional guide filtering algorithm, because a unified linear model and the same regularization parameter are used for each part of a point cloud model, a characteristic region can be smoothed, and a weighted guide point cloud denoising method with curvature information fused is adopted. An effective guided filtering weight model needs to solve two problems: firstly, a point cloud model processing method by which the weight value is used can accurately identify a characteristic region of a model; secondly, in the feature region, a smaller smoothing multiple should be superposed, namely the final regular term should be smaller, and the weight at the denominator should be larger; in the flat region of the model, a slightly larger smoothing factor should be superimposed, i.e. the final regularization term should be slightly larger, then the weight at the denominator should be smaller. In the field of point cloud processing, most of the characteristic points of the point cloud can be extracted by calculating the curvature information of each point.
In addition, the ideal weight model requires that the weight is smaller in the flat region of the model and larger in the feature region. Because the change rule of the weight is similar to the change rule of the exponential function, the curvature information of the point can be used as a base number, and the curvature information of the point is amplified or suppressed through the weight model based on the exponential function. In order to obtain a characteristic region of the model, a characteristic point curvature threshold value t is set, when the curvature value of a certain point is greater than t, the point is considered as a characteristic point, and otherwise, the point is considered as a non-characteristic point. In order to enable the curvature information to be more reasonably applied, a constraint factor s (i) is introduced into the weight gamma (i) to be used as an index item of a weight model, the constraint factor can set a constraint boundary for the weight, so that different weighting behaviors to be taken by different regions can be accurately decided, the characteristic regions are sensitive to the characteristic information, and the information at characteristic points is amplified; when the method is used for a flat area, the method is insensitive to the characteristic information, and the characteristic information is restrained from growing, so that the aim of retaining the characteristic is fulfilled.
Based on the above analysis, the weight is defined as:
γ(i)=(σ-t)s(i)+χ
s(i)=-sgn(σ-t)×μ×σ
wherein σ is a curvature value of a point calculated before neighborhood reconstruction, t is a threshold value for judging a feature point, and μ is a magnification factor
Dynamically, α is a constant term that prevents γ (i) from being zero as the denominator.
Obviously, when a point belongs to a feature point, the s (i) sign is negative, and the curvature is larger, that is, the feature information is more remarkable, the weight is larger, and the point is shown to be sensitive to the feature information; when the point does not belong to the feature point, the s (i) sign is positive, and the weight is very small at this time, which shows that the point is insensitive to the feature information.
And finally, rewriting the combination weight on the basis of guiding filtering, wherein the cost function is as follows:
wherein N (p)i) Indicates the current point piNeighborhood of pijIs a point in the neighborhood, aiAnd biAnd epsilon is a parameter for controlling the filtering effect for the linear transformation coefficient to be solved.
And 4, performing linear transformation on each point according to the linear transformation coefficient calculated in the step 3 to realize point cloud model denoising, which comprises the following specific steps:
step 4.1, the coefficients of the linear transformation obtained in step 3 are:
wherein:
wherein, | N (p)
i) I represents a point p
iP, the number of points contained in the neighborhood of
ijIs p
iNeighborhood of N (p)
i) At one point of the inner side of the body,
is the central point of the neighborhood, and epsilon is a parameter for controlling the filtering effect;
step 4.2, according to the obtained linear transformation coefficient aiAnd biAnd performing linear transformation on each characteristic point to obtain the position of the denoised point, and obtaining the denoised point cloud model after all the points are updated.
Fig. 4 is a diagram of denoising effect in the embodiment of the present invention, where fig. 4(a) is a schematic diagram of a point cloud model with noise as an input, and fig. 4(b) is a schematic diagram of a point cloud model after denoising as an output. Fig. 5 is a diagram of denoising effect in the embodiment of the present invention, where fig. 5(a) is a schematic diagram of a point cloud model with noise as an input, and fig. 5(b) is a schematic diagram of a point cloud model after denoising as an output. As can be seen from the graphs in FIGS. 4 and 5, the point cloud model denoising method based on curvature and neighborhood reconstruction is adopted to denoise the point cloud model, so that the sharp features of the model can be maintained while noise is removed, and the method can be widely applied to various models.