iLab Neuromorphic Robotics Toolkit  0.1
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 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] input The input point cloud
Returns
The centroid of the geometry
Template Parameters
 Field The field to compute a centroid for. Must support geometric operations such as += and /
Parameters
 [in] input The 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] input The input point cloud [in] subset The subset of points to use
Returns
The centroid of the geometry
Template Parameters
 Field The field to compute a centroid for. Must support geometric operations such as += and /
Parameters
 [in] input The input point cloud [in] subset The 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
 input The input point cloud normalize Whether 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
 input The input point cloud centroid The centroid for the input cloud normalize Whether 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
 input The input point cloud subset The subset to consider normalize Whether 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
 input The input point cloud subset The subset to consider centroid The centroid for the input cloud subset normalize Whether we should normalize the resulting matrix
Returns
The 3x3 covariance matrix
 std::pair 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
 input The input point cloud
Returns
The 3x3 normalized covariance matrix and the centroid
 std::pair 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
 input The input point cloud subset The 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] covariance The covariance matrix of the points to fit a plane to [in] point A point residing on the plane (such as the centroid used to compute the covariance) used to calculate the d plane parameter. [in,out] planeParameters The plane parameters for the plane equation: ax + by + cz + d = 0 (a,b,c,d) [in,out] variation The ratio of each eigenvalue over the sum of all eigenvalues [in,out] eigenVectors The 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
 Field The field type to search
Parameters
 [in] input The point cloud [out] min The minimum values for the feature [out] max The maximum values for the feature

Definition at line 41 of file MinMaxImpl.H.

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