Point Cloud Library (PCL)  1.8.1-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 >:

Public Types

typedef pcl::PCLBase< PointT >
::PointCloudConstPtr 
PointCloudConstPtr
 
typedef pcl::PCLBase< PointT >
::PointIndicesConstPtr 
PointIndicesConstPtr
 
- Public Types inherited from pcl::PCLBase< PointT >
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< PointIndices
PointIndicesPtr
 
typedef boost::shared_ptr
< PointIndices const > 
PointIndicesConstPtr
 

Public Member Functions

virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 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...
 
virtual ~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...
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()
 Destructor. More...
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
IndicesPtr const 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[] (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 55 of file moment_of_inertia_estimation.h.

Member Typedef Documentation

Definition at line 66 of file moment_of_inertia_estimation.h.

Definition at line 67 of file moment_of_inertia_estimation.h.

Constructor & Destructor Documentation

Constructor that sets default values for member variables.

Definition at line 47 of file moment_of_inertia_estimation.hpp.

template<typename PointT >
pcl::MomentOfInertiaEstimation< PointT >::~MomentOfInertiaEstimation ( )
virtual

Virtual destructor which frees the memory.

Definition at line 72 of file moment_of_inertia_estimation.hpp.

Member Function Documentation

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 134 of file moment_of_inertia_estimation.hpp.

References pcl::computeCovarianceMatrix().

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 201 of file moment_of_inertia_estimation.hpp.

template<typename PointT >
float pcl::MomentOfInertiaEstimation< PointT >::getAngleStep ( ) const

Returns the angle step.

Definition at line 92 of file moment_of_inertia_estimation.hpp.

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 311 of file moment_of_inertia_estimation.hpp.

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 279 of file moment_of_inertia_estimation.hpp.

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 290 of file moment_of_inertia_estimation.hpp.

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 559 of file moment_of_inertia_estimation.hpp.

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 301 of file moment_of_inertia_estimation.hpp.

template<typename PointT >
bool pcl::MomentOfInertiaEstimation< PointT >::getNormalizePointMassFlag ( ) const

Returns the normalize_ flag.

Definition at line 108 of file moment_of_inertia_estimation.hpp.

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 211 of file moment_of_inertia_estimation.hpp.

template<typename PointT >
float pcl::MomentOfInertiaEstimation< PointT >::getPointMass ( ) const

Returns the mass of point.

Definition at line 127 of file moment_of_inertia_estimation.hpp.

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 80 of file moment_of_inertia_estimation.hpp.

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

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 577 of file moment_of_inertia_estimation.hpp.

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

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 588 of file moment_of_inertia_estimation.hpp.

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

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 599 of file moment_of_inertia_estimation.hpp.

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

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 610 of file moment_of_inertia_estimation.hpp.

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

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 568 of file moment_of_inertia_estimation.hpp.

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 99 of file moment_of_inertia_estimation.hpp.

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 115 of file moment_of_inertia_estimation.hpp.


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