Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
PointMatcher< T >::DataPoints Struct Reference

A point cloud. More...

#include <PointMatcher.h>

List of all members.

Classes

struct  InvalidField
 An exception thrown when one tries to access features or descriptors unexisting or of wrong dimensions. More...
struct  Label
 The name for a certain number of dim. More...
struct  Labels
 A vector of Label. More...

Public Types

typedef const Eigen::Block
< const Matrix
ConstView
 A view on a const feature or const descriptor.
typedef Matrix::Index Index
 An index to a row or a column.
typedef Eigen::Block< MatrixView
 A view on a feature or descriptor.

Public Member Functions

void addDescriptor (const std::string &name, const Matrix &newDescriptor)
 Add a descriptor by name, remove first if already exists.
void addFeature (const std::string &name, const Matrix &newFeature)
 Add a feature by name, remove first if already exists.
void allocateDescriptor (const std::string &name, const unsigned dim)
 Makes sure a descriptor of a given name exists, if present, check its dimensions.
void allocateDescriptors (const Labels &newLabels)
 Make sure a vector of descriptors of given names exist.
void allocateFeature (const std::string &name, const unsigned dim)
 Makes sure a feature of a given name exists, if present, check its dimensions.
void allocateFeatures (const Labels &newLabels)
 Make sure a vector of features of given names exist.
void assertDescriptorConsistency () const
 Assert if descriptors are not consistent with features.
void concatenate (const DataPoints &dp)
 Add an other point cloud after the current one.
void conservativeResize (Index pointCount)
 Resize the cloud to pointCount points, conserving existing ones.
DataPoints createSimilarEmpty () const
 Create an empty DataPoints of similar dimensions and labels, both for features and descriptors.
DataPoints createSimilarEmpty (Index pointCount) const
 Create an empty DataPoints with pointCount points of similar dimensions and labels, both for features and descriptors.
 DataPoints ()
 Construct an empty point cloud.
 DataPoints (const Labels &featureLabels, const Labels &descriptorLabels, const size_t pointCount)
 Construct a point cloud from existing descriptions.
 DataPoints (const Matrix &features, const Labels &featureLabels)
 Construct a point cloud from existing features without any descriptor.
 DataPoints (const Matrix &features, const Labels &featureLabels, const Matrix &descriptors, const Labels &descriptorLabels)
 Construct a point cloud from existing features and descriptors.
bool descriptorExists (const std::string &name) const
 Look if a descriptor with a given name exist.
bool descriptorExists (const std::string &name, const unsigned dim) const
 Look if a descriptor with a given name and dimension exist.
bool featureExists (const std::string &name) const
 Look if a feature with a given name exist.
bool featureExists (const std::string &name, const unsigned dim) const
 Look if a feature with a given name and dimension exist.
Matrix getDescriptorCopyByName (const std::string &name) const
 Get descriptor by name, return a matrix containing a copy of the requested descriptor.
unsigned getDescriptorDimension (const std::string &name) const
 Return the dimension of a descriptor with a given name. Return 0 if the name is not found.
ConstView getDescriptorRowViewByName (const std::string &name, const unsigned row) const
 Get a const view on a descriptor row by name and number, throw an exception if it does not exist.
View getDescriptorRowViewByName (const std::string &name, const unsigned row)
 Get a view on a descriptor by row name and number, throw an exception if it does not exist.
unsigned getDescriptorStartingRow (const std::string &name) const
 Return the starting row of a descriptor with a given name. Return 0 if the name is not found.
ConstView getDescriptorViewByName (const std::string &name) const
 Get a const view on a descriptor by name, throw an exception if it does not exist.
View getDescriptorViewByName (const std::string &name)
 Get a view on a descriptor by name, throw an exception if it does not exist.
Matrix getFeatureCopyByName (const std::string &name) const
 Get feature by name, return a matrix containing a copy of the requested feature.
unsigned getFeatureDimension (const std::string &name) const
 Return the dimension of a feature with a given name. Return 0 if the name is not found.
ConstView getFeatureRowViewByName (const std::string &name, const unsigned row) const
 Get a const view on a feature row by name and number, throw an exception if it does not exist.
View getFeatureRowViewByName (const std::string &name, const unsigned row)
 Get a view on a feature by row name and number, throw an exception if it does not exist.
unsigned getFeatureStartingRow (const std::string &name) const
 Return the starting row of a feature with a given name. Return 0 if the name is not found.
ConstView getFeatureViewByName (const std::string &name) const
 Get a const view on a feature by name, throw an exception if it does not exist.
View getFeatureViewByName (const std::string &name)
 Get a view on a feature by name, throw an exception if it does not exist.
bool operator== (const DataPoints &that) const
 Return whether two point-clouds are identical (same data and same labels)
void save (const std::string &fileName) const
 Save a point cloud to a file, determine format from extension.
void setColFrom (Index thisCol, const DataPoints &that, Index thatCol)
 Set column thisCol equal to column thatCol of that, copy features and descriptors if any. Assumes sizes are similar.

Static Public Member Functions

static DataPoints load (const std::string &fileName)
 Load a point cloud from a file, determine format from extension.

Public Attributes

Labels descriptorLabels
 labels of descriptors
Matrix descriptors
 descriptors of points in the cloud, might be empty
Labels featureLabels
 labels of features
Matrix features
 features of points in the cloud

Private Member Functions

void addField (const std::string &name, const Matrix &newField, Labels &labels, Matrix &data) const
 Add a descriptor or feature by name, remove first if already exists.
void allocateField (const std::string &name, const unsigned dim, Labels &labels, Matrix &data) const
 Make sure a field of a given name exists, if present, check its dimensions.
void allocateFields (const Labels &newLabels, Labels &labels, Matrix &data) const
 Make sure a vector of fields of given names exist.
bool fieldExists (const std::string &name, const unsigned dim, const Labels &labels) const
 Look if a descriptor or a feature with a given name and dimension exist.
ConstView getConstViewByName (const std::string &name, const Labels &labels, const Matrix &data, const int viewRow=-1) const
unsigned getFieldDimension (const std::string &name, const Labels &labels) const
 Return the dimension of a feature or a descriptor with a given name. Return 0 if the name is not found.
unsigned getFieldStartingRow (const std::string &name, const Labels &labels) const
 Return the starting row of a feature or a descriptor with a given name. Return 0 if the name is not found.
View getViewByName (const std::string &name, const Labels &labels, Matrix &data, const int viewRow=-1) const

Detailed Description

template<typename T>
struct PointMatcher< T >::DataPoints

A point cloud.

For every point, it has features and, optionally, descriptors. Features are typically the coordinates of the point in the space. Descriptors contain information attached to the point, such as its color, its normal vector, etc. In both features and descriptors, every point can have multiple channels. Every channel has a dimension and a name. For instance, a typical 3D cloud might have the channels x, y, z, w of dimension 1 as features (using homogeneous coordinates), and the channel normal of size 3 as descriptor. There are no sub-channels, such as normal.x, for the sake of simplicity. Moreover, the position of the points is in homogeneous coordinates because they need both translation and rotation, while the normals need only rotation. All channels contain scalar values of type ScalarType.

Definition at line 201 of file PointMatcher.h.


Member Typedef Documentation

template<typename T>
typedef const Eigen::Block<const Matrix> PointMatcher< T >::DataPoints::ConstView

A view on a const feature or const descriptor.

Definition at line 206 of file PointMatcher.h.

template<typename T>
typedef Matrix::Index PointMatcher< T >::DataPoints::Index

An index to a row or a column.

Definition at line 208 of file PointMatcher.h.

template<typename T>
typedef Eigen::Block<Matrix> PointMatcher< T >::DataPoints::View

A view on a feature or descriptor.

Definition at line 204 of file PointMatcher.h.


Constructor & Destructor Documentation

template<typename T >
PointMatcher< T >::DataPoints::DataPoints ( )

Construct an empty point cloud.

Definition at line 97 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::DataPoints ( const Labels featureLabels,
const Labels descriptorLabels,
const size_t  pointCount 
)

Construct a point cloud from existing descriptions.

Definition at line 102 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::DataPoints ( const Matrix features,
const Labels featureLabels 
)

Construct a point cloud from existing features without any descriptor.

Definition at line 113 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::DataPoints ( const Matrix features,
const Labels featureLabels,
const Matrix descriptors,
const Labels descriptorLabels 
)

Construct a point cloud from existing features and descriptors.

Definition at line 120 of file DataPoints.cpp.


Member Function Documentation

template<typename T >
void PointMatcher< T >::DataPoints::addDescriptor ( const std::string &  name,
const Matrix newDescriptor 
)

Add a descriptor by name, remove first if already exists.

Definition at line 383 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::addFeature ( const std::string &  name,
const Matrix newFeature 
)

Add a feature by name, remove first if already exists.

Definition at line 299 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::addField ( const std::string &  name,
const Matrix newField,
Labels labels,
Matrix data 
) const [private]

Add a descriptor or feature by name, remove first if already exists.

Definition at line 549 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::allocateDescriptor ( const std::string &  name,
const unsigned  dim 
)

Makes sure a descriptor of a given name exists, if present, check its dimensions.

Definition at line 369 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::allocateDescriptors ( const Labels newLabels)

Make sure a vector of descriptors of given names exist.

Definition at line 376 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::allocateFeature ( const std::string &  name,
const unsigned  dim 
)

Makes sure a feature of a given name exists, if present, check its dimensions.

Definition at line 285 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::allocateFeatures ( const Labels newLabels)

Make sure a vector of features of given names exist.

Definition at line 292 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::allocateField ( const std::string &  name,
const unsigned  dim,
Labels labels,
Matrix data 
) const [private]

Make sure a field of a given name exists, if present, check its dimensions.

Definition at line 484 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::allocateFields ( const Labels newLabels,
Labels labels,
Matrix data 
) const [private]

Make sure a vector of fields of given names exist.

Definition at line 508 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::assertDescriptorConsistency ( ) const

Assert if descriptors are not consistent with features.

Definition at line 453 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::concatenate ( const DataPoints dp)

Add an other point cloud after the current one.

Definition at line 140 of file DataPoints.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::conservativeResize ( Index  pointCount)

Resize the cloud to pointCount points, conserving existing ones.

Definition at line 223 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints PointMatcher< T >::DataPoints::createSimilarEmpty ( ) const

Create an empty DataPoints of similar dimensions and labels, both for features and descriptors.

Definition at line 232 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints PointMatcher< T >::DataPoints::createSimilarEmpty ( Index  pointCount) const

Create an empty DataPoints with pointCount points of similar dimensions and labels, both for features and descriptors.

Definition at line 254 of file DataPoints.cpp.

template<typename T >
bool PointMatcher< T >::DataPoints::descriptorExists ( const std::string &  name) const

Look if a descriptor with a given name exist.

Definition at line 425 of file DataPoints.cpp.

template<typename T >
bool PointMatcher< T >::DataPoints::descriptorExists ( const std::string &  name,
const unsigned  dim 
) const

Look if a descriptor with a given name and dimension exist.

Definition at line 432 of file DataPoints.cpp.

template<typename T >
bool PointMatcher< T >::DataPoints::featureExists ( const std::string &  name) const

Look if a feature with a given name exist.

Definition at line 341 of file DataPoints.cpp.

template<typename T >
bool PointMatcher< T >::DataPoints::featureExists ( const std::string &  name,
const unsigned  dim 
) const

Look if a feature with a given name and dimension exist.

Definition at line 348 of file DataPoints.cpp.

template<typename T >
bool PointMatcher< T >::DataPoints::fieldExists ( const std::string &  name,
const unsigned  dim,
const Labels labels 
) const [private]

Look if a descriptor or a feature with a given name and dimension exist.

Definition at line 658 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::ConstView PointMatcher< T >::DataPoints::getConstViewByName ( const std::string &  name,
const Labels labels,
const Matrix data,
const int  viewRow = -1 
) const [private]

Get a const view on a matrix by name, throw an exception if it does not exist. If viewRow is given, only return this row, otherwise return the full view

Definition at line 607 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::Matrix PointMatcher< T >::DataPoints::getDescriptorCopyByName ( const std::string &  name) const

Get descriptor by name, return a matrix containing a copy of the requested descriptor.

Definition at line 390 of file DataPoints.cpp.

template<typename T >
unsigned PointMatcher< T >::DataPoints::getDescriptorDimension ( const std::string &  name) const

Return the dimension of a descriptor with a given name. Return 0 if the name is not found.

Definition at line 439 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::ConstView PointMatcher< T >::DataPoints::getDescriptorRowViewByName ( const std::string &  name,
const unsigned  row 
) const

Get a const view on a descriptor row by name and number, throw an exception if it does not exist.

Definition at line 411 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::View PointMatcher< T >::DataPoints::getDescriptorRowViewByName ( const std::string &  name,
const unsigned  row 
)

Get a view on a descriptor by row name and number, throw an exception if it does not exist.

Definition at line 418 of file DataPoints.cpp.

template<typename T >
unsigned PointMatcher< T >::DataPoints::getDescriptorStartingRow ( const std::string &  name) const

Return the starting row of a descriptor with a given name. Return 0 if the name is not found.

Definition at line 446 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::ConstView PointMatcher< T >::DataPoints::getDescriptorViewByName ( const std::string &  name) const

Get a const view on a descriptor by name, throw an exception if it does not exist.

Definition at line 397 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::View PointMatcher< T >::DataPoints::getDescriptorViewByName ( const std::string &  name)

Get a view on a descriptor by name, throw an exception if it does not exist.

Definition at line 404 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::Matrix PointMatcher< T >::DataPoints::getFeatureCopyByName ( const std::string &  name) const

Get feature by name, return a matrix containing a copy of the requested feature.

Definition at line 306 of file DataPoints.cpp.

template<typename T >
unsigned PointMatcher< T >::DataPoints::getFeatureDimension ( const std::string &  name) const

Return the dimension of a feature with a given name. Return 0 if the name is not found.

Definition at line 355 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::ConstView PointMatcher< T >::DataPoints::getFeatureRowViewByName ( const std::string &  name,
const unsigned  row 
) const

Get a const view on a feature row by name and number, throw an exception if it does not exist.

Definition at line 327 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::View PointMatcher< T >::DataPoints::getFeatureRowViewByName ( const std::string &  name,
const unsigned  row 
)

Get a view on a feature by row name and number, throw an exception if it does not exist.

Definition at line 334 of file DataPoints.cpp.

template<typename T >
unsigned PointMatcher< T >::DataPoints::getFeatureStartingRow ( const std::string &  name) const

Return the starting row of a feature with a given name. Return 0 if the name is not found.

Definition at line 362 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::ConstView PointMatcher< T >::DataPoints::getFeatureViewByName ( const std::string &  name) const

Get a const view on a feature by name, throw an exception if it does not exist.

Definition at line 313 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::View PointMatcher< T >::DataPoints::getFeatureViewByName ( const std::string &  name)

Get a view on a feature by name, throw an exception if it does not exist.

Definition at line 320 of file DataPoints.cpp.

template<typename T >
unsigned PointMatcher< T >::DataPoints::getFieldDimension ( const std::string &  name,
const Labels labels 
) const [private]

Return the dimension of a feature or a descriptor with a given name. Return 0 if the name is not found.

Definition at line 676 of file DataPoints.cpp.

template<typename T >
unsigned PointMatcher< T >::DataPoints::getFieldStartingRow ( const std::string &  name,
const Labels labels 
) const [private]

Return the starting row of a feature or a descriptor with a given name. Return 0 if the name is not found.

Definition at line 689 of file DataPoints.cpp.

template<typename T >
PointMatcher< T >::DataPoints::View PointMatcher< T >::DataPoints::getViewByName ( const std::string &  name,
const Labels labels,
Matrix data,
const int  viewRow = -1 
) const [private]

Get a view on a matrix by name, throw an exception if it does not exist If viewRow is given, only return this row, otherwise return the full view

Definition at line 633 of file DataPoints.cpp.

template<typename T >
template PointMatcher< double >::DataPoints PointMatcher< T >::DataPoints::load ( const std::string &  fileName) [static]

Load a point cloud from a file, determine format from extension.

Definition at line 360 of file IO.cpp.

template<typename T >
bool PointMatcher< T >::DataPoints::operator== ( const DataPoints that) const

Return whether two point-clouds are identical (same data and same labels)

Definition at line 129 of file DataPoints.cpp.

template<typename T >
template void PointMatcher< T >::DataPoints::save ( const std::string &  fileName) const

Save a point cloud to a file, determine format from extension.

Definition at line 593 of file IO.cpp.

template<typename T >
void PointMatcher< T >::DataPoints::setColFrom ( Index  thisCol,
const DataPoints that,
Index  thatCol 
)

Set column thisCol equal to column thatCol of that, copy features and descriptors if any. Assumes sizes are similar.

Definition at line 275 of file DataPoints.cpp.


Member Data Documentation

template<typename T>
Labels PointMatcher< T >::DataPoints::descriptorLabels

labels of descriptors

Definition at line 279 of file PointMatcher.h.

template<typename T>
Matrix PointMatcher< T >::DataPoints::descriptors

descriptors of points in the cloud, might be empty

Definition at line 278 of file PointMatcher.h.

template<typename T>
Labels PointMatcher< T >::DataPoints::featureLabels

labels of features

Definition at line 277 of file PointMatcher.h.

template<typename T>
Matrix PointMatcher< T >::DataPoints::features

features of points in the cloud

Definition at line 276 of file PointMatcher.h.


The documentation for this struct was generated from the following files:


libpointmatcher
Author(s): Stéphane Magnenat, François Pomerleau
autogenerated on Thu Jan 2 2014 11:16:06