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< Matrix > | View |
A view on a feature or descriptor. | |
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. | |
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 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 | 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 | 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. | |
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 | 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. | |
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. | |
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. | |
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 |
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.