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 |
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 () | |
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... |
|
const PointCloudConstPtr | getInputCloud () const |
Get a pointer to the input point cloud dataset. More... |
|
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 |
|
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
using pcl::MomentOfInertiaEstimation< PointT >::PointCloudConstPtr = typename pcl::PCLBase<PointT>::PointCloudConstPtr |
Definition at line 65 of file moment_of_inertia_estimation.h.
PointIndicesConstPtr
using pcl::MomentOfInertiaEstimation< PointT >::PointIndicesConstPtr = typename pcl::PCLBase<PointT>::PointIndicesConstPtr |
Definition at line 66 of file moment_of_inertia_estimation.h.
Constructor & Destructor Documentation
MomentOfInertiaEstimation()
pcl::MomentOfInertiaEstimation< PointT >::MomentOfInertiaEstimation |
Constructor that sets default values for member variables.
Definition at line 50 of file moment_of_inertia_estimation.hpp.
~MomentOfInertiaEstimation()
pcl::MomentOfInertiaEstimation< PointT >::~MomentOfInertiaEstimation |
Virtual destructor which frees the memory.
Definition at line 72 of file moment_of_inertia_estimation.hpp.
Member Function Documentation
compute()
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().
getAABB()
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_point min point of the AABB [out] max_point max point of the AABB
Definition at line 201 of file moment_of_inertia_estimation.hpp.
getAngleStep()
float pcl::MomentOfInertiaEstimation< PointT >::getAngleStep |
Returns the angle step.
Definition at line 92 of file moment_of_inertia_estimation.hpp.
getEccentricity()
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] eccentricity computed eccentricities
Definition at line 311 of file moment_of_inertia_estimation.hpp.
getEigenValues()
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] major major eigen value [out] middle middle eigen value [out] minor minor eigen value
Definition at line 279 of file moment_of_inertia_estimation.hpp.
getEigenVectors()
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] 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 290 of file moment_of_inertia_estimation.hpp.
getMassCenter()
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_center computed mass center
Definition at line 559 of file moment_of_inertia_estimation.hpp.
getMomentOfInertia()
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_inertia computed moments of inertia
Definition at line 301 of file moment_of_inertia_estimation.hpp.
getNormalizePointMassFlag()
bool pcl::MomentOfInertiaEstimation< PointT >::getNormalizePointMassFlag |
Returns the normalize_ flag.
Definition at line 108 of file moment_of_inertia_estimation.hpp.
getOBB()
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_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 211 of file moment_of_inertia_estimation.hpp.
getPointMass()
float pcl::MomentOfInertiaEstimation< PointT >::getPointMass |
Returns the mass of point.
Definition at line 127 of file moment_of_inertia_estimation.hpp.
setAngleStep()
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] step angle step
Definition at line 80 of file moment_of_inertia_estimation.hpp.
setIndices() [1/4]
|
overridevirtual |
Provide a pointer to the vector of indices that represents the input data.
- Parameters
-
[in] indices a pointer to the vector of indices that represents the input data.
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 584 of file moment_of_inertia_estimation.hpp.
References pcl::PCLBase< PointT >::setIndices().
setIndices() [2/4]
|
overridevirtual |
Provide a pointer to the vector of indices that represents the input data.
- Parameters
-
[in] indices a pointer to the vector of indices that represents the input data.
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 576 of file moment_of_inertia_estimation.hpp.
References pcl::PCLBase< PointT >::setIndices().
setIndices() [3/4]
|
overridevirtual |
Provide a pointer to the vector of indices that represents the input data.
- Parameters
-
[in] indices a pointer to the vector of indices that represents the input data.
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 592 of file moment_of_inertia_estimation.hpp.
References pcl::PCLBase< PointT >::setIndices().
setIndices() [4/4]
|
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_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 600 of file moment_of_inertia_estimation.hpp.
References pcl::PCLBase< PointT >::setIndices().
setInputCloud()
|
overridevirtual |
Provide a pointer to the input dataset.
- Parameters
-
[in] cloud the const boost shared pointer to a PointCloud message
Reimplemented from pcl::PCLBase< PointT >.
Definition at line 568 of file moment_of_inertia_estimation.hpp.
References pcl::PCLBase< PointT >::setInputCloud().
setNormalizePointMassFlag()
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_normalize desired value
Definition at line 99 of file moment_of_inertia_estimation.hpp.
setPointMass()
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_mass point mass
Definition at line 115 of file moment_of_inertia_estimation.hpp.
The documentation for this class was generated from the following files:
- pcl/features/moment_of_inertia_estimation.h
- pcl/features/impl/moment_of_inertia_estimation.hpp
© 2009–2012, Willow Garage, Inc.
© 2012–, Open Perception, Inc.
Licensed under the BSD License.
https://pointclouds.org/documentation/classpcl_1_1_moment_of_inertia_estimation.html