iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Common Operations and Functionality

This category includes operations that many different PointCloud algorithms may want access to as well as basic functionality that does not otherwise belong in a more detailed category.

Modules

 Correspondence Representation
 
 Geometric Transforms
 

Typedefs

typedef DynamicArray< std::size_t > nrt::Indices
 A way of describing a set of indices in a point cloud. More...
 

Functions

PointCloud2::Geometry nrt::computeCentroid (PointCloud2 const input)
 Computes a 3D centroid from the geometry in a point cloud. More...
 
PointCloud2::Geometry nrt::computeCentroid (PointCloud2 const input, Indices const subset)
 Computes a 3D centroid from the geometry in a point cloud subset. More...
 
PointCloud2::Matrix3 nrt::computeCovariance (PointCloud2 const input, bool normalize=false)
 Computes the covariance matrix for 3d geometry in a point cloud. More...
 
PointCloud2::Matrix3 nrt::computeCovariance (PointCloud2 const input, PointCloud2::Geometry const &centroid, bool normalize=false)
 Computes the covariance matrix for 3d geometry in a point cloud. More...
 
PointCloud2::Matrix3 nrt::computeCovariance (PointCloud2 const input, Indices const subset, bool normalize=false)
 Computes the covariance matrix for 3d geometry in a point cloud subset. More...
 
PointCloud2::Matrix3 nrt::computeCovariance (PointCloud2 const input, Indices const subset, PointCloud2::Geometry const &centroid, bool normalize=false)
 Computes the covariance matrix for 3d geometry in a point cloud subset. More...
 
std::pair
< PointCloud2::Matrix3,
PointCloud2::Geometry > 
nrt::computeCovarianceAndCentroid (PointCloud2 const input)
 Computes the normalized covariance and centroid in one step. More...
 
std::pair
< PointCloud2::Matrix3,
PointCloud2::Geometry > 
nrt::computeCovarianceAndCentroid (PointCloud2 const input, Indices const subset)
 Computes the normalized covariance and centroid in one step for a subset. More...
 
void nrt::solvePlaneParameters (PointCloud2::Matrix3 const &covariance, PointCloud2::Geometry const &point, Optional< PointCloud2::Vector4 & > planeParameters=OptionalEmpty, Optional< PointCloud2::Vector3 & > variation=OptionalEmpty, Optional< PointCloud2::Matrix3 & > eigenVectors=OptionalEmpty)
 
void nrt::computeMinMax (PointCloud2 const input, PointCloud2::Geometry &min, PointCloud2::Geometry &max)
 Computes the minimum and maximum values for point cloud geometry.
 
template<class Field >
void nrt::computeMinMax (PointCloud2 const input, Field &min, Field &max)
 Computes the minimum and maximum values for a specifc field type. More...
 

Typedef Documentation

typedef DynamicArray<std::size_t> nrt::Indices

A way of describing a set of indices in a point cloud.

Definition at line 45 of file Indices.H.

Function Documentation

Field nrt::computeCentroid ( PointCloud2 const  input)

Computes a 3D centroid from the geometry in a point cloud.

Computes the centroid for a specific field in a point cloud.

Parameters
[in]inputThe input point cloud
Returns
The centroid of the geometry
Template Parameters
FieldThe field to compute a centroid for. Must support geometric operations such as += and /
Parameters
[in]inputThe input point cloud
Returns
The centroid of the field
Examples:
tests/test-PointCloud2Common.C.
Field nrt::computeCentroid ( PointCloud2 const  input,
Indices const  subset 
)

Computes a 3D centroid from the geometry in a point cloud subset.

Computes the centroid for a specific field in a point cloud subset.

Parameters
[in]inputThe input point cloud
[in]subsetThe subset of points to use
Returns
The centroid of the geometry
Template Parameters
FieldThe field to compute a centroid for. Must support geometric operations such as += and /
Parameters
[in]inputThe input point cloud
[in]subsetThe subset
Returns
The centroid of the field
PointCloud2::Matrix3 nrt::computeCovariance ( PointCloud2 const  input,
bool  normalize = false 
)

Computes the covariance matrix for 3d geometry in a point cloud.

The cloud will be de-meaned as part of this function

Parameters
inputThe input point cloud
normalizeWhether we should normalize the resulting matrix
Returns
The 3x3 covariance matrix
Examples:
tests/test-PointCloud2Common.C.
PointCloud2::Matrix3 nrt::computeCovariance ( PointCloud2 const  input,
PointCloud2::Geometry const &  centroid,
bool  normalize = false 
)

Computes the covariance matrix for 3d geometry in a point cloud.

Parameters
inputThe input point cloud
centroidThe centroid for the input cloud
normalizeWhether we should normalize the resulting matrix
Returns
The 3x3 covariance matrix
PointCloud2::Matrix3 nrt::computeCovariance ( PointCloud2 const  input,
Indices const  subset,
bool  normalize = false 
)

Computes the covariance matrix for 3d geometry in a point cloud subset.

The cloud will be de-meaned as part of this function

Parameters
inputThe input point cloud
subsetThe subset to consider
normalizeWhether we should normalize the resulting matrix
Returns
The 3x3 covariance matrix
PointCloud2::Matrix3 nrt::computeCovariance ( PointCloud2 const  input,
Indices const  subset,
PointCloud2::Geometry const &  centroid,
bool  normalize = false 
)

Computes the covariance matrix for 3d geometry in a point cloud subset.

Parameters
inputThe input point cloud
subsetThe subset to consider
centroidThe centroid for the input cloud subset
normalizeWhether we should normalize the resulting matrix
Returns
The 3x3 covariance matrix
std::pair<PointCloud2::Matrix3, PointCloud2::Geometry> nrt::computeCovarianceAndCentroid ( PointCloud2 const  input)

Computes the normalized covariance and centroid in one step.

Uses a one pass variant that is less numerically stable than the two-pass versions used in the computeCovariance functions.

Parameters
inputThe input point cloud
Returns
The 3x3 normalized covariance matrix and the centroid
std::pair<PointCloud2::Matrix3, PointCloud2::Geometry> nrt::computeCovarianceAndCentroid ( PointCloud2 const  input,
Indices const  subset 
)

Computes the normalized covariance and centroid in one step for a subset.

Uses a one pass variant that is less numerically stable than the two-pass versions used in the computeCovariance functions.

Parameters
inputThe input point cloud
subsetThe subset to consider
Returns
The 3x3 normalized covariance matrix and the centroid
void nrt::solvePlaneParameters ( PointCloud2::Matrix3 const &  covariance,
PointCloud2::Geometry const &  point,
Optional< PointCloud2::Vector4 & >  planeParameters = OptionalEmpty,
Optional< PointCloud2::Vector3 & >  variation = OptionalEmpty,
Optional< PointCloud2::Matrix3 & >  eigenVectors = OptionalEmpty 
)

Estimates the least-squares plane normal and surface curvature from the eigenvalues and eigevectors of a covariance matrix derived from some set of points

This function can perform a variable amount of work depending on which information you require. The arguments wrapped in nrt::Optional will only be computed if not equal to nrt::OptionalEmpty.

Parameters
[in]covarianceThe covariance matrix of the points to fit a plane to
[in]pointA point residing on the plane (such as the centroid used to compute the covariance) used to calculate the d plane parameter.
[in,out]planeParametersThe plane parameters for the plane equation: ax + by + cz + d = 0 (a,b,c,d)
[in,out]variationThe ratio of each eigenvalue over the sum of all eigenvalues
[in,out]eigenVectorsThe eigenvectors for the covariance matrix
template<class Field >
void nrt::computeMinMax ( PointCloud2 const  input,
Field &  min,
Field &  max 
)

Computes the minimum and maximum values for a specifc field type.

Template Parameters
FieldThe field type to search
Parameters
[in]inputThe point cloud
[out]minThe minimum values for the feature
[out]maxThe maximum values for the feature

Definition at line 41 of file MinMaxImpl.H.

References nrt::PointCloud2::begin(), and nrt::PointCloud2::end().