Point Cloud Library (PCL)
1.10.0
|
Implements the method for extracting features based on moment of inertia. More...
#include <pcl/features/moment_of_inertia_estimation.h>
Public Types | |
using | PointCloudConstPtr = typename pcl::PCLBase< PointT >::PointCloudConstPtr |
using | PointIndicesConstPtr = typename pcl::PCLBase< PointT >::PointIndicesConstPtr |
![]() | |
using | PointCloud = pcl::PointCloud< PointT > |
using | PointCloudPtr = typename PointCloud::Ptr |
using | PointCloudConstPtr = typename PointCloud::ConstPtr |
using | PointIndicesPtr = PointIndices::Ptr |
using | PointIndicesConstPtr = PointIndices::ConstPtr |
Public Member Functions | |
void | setInputCloud (const PointCloudConstPtr &cloud) override |
Provide a pointer to the input dataset. More... | |
void | setIndices (const IndicesPtr &indices) override |
Provide a pointer to the vector of indices that represents the input data. More... | |
void | setIndices (const IndicesConstPtr &indices) override |
Provide a pointer to the vector of indices that represents the input data. More... | |
void | setIndices (const PointIndicesConstPtr &indices) override |
Provide a pointer to the vector of indices that represents the input data. More... | |
void | setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols) override |
Set the indices for the points laying within an interest region of the point cloud. More... | |
MomentOfInertiaEstimation () | |
Constructor that sets default values for member variables. More... | |
~MomentOfInertiaEstimation () | |
Virtual destructor which frees the memory. More... | |
void | setAngleStep (const float step) |
This method allows to set the angle step. More... | |
float | getAngleStep () const |
Returns the angle step. More... | |
void | setNormalizePointMassFlag (bool need_to_normalize) |
This method allows to set the normalize_ flag. More... | |
bool | getNormalizePointMassFlag () const |
Returns the normalize_ flag. More... | |
void | setPointMass (const float point_mass) |
This method allows to set point mass that will be used for moment of inertia calculation. More... | |
float | getPointMass () const |
Returns the mass of point. More... | |
void | compute () |
This method launches the computation of all features. More... | |
bool | getAABB (PointT &min_point, PointT &max_point) const |
This method gives access to the computed axis aligned bounding box. More... | |
bool | getOBB (PointT &min_point, PointT &max_point, PointT &position, Eigen::Matrix3f &rotational_matrix) const |
This method gives access to the computed oriented bounding box. More... | |
bool | getEigenValues (float &major, float &middle, float &minor) const |
This method gives access to the computed eigen values. More... | |
bool | getEigenVectors (Eigen::Vector3f &major, Eigen::Vector3f &middle, Eigen::Vector3f &minor) const |
This method gives access to the computed eigen vectors. More... | |
bool | getMomentOfInertia (std::vector< float > &moment_of_inertia) const |
This method gives access to the computed moments of inertia. More... | |
bool | getEccentricity (std::vector< float > &eccentricity) const |
This method gives access to the computed ecentricities. More... | |
bool | getMassCenter (Eigen::Vector3f &mass_center) const |
This method gives access to the computed mass center. More... | |
![]() | |
PCLBase () | |
Empty constructor. More... | |
PCLBase (const PCLBase &base) | |
Copy constructor. More... | |
virtual | ~PCLBase () |
Destructor. More... | |
const PointCloudConstPtr | getInputCloud () const |
Get a pointer to the input point cloud dataset. More... | |
const IndicesPtr | getIndices () |
Get a pointer to the vector of indices used. More... | |
const IndicesConstPtr | getIndices () const |
Get a pointer to the vector of indices used. More... | |
const PointT & | operator[] (std::size_t pos) const |
Override PointCloud operator[] to shorten code. More... | |
Additional Inherited Members | |
![]() | |
bool | initCompute () |
This method should get called before starting the actual computation. More... | |
bool | deinitCompute () |
This method should get called after finishing the actual computation. More... | |
![]() | |
PointCloudConstPtr | input_ |
The input point cloud dataset. More... | |
IndicesPtr | indices_ |
A pointer to the vector of point indices to use. More... | |
bool | use_indices_ |
Set to true if point indices are used. More... | |
bool | fake_indices_ |
If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More... | |
Implements the method for extracting features based on moment of inertia.
It also calculates AABB, OBB and eccentricity of the projected cloud.
Definition at line 55 of file moment_of_inertia_estimation.h.
using pcl::MomentOfInertiaEstimation< PointT >::PointCloudConstPtr = typename pcl::PCLBase<PointT>::PointCloudConstPtr |
Definition at line 66 of file moment_of_inertia_estimation.h.
using pcl::MomentOfInertiaEstimation< PointT >::PointIndicesConstPtr = typename pcl::PCLBase<PointT>::PointIndicesConstPtr |
Definition at line 67 of file moment_of_inertia_estimation.h.
pcl::MomentOfInertiaEstimation< PointT >::MomentOfInertiaEstimation |
Constructor that sets default values for member variables.
Definition at line 47 of file moment_of_inertia_estimation.hpp.
pcl::MomentOfInertiaEstimation< PointT >::~MomentOfInertiaEstimation |
Virtual destructor which frees the memory.
Definition at line 69 of file moment_of_inertia_estimation.hpp.
void pcl::MomentOfInertiaEstimation< PointT >::compute |
This method launches the computation of all features.
After execution it sets is_valid_ flag to true and each feature can be accessed with the corresponding get method.
Definition at line 131 of file moment_of_inertia_estimation.hpp.
References pcl::computeCovarianceMatrix().
bool pcl::MomentOfInertiaEstimation< PointT >::getAABB | ( | PointT & | min_point, |
PointT & | max_point | ||
) | const |
This method gives access to the computed axis aligned bounding box.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.
[out] | min_point | min point of the AABB |
[out] | max_point | max point of the AABB |
Definition at line 198 of file moment_of_inertia_estimation.hpp.
float pcl::MomentOfInertiaEstimation< PointT >::getAngleStep |
Returns the angle step.
Definition at line 89 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getEccentricity | ( | std::vector< float > & | eccentricity | ) | const |
This method gives access to the computed ecentricities.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.
[out] | eccentricity | computed eccentricities |
Definition at line 308 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getEigenValues | ( | float & | major, |
float & | middle, | ||
float & | minor | ||
) | const |
This method gives access to the computed eigen values.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.
[out] | major | major eigen value |
[out] | middle | middle eigen value |
[out] | minor | minor eigen value |
Definition at line 276 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getEigenVectors | ( | Eigen::Vector3f & | major, |
Eigen::Vector3f & | middle, | ||
Eigen::Vector3f & | minor | ||
) | const |
This method gives access to the computed eigen vectors.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.
[out] | major | axis which corresponds to the eigen vector with the major eigen value |
[out] | middle | axis which corresponds to the eigen vector with the middle eigen value |
[out] | minor | axis which corresponds to the eigen vector with the minor eigen value |
Definition at line 287 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getMassCenter | ( | Eigen::Vector3f & | mass_center | ) | const |
This method gives access to the computed mass center.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise. Note that when mass center of a cloud is computed, mass point is always considered equal 1.
[out] | mass_center | computed mass center |
Definition at line 556 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getMomentOfInertia | ( | std::vector< float > & | moment_of_inertia | ) | const |
This method gives access to the computed moments of inertia.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.
[out] | moment_of_inertia | computed moments of inertia |
Definition at line 298 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getNormalizePointMassFlag |
Returns the normalize_ flag.
Definition at line 105 of file moment_of_inertia_estimation.hpp.
bool pcl::MomentOfInertiaEstimation< PointT >::getOBB | ( | PointT & | min_point, |
PointT & | max_point, | ||
PointT & | position, | ||
Eigen::Matrix3f & | rotational_matrix | ||
) | const |
This method gives access to the computed oriented bounding box.
It returns true if the current values (eccentricity, moment of inertia etc) are valid and false otherwise. Note that in order to get the OBB, each vertex of the given AABB (specified with min_point and max_point) must be rotated with the given rotational matrix (rotation transform) and then positioned. Also pay attention to the fact that this is not the minimal possible bounding box. This is the bounding box which is oriented in accordance with the eigen vectors.
[out] | min_point | min point of the OBB |
[out] | max_point | max point of the OBB |
[out] | position | position of the OBB |
[out] | rotational_matrix | this matrix represents the rotation transform |
Definition at line 208 of file moment_of_inertia_estimation.hpp.
float pcl::MomentOfInertiaEstimation< PointT >::getPointMass |
Returns the mass of point.
Definition at line 124 of file moment_of_inertia_estimation.hpp.
void pcl::MomentOfInertiaEstimation< PointT >::setAngleStep | ( | const float | step | ) |
This method allows to set the angle step.
It is used for the rotation of the axis which is used for moment of inertia/eccentricity calculation.
[in] | step | angle step |
Definition at line 77 of file moment_of_inertia_estimation.hpp.
|
overridevirtual |
Provide a pointer to the vector of indices that represents the input data.
[in] | indices | a pointer to the vector of indices that represents the input data. |
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 585 of file moment_of_inertia_estimation.hpp.
|
overridevirtual |
Provide a pointer to the vector of indices that represents the input data.
[in] | indices | a pointer to the vector of indices that represents the input data. |
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 574 of file moment_of_inertia_estimation.hpp.
|
overridevirtual |
Provide a pointer to the vector of indices that represents the input data.
[in] | indices | a pointer to the vector of indices that represents the input data. |
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 596 of file moment_of_inertia_estimation.hpp.
|
overridevirtual |
Set the indices for the points laying within an interest region of the point cloud.
[in] | row_start | the offset on rows |
[in] | col_start | the offset on columns |
[in] | nb_rows | the number of rows to be considered row_start included |
[in] | nb_cols | the number of columns to be considered col_start included |
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 607 of file moment_of_inertia_estimation.hpp.
|
overridevirtual |
Provide a pointer to the input dataset.
[in] | cloud | the const boost shared pointer to a PointCloud message |
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 565 of file moment_of_inertia_estimation.hpp.
void pcl::MomentOfInertiaEstimation< PointT >::setNormalizePointMassFlag | ( | bool | need_to_normalize | ) |
This method allows to set the normalize_ flag.
If set to false, then point_mass_ will be used to scale the moment of inertia values. Otherwise, point_mass_ will be set to 1 / number_of_points. Default value is true.
[in] | need_to_normalize | desired value |
Definition at line 96 of file moment_of_inertia_estimation.hpp.
void pcl::MomentOfInertiaEstimation< PointT >::setPointMass | ( | const float | point_mass | ) |
This method allows to set point mass that will be used for moment of inertia calculation.
It is needed to scale moment of inertia values. default value is 0.0001.
[in] | point_mass | point mass |
Definition at line 112 of file moment_of_inertia_estimation.hpp.