Skip to main content

normal_estimate_def

Function normal_estimate_def 

Source
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: inline formula
  • Step:
    1. Calculate the inline formula of inline formula;
    2. A 3x3 covariance matrix inline formula is obtained by inline formula;
    3. Calculate the eigenvalues(inline formula) and corresponding eigenvectors(inline formula) of inline formula;
    4. inline formula is the normal of the specific point, inline formula is the curvature of the specific point;
  • 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