Point Cloud Library (PCL)  1.14.0-dev
List of all members | Public Types | Public Member Functions
pcl::MomentOfInertiaEstimation< PointT > Class Template Reference

Implements the method for extracting features based on moment of inertia. More...

#include <pcl/features/moment_of_inertia_estimation.h>

+ Inheritance diagram for pcl::MomentOfInertiaEstimation< PointT >:
+ Collaboration diagram for pcl::MomentOfInertiaEstimation< PointT >:

Public Types

using PointCloudConstPtr = typename pcl::PCLBase< PointT >::PointCloudConstPtr
 
using PointIndicesConstPtr = typename pcl::PCLBase< PointT >::PointIndicesConstPtr
 
- Public Types inherited from pcl::PCLBase< PointT >
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 () override
 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...
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()=default
 Destructor. More...
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
IndicesPtr getIndices ()
 Get a pointer to the vector of indices used. More...
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Additional Inherited Members

- Protected Member Functions inherited from pcl::PCLBase< PointT >
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...
 
- Protected Attributes inherited from pcl::PCLBase< PointT >
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...
 

Detailed Description

template<typename PointT>
class pcl::MomentOfInertiaEstimation< PointT >

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 54 of file moment_of_inertia_estimation.h.

Member Typedef Documentation

◆ PointCloudConstPtr

Definition at line 65 of file moment_of_inertia_estimation.h.

◆ PointIndicesConstPtr

Definition at line 66 of file moment_of_inertia_estimation.h.

Constructor & Destructor Documentation

◆ MomentOfInertiaEstimation()

Constructor that sets default values for member variables.

Definition at line 50 of file moment_of_inertia_estimation.hpp.

◆ ~MomentOfInertiaEstimation()

template<typename PointT >
pcl::MomentOfInertiaEstimation< PointT >::~MomentOfInertiaEstimation
override

Virtual destructor which frees the memory.

Definition at line 67 of file moment_of_inertia_estimation.hpp.

Member Function Documentation

◆ compute()

template<typename PointT >
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 129 of file moment_of_inertia_estimation.hpp.

References pcl::computeCovarianceMatrix().

◆ getAABB()

template<typename PointT >
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.

Parameters
[out]min_pointmin point of the AABB
[out]max_pointmax point of the AABB

Definition at line 196 of file moment_of_inertia_estimation.hpp.

◆ getAngleStep()

template<typename PointT >
float pcl::MomentOfInertiaEstimation< PointT >::getAngleStep

Returns the angle step.

Definition at line 87 of file moment_of_inertia_estimation.hpp.

◆ getEccentricity()

template<typename PointT >
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.

Parameters
[out]eccentricitycomputed eccentricities

Definition at line 306 of file moment_of_inertia_estimation.hpp.

◆ getEigenValues()

template<typename PointT >
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.

Parameters
[out]majormajor eigen value
[out]middlemiddle eigen value
[out]minorminor eigen value

Definition at line 274 of file moment_of_inertia_estimation.hpp.

◆ getEigenVectors()

template<typename PointT >
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.

Parameters
[out]majoraxis which corresponds to the eigen vector with the major eigen value
[out]middleaxis which corresponds to the eigen vector with the middle eigen value
[out]minoraxis which corresponds to the eigen vector with the minor eigen value

Definition at line 285 of file moment_of_inertia_estimation.hpp.

◆ getMassCenter()

template<typename PointT >
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.

Parameters
[out]mass_centercomputed mass center

Definition at line 554 of file moment_of_inertia_estimation.hpp.

◆ getMomentOfInertia()

template<typename PointT >
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.

Parameters
[out]moment_of_inertiacomputed moments of inertia

Definition at line 296 of file moment_of_inertia_estimation.hpp.

◆ getNormalizePointMassFlag()

template<typename PointT >
bool pcl::MomentOfInertiaEstimation< PointT >::getNormalizePointMassFlag

Returns the normalize_ flag.

Definition at line 103 of file moment_of_inertia_estimation.hpp.

◆ getOBB()

template<typename PointT >
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.

Parameters
[out]min_pointmin point of the OBB
[out]max_pointmax point of the OBB
[out]positionposition of the OBB
[out]rotational_matrixthis matrix represents the rotation transform

Definition at line 206 of file moment_of_inertia_estimation.hpp.

◆ getPointMass()

template<typename PointT >
float pcl::MomentOfInertiaEstimation< PointT >::getPointMass

Returns the mass of point.

Definition at line 122 of file moment_of_inertia_estimation.hpp.

◆ setAngleStep()

template<typename PointT >
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.

Parameters
[in]stepangle step

Definition at line 75 of file moment_of_inertia_estimation.hpp.

◆ setIndices() [1/4]

template<typename PointT >
void pcl::MomentOfInertiaEstimation< PointT >::setIndices ( const IndicesConstPtr indices)
overridevirtual

Provide a pointer to the vector of indices that represents the input data.

Parameters
[in]indicesa pointer to the vector of indices that represents the input data.

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 579 of file moment_of_inertia_estimation.hpp.

References pcl::PCLBase< PointT >::setIndices().

◆ setIndices() [2/4]

template<typename PointT >
void pcl::MomentOfInertiaEstimation< PointT >::setIndices ( const IndicesPtr indices)
overridevirtual

Provide a pointer to the vector of indices that represents the input data.

Parameters
[in]indicesa pointer to the vector of indices that represents the input data.

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 571 of file moment_of_inertia_estimation.hpp.

References pcl::PCLBase< PointT >::setIndices().

◆ setIndices() [3/4]

template<typename PointT >
void pcl::MomentOfInertiaEstimation< PointT >::setIndices ( const PointIndicesConstPtr indices)
overridevirtual

Provide a pointer to the vector of indices that represents the input data.

Parameters
[in]indicesa pointer to the vector of indices that represents the input data.

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 587 of file moment_of_inertia_estimation.hpp.

References pcl::PCLBase< PointT >::setIndices().

◆ setIndices() [4/4]

template<typename PointT >
void pcl::MomentOfInertiaEstimation< PointT >::setIndices ( std::size_t  row_start,
std::size_t  col_start,
std::size_t  nb_rows,
std::size_t  nb_cols 
)
overridevirtual

Set the indices for the points laying within an interest region of the point cloud.

Note
you shouldn't call this method on unorganized point clouds!
Parameters
[in]row_startthe offset on rows
[in]col_startthe offset on columns
[in]nb_rowsthe number of rows to be considered row_start included
[in]nb_colsthe number of columns to be considered col_start included

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 595 of file moment_of_inertia_estimation.hpp.

References pcl::PCLBase< PointT >::setIndices().

◆ setInputCloud()

template<typename PointT >
void pcl::MomentOfInertiaEstimation< PointT >::setInputCloud ( const PointCloudConstPtr cloud)
overridevirtual

Provide a pointer to the input dataset.

Parameters
[in]cloudthe const boost shared pointer to a PointCloud message

Reimplemented from pcl::PCLBase< PointT >.

Definition at line 563 of file moment_of_inertia_estimation.hpp.

References pcl::PCLBase< PointT >::setInputCloud().

◆ setNormalizePointMassFlag()

template<typename PointT >
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.

Parameters
[in]need_to_normalizedesired value

Definition at line 94 of file moment_of_inertia_estimation.hpp.

◆ setPointMass()

template<typename PointT >
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.

Parameters
[in]point_masspoint mass

Definition at line 110 of file moment_of_inertia_estimation.hpp.


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