pub fn normal_estimate_def(
normals: &mut impl ToOutputArray,
curvatures: &mut impl ToOutputArray,
input_pts: &impl ToInputArray,
nn_idx: &impl ToInputArray,
) -> Result<()>Expand description
Estimate the normal and curvature of each point in point cloud from NN results.
Normal estimation by PCA:
- Input: Nearest neighbor points of a specific point:
- Step:
- Calculate the
of
;
- A 3x3 covariance matrix
is obtained by
;
- Calculate the eigenvalues(
) and corresponding eigenvectors(
) of
;
is the normal of the specific point,
is the curvature of the specific point;
- Calculate the
- Output: Normal and curvature of the specific point.
§Parameters
- normals:[out] Normal of each point, support vector
and Mat of size Nx3. - curvatures:[out] Curvature of each point, support vector
and Mat. - input_pts: Original point cloud, support vector
and Mat of size Nx3/3xN. - nn_idx: Index information of nearest neighbors of all points. The first nearest neighbor of
each point is itself. Support vector<vector
>, vector and Mat of size NxK. If the information in a row is [0, 2, 1, -5, -1, 4, 7 … negative number], it will use only non-negative indexes until it meets a negative number or bound of this row i.e. [0, 2, 1]. - max_neighbor_num: The maximum number of neighbors want to use including itself. Setting to a non-positive number or default will use the information from nn_idx.
§Note
This alternative version of normal_estimate function uses the following default values for its arguments:
- max_neighbor_num: 0