RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
Compute Structural Complexity of a Point Cloud with Normals

Computes the complexity of surface normals in a point cloud using PCA. More...

Functions

float RTABMAP_CORE_EXPORT rtabmap::util3d::computeNormalsComplexity (const LaserScan &scan, const Transform &t=Transform::getIdentity(), cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type LaserScan.
 
float RTABMAP_CORE_EXPORT rtabmap::util3d::computeNormalsComplexity (const pcl::PointCloud< pcl::Normal > &normals, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::Normal.
 
float RTABMAP_CORE_EXPORT rtabmap::util3d::computeNormalsComplexity (const pcl::PointCloud< pcl::PointNormal > &cloud, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::PointNormal.
 
float RTABMAP_CORE_EXPORT rtabmap::util3d::computeNormalsComplexity (const pcl::PointCloud< pcl::PointXYZINormal > &cloud, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::PointXYZINormal.
 
float RTABMAP_CORE_EXPORT rtabmap::util3d::computeNormalsComplexity (const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloud, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::PointXYZRGBNormal.
 

Detailed Description

Computes the complexity of surface normals in a point cloud using PCA.

This function performs a Principal Component Analysis (PCA) on the normals of a point cloud and returns a scalar measure of their spread (complexity). A low value indicates that normals are aligned (e.g., flat surface), while a high value indicates variation in orientation (e.g., curved or rough surface).

If a transformation is provided, the normals are rotated accordingly before PCA. The result is normalized to lie between 0 and 1, where 0 represents minimal complexity (the normals are confined to a lower-dimensional subspace, e.g. a flat surface) and 1 represents maximal complexity (the normal directions are isotropic).

Parameters
cloudThe input point cloud or laser scan containing normals (pcl::PointNormal), or simply normals.
tThe transform to apply to the normals (only the rotation is used).
is2dSet to true if the data is 2D (normals will be analyzed in 2D space).
pcaEigenVectors(Optional) Output matrix containing the eigenvectors computed by PCA.
pcaEigenValues(Optional) Output matrix containing the eigenvalues computed by PCA.
centeredWhen true (default), use covariance PCA (centered at mean). Use false for the uncentered second-moment matrix M = (1/N) sum(n_i * n_i^T), which measures span of normal directions and correctly identifies degeneracy even when there are only N (rather than N+1) distinct viewpoint-flipped normal directions in N-D space.
Returns
A float value between 0 and 1 representing the complexity of the normal distribution. Returns 0 if not enough valid normals are available.
Note
Invalid normals (containing NaN or Inf) are automatically filtered out. The result is the smallest eigenvalue (2nd in 2D, 3rd in 3D) scaled by the number of dimensions (2 or 3), so that it is normalized against the unit-norm normals.