iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::Normals Class Reference

#include <nrt/PointCloud2/Features/Normals.H>

A class for computing 3d point normals.

This class will compute 3d point normals for some point cloud and add them as PointNormals to the set of fields for that cloud.

Point normals are computed by solving for the plane parameters for a set of points around each point in the cloud or cloud subset. The normal of this plane fit to these points will describe the local surface normal of the points. A curvature estimate is also calculated, based upon the degree to which the local plane varies along the normal direction.

Examples:
tests/test-PointCloud2Normals.C, and tests/test-PointCloud2Registration.C.

Definition at line 55 of file Normals.H.

Inheritance diagram for nrt::Normals:
nrt::FeatureBase

Public Member Functions

 Normals (PointCloudSearchMethod method, double searchParam, bool twoPass=false, PointCloud2::Geometry const &viewPoint=PointCloud2::Geometry(), double searchEpsilon=0.0)
 Create a new Normals object.
 
virtual ~Normals ()
 Virtual destruction.
 
virtual PointCloud2 computeFeatures (PointCloud2 const input)
 Finds normals for all points in the input. More...
 
virtual PointCloud2 computeFeatures (PointCloud2 const input, Indices const subset)
 Finds normals for all points in the subset. More...
 
- Public Member Functions inherited from nrt::FeatureBase
 ~FeatureBase ()
 Virtual destruction.
 

Static Public Member Functions

static void computePointNormal (PointCloud2 const input, bool twoPass=false, Optional< PointCloud2::Vector4 & > planeParameters=OptionalEmpty, Optional< PointCloud2::Vector3 & > variation=OptionalEmpty, Optional< PointCloud2::Matrix3 & > eigenVectors=OptionalEmpty)
 Computes plane parameters and variation for an entire point cloud. More...
 
static void computePointNormal (PointCloud2 const input, Indices const subset, bool twoPass=false, Optional< PointCloud2::Vector4 & > planeParameters=OptionalEmpty, Optional< PointCloud2::Vector3 & > variation=OptionalEmpty, Optional< PointCloud2::Matrix3 & > eigenVectors=OptionalEmpty)
 Computes plane parameters and variation for a point cloud subset. More...
 
static void faceNormalToViewPoint (PointCloud2::Geometry const &point, PointCloud2::Geometry const &viewpoint, PointCloud2::Vector4 &normal)
 Adjusts a normal according to some viewpoint location. More...
 

Protected Member Functions

void computeFeaturesRadiusImpl (PointCloud2 const input, PointCloud2::Iterator< PointNormal > &&iter, PointCloud2::Iterator< PointNormal > &&end, Search &&search)
 Does the actual work for computing features with radius search.
 
void computeFeaturesKNNImpl (PointCloud2 const input, PointCloud2::Iterator< PointNormal > &&iter, PointCloud2::Iterator< PointNormal > &&end, Search &&search)
 Does the actual work for computing features with knn search.
 

Member Function Documentation

virtual PointCloud2 nrt::Normals::computeFeatures ( PointCloud2 const  input)
virtual

Finds normals for all points in the input.

This will add the field PointNormals to the output point cloud

Implements nrt::FeatureBase.

virtual PointCloud2 nrt::Normals::computeFeatures ( PointCloud2 const  input,
Indices const  subset 
)
virtual

Finds normals for all points in the subset.

This will add the field PointNormals to the output point cloud

Implements nrt::FeatureBase.

static void nrt::Normals::computePointNormal ( PointCloud2 const  input,
bool  twoPass = false,
Optional< PointCloud2::Vector4 & >  planeParameters = OptionalEmpty,
Optional< PointCloud2::Vector3 & >  variation = OptionalEmpty,
Optional< PointCloud2::Matrix3 & >  eigenVectors = OptionalEmpty 
)
static

Computes plane parameters and variation for an entire point cloud.

Parameters
[in]inputThe point cloud to use
[in]twoPassWhether to use the slower but more stable two pass covariance calculation, or the faster but less stable one pass version.
[in,out]planeParametersIf not empty, holds the plane parameters for ax + by + cz + d = 0 (abcd).
[in,out]variationIf not empty, stores the ratio of each eigenvalue over the sum of all eigenvalues.
[in,out]eigenVectorsIf not empty, stores the eigen vectors for the plane fit to the cloud
static void nrt::Normals::computePointNormal ( PointCloud2 const  input,
Indices const  subset,
bool  twoPass = false,
Optional< PointCloud2::Vector4 & >  planeParameters = OptionalEmpty,
Optional< PointCloud2::Vector3 & >  variation = OptionalEmpty,
Optional< PointCloud2::Matrix3 & >  eigenVectors = OptionalEmpty 
)
static

Computes plane parameters and variation for a point cloud subset.

Parameters
[in]inputThe point cloud to use
[in]subsetThe subset of points to consider
[in]twoPassWhether to use the slower but more stable two pass covariance calculation, or the faster but less stable one pass version.
[in,out]planeParametersIf not empty, holds the plane parameters for ax + by + cz + d = 0 (abcd).
[in,out]variationIf not empty, stores the ratio of each eigenvalue over the sum of all eigenvalues.
[in,out]eigenVectorsIf not empty, stores the eigen vectors for the plane fit to the subset
static void nrt::Normals::faceNormalToViewPoint ( PointCloud2::Geometry const &  point,
PointCloud2::Geometry const &  viewpoint,
PointCloud2::Vector4 normal 
)
static

Adjusts a normal according to some viewpoint location.

Parameters
[in]pointThe location of the normal
[in]viewpointThe viewing location from which to adjust the normal
[in,out]normalThe normal, which will be flipped such that it always faces towards the viewpoint

The documentation for this class was generated from the following file: