#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 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< Matrix > | View |
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. The 'pad' field will stay at the end for homogeneous transformation. | |
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 | getDescriptorDim () const |
Return the total number of descriptors. | |
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. | |
unsigned | getEuclideanDim () const |
Return the dimension of the point cloud. | |
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. | |
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 | getNbPoints () const |
Return the number of points contained in the point cloud. | |
bool | operator== (const DataPoints &that) const |
Return whether two point-clouds are identical (same data and same labels) | |
void | removeDescriptor (const std::string &name) |
Remove a descriptor by name, the whole matrix will be copied. | |
void | removeFeature (const std::string &name) |
Remove a feature by name, the whole matrix will be copied. | |
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 |
void | removeField (const std::string &name, Labels &labels, Matrix &data) const |
Remove a descriptor or feature by name, no copy is done. |
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 202 of file PointMatcher.h.
typedef const Eigen::Block<const Matrix> PointMatcher< T >::DataPoints::ConstView |
A view on a const feature or const descriptor.
Definition at line 207 of file PointMatcher.h.
typedef Matrix::Index PointMatcher< T >::DataPoints::Index |
An index to a row or a column.
Definition at line 209 of file PointMatcher.h.
typedef Eigen::Block<Matrix> PointMatcher< T >::DataPoints::View |
A view on a feature or descriptor.
Definition at line 205 of file PointMatcher.h.
PointMatcher< T >::DataPoints::DataPoints | ( | ) |
Construct an empty point cloud.
Definition at line 97 of file pointmatcher/DataPoints.cpp.
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 pointmatcher/DataPoints.cpp.
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 pointmatcher/DataPoints.cpp.
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 pointmatcher/DataPoints.cpp.
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 439 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::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.
Definition at line 346 of file pointmatcher/DataPoints.cpp.
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 613 of file pointmatcher/DataPoints.cpp.
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 425 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::allocateDescriptors | ( | const Labels & | newLabels | ) |
Make sure a vector of descriptors of given names exist.
Definition at line 432 of file pointmatcher/DataPoints.cpp.
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 332 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::allocateFeatures | ( | const Labels & | newLabels | ) |
Make sure a vector of features of given names exist.
Definition at line 339 of file pointmatcher/DataPoints.cpp.
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 548 of file pointmatcher/DataPoints.cpp.
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 572 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::assertDescriptorConsistency | ( | ) | const |
Assert if descriptors are not consistent with features.
Definition at line 517 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::concatenate | ( | const DataPoints & | dp | ) |
Add an other point cloud after the current one.
Definition at line 188 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::conservativeResize | ( | Index | pointCount | ) |
Resize the cloud to pointCount points, conserving existing ones.
Definition at line 271 of file pointmatcher/DataPoints.cpp.
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 280 of file pointmatcher/DataPoints.cpp.
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 302 of file pointmatcher/DataPoints.cpp.
bool PointMatcher< T >::DataPoints::descriptorExists | ( | const std::string & | name | ) | const |
Look if a descriptor with a given name exist.
Definition at line 489 of file pointmatcher/DataPoints.cpp.
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 496 of file pointmatcher/DataPoints.cpp.
bool PointMatcher< T >::DataPoints::featureExists | ( | const std::string & | name | ) | const |
Look if a feature with a given name exist.
Definition at line 397 of file pointmatcher/DataPoints.cpp.
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 404 of file pointmatcher/DataPoints.cpp.
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 756 of file pointmatcher/DataPoints.cpp.
const 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 705 of file pointmatcher/DataPoints.cpp.
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 454 of file pointmatcher/DataPoints.cpp.
unsigned PointMatcher< T >::DataPoints::getDescriptorDim | ( | ) | const |
Return the total number of descriptors.
Definition at line 157 of file pointmatcher/DataPoints.cpp.
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 503 of file pointmatcher/DataPoints.cpp.
const 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 475 of file pointmatcher/DataPoints.cpp.
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 482 of file pointmatcher/DataPoints.cpp.
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 510 of file pointmatcher/DataPoints.cpp.
const 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 461 of file pointmatcher/DataPoints.cpp.
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 468 of file pointmatcher/DataPoints.cpp.
unsigned PointMatcher< T >::DataPoints::getEuclideanDim | ( | ) | const |
Return the dimension of the point cloud.
Definition at line 136 of file pointmatcher/DataPoints.cpp.
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 362 of file pointmatcher/DataPoints.cpp.
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 411 of file pointmatcher/DataPoints.cpp.
const 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 383 of file pointmatcher/DataPoints.cpp.
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 390 of file pointmatcher/DataPoints.cpp.
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 418 of file pointmatcher/DataPoints.cpp.
const 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 369 of file pointmatcher/DataPoints.cpp.
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 376 of file pointmatcher/DataPoints.cpp.
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 774 of file pointmatcher/DataPoints.cpp.
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 787 of file pointmatcher/DataPoints.cpp.
unsigned PointMatcher< T >::DataPoints::getHomogeneousDim | ( | ) | const |
Return the dimension of the point cloud in homogeneous coordinates (one more than Euclidean dimension)
Definition at line 143 of file pointmatcher/DataPoints.cpp.
unsigned PointMatcher< T >::DataPoints::getNbGroupedDescriptors | ( | ) | const |
Return the number of grouped descriptors (e.g., normals can have 3 components but would count as only one)
Definition at line 150 of file pointmatcher/DataPoints.cpp.
unsigned PointMatcher< T >::DataPoints::getNbPoints | ( | ) | const |
Return the number of points contained in the point cloud.
Definition at line 129 of file pointmatcher/DataPoints.cpp.
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 731 of file pointmatcher/DataPoints.cpp.
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 367 of file pointmatcher/IO.cpp.
bool PointMatcher< T >::DataPoints::operator== | ( | const DataPoints & | that | ) | const |
Return whether two point-clouds are identical (same data and same labels)
Definition at line 165 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::removeDescriptor | ( | const std::string & | name | ) |
Remove a descriptor by name, the whole matrix will be copied.
Definition at line 446 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::removeFeature | ( | const std::string & | name | ) |
Remove a feature by name, the whole matrix will be copied.
Definition at line 355 of file pointmatcher/DataPoints.cpp.
void PointMatcher< T >::DataPoints::removeField | ( | const std::string & | name, |
Labels & | labels, | ||
Matrix & | data | ||
) | const [private] |
Remove a descriptor or feature by name, no copy is done.
Definition at line 669 of file pointmatcher/DataPoints.cpp.
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 865 of file pointmatcher/IO.cpp.
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 322 of file pointmatcher/DataPoints.cpp.
Labels PointMatcher< T >::DataPoints::descriptorLabels |
labels of descriptors
Definition at line 288 of file PointMatcher.h.
Matrix PointMatcher< T >::DataPoints::descriptors |
descriptors of points in the cloud, might be empty
Definition at line 287 of file PointMatcher.h.
Labels PointMatcher< T >::DataPoints::featureLabels |
labels of features
Definition at line 286 of file PointMatcher.h.
Matrix PointMatcher< T >::DataPoints::features |
features of points in the cloud
Definition at line 285 of file PointMatcher.h.