libpointmatcher  1.3.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PointMatcher< T >::DataPoints Struct Reference

A point cloud. More...

#include <PointMatcher.h>

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 Eigen::Block< MatrixView
 A view on a feature or descriptor.
 
typedef Eigen::Block< Int64MatrixTimeView
 A view on a time.
 
typedef const Eigen::Block< const MatrixConstView
 A view on a const feature or const descriptor.
 
typedef const Eigen::Block< const Int64MatrixTimeConstView
 a view on a const time
 
typedef Matrix::Index Index
 An index to a row or a column.
 

Public Member Functions

 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 Labels &featureLabels, const Labels &descriptorLabels, const Labels &timeLabels, 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.
 
 DataPoints (const Matrix &features, const Labels &featureLabels, const Matrix &descriptors, const Labels &descriptorLabels, const Int64Matrix &times, const Labels &timeLabels)
 Construct a point cloud from existing features, descriptors and times.
 
bool operator== (const DataPoints &that) const
 Return whether two point-clouds are identical (same data and same labels)
 
unsigned getNbPoints () const
 Return the number of points contained in the point cloud.
 
unsigned getEuclideanDim () const
 Return the dimension of the point cloud.
 
unsigned getHomogeneousDim () const
 Return the dimension of the point cloud in homogeneous coordinates (one more than Euclidean dimension)
 
unsigned getNbGroupedDescriptors () const
 Return the number of grouped descriptors (e.g., normals can have 3 components but would count as only one)
 
unsigned getDescriptorDim () const
 Return the total number of descriptors.
 
unsigned getTimeDim () const
 Return the total number of times.
 
void save (const std::string &fileName, bool binary=false) const
 Save a point cloud to a file, determine format from extension.
 
void concatenate (const DataPoints &dp)
 Add another point cloud after the current one. Faster merge will be achieved if all descriptor and time labels are the same. If not, only the commun labels with be kept.
 
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 for features, descriptors and times.
 
DataPoints createSimilarEmpty (Index pointCount) const
 Create an empty DataPoints with pointCount points of similar dimensions and labels, both for features and descriptors.
 
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.
 
void swapCols (Index iCol, Index jCol)
 Swap column i and j in the point cloud, swap also features and descriptors if any. Assumes sizes are similar.
 
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 addFeature (const std::string &name, const Matrix &newFeature)
 Add a feature by name, remove first if already exists. The 'pad' field will stay at the end for homogeneous transformation.
 
void removeFeature (const std::string &name)
 Remove a feature by name, the whole matrix will be copied.
 
Matrix getFeatureCopyByName (const std::string &name) const
 Get feature by name, return a matrix containing a copy of the requested feature.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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 addDescriptor (const std::string &name, const Matrix &newDescriptor)
 Add a descriptor by name, remove first if already exists.
 
void removeDescriptor (const std::string &name)
 Remove a descriptor by name, the whole matrix will be copied.
 
Matrix getDescriptorCopyByName (const std::string &name) const
 Get descriptor by name, return a matrix containing a copy of the requested descriptor.
 
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.
 
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.
 
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.
 
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.
 
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.
 
void assertDescriptorConsistency () const
 Assert if descriptors are not consistent with features.
 
void allocateTime (const std::string &name, const unsigned dim)
 Makes sure a time of a given name exists, if present, check its dimensions.
 
void allocateTimes (const Labels &newLabels)
 Make sure a vector of time of given names exist.
 
void addTime (const std::string &name, const Int64Matrix &newTime)
 Add a time by name, remove first if already exists.
 
void removeTime (const std::string &name)
 Remove a descriptor by name, the whole matrix will be copied.
 
Int64Matrix getTimeCopyByName (const std::string &name) const
 Get time by name, return a matrix containing a copy of the requested time.
 
TimeConstView getTimeViewByName (const std::string &name) const
 Get a const view on a time by name, throw an exception if it does not exist.
 
TimeView getTimeViewByName (const std::string &name)
 Get a view on a time by name, throw an exception if it does not exist.
 
TimeConstView getTimeRowViewByName (const std::string &name, const unsigned row) const
 Get a const view on a time row by name and number, throw an exception if it does not exist.
 
TimeView getTimeRowViewByName (const std::string &name, const unsigned row)
 Get a view on a time by row name and number, throw an exception if it does not exist.
 
bool timeExists (const std::string &name) const
 Look if a time with a given name exist.
 
bool timeExists (const std::string &name, const unsigned dim) const
 Look if a time with a given name and dimension exist.
 
unsigned getTimeDimension (const std::string &name) const
 Return the dimension of a time with a given name. Return 0 if the name is not found.
 
unsigned getTimeStartingRow (const std::string &name) const
 Return the starting row of a time with a given name. Return 0 if the name is not found.
 
void assertTimesConsistency () const
 Assert if times are not consistent with features.
 

Static Public Member Functions

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

Public Attributes

Matrix features
 features of points in the cloud
 
Labels featureLabels
 labels of features
 
Matrix descriptors
 descriptors of points in the cloud, might be empty
 
Labels descriptorLabels
 labels of descriptors
 
Int64Matrix times
 time associated to each points, might be empty
 
Labels timeLabels
 labels of times.
 

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.


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