40 #ifndef PCL_MOMENT_OF_INERTIA_ESIMATION_H_ 41 #define PCL_MOMENT_OF_INERTIA_ESIMATION_H_ 45 #include <pcl/features/feature.h> 46 #include <pcl/PointIndices.h> 54 template <
typename Po
intT>
104 setIndices (
size_t row_start,
size_t col_start,
size_t nb_rows,
size_t nb_cols);
118 setAngleStep (
const float step);
122 getAngleStep ()
const;
130 setNormalizePointMassFlag (
bool need_to_normalize);
134 getNormalizePointMassFlag ()
const;
142 setPointMass (
const float point_mass);
146 getPointMass ()
const;
175 getOBB (
PointT& min_point,
PointT& max_point,
PointT& position, Eigen::Matrix3f& rotational_matrix)
const;
184 getEigenValues (
float& major,
float& middle,
float& minor)
const;
193 getEigenVectors (Eigen::Vector3f& major, Eigen::Vector3f& middle, Eigen::Vector3f& minor)
const;
200 getMomentOfInertia (std::vector <float>& moment_of_inertia)
const;
207 getEccentricity (std::vector <float>& eccentricity)
const;
215 getMassCenter (Eigen::Vector3f& mass_center)
const;
226 rotateVector (
const Eigen::Vector3f& vector,
const Eigen::Vector3f& axis,
const float angle, Eigen::Vector3f& rotated_vector)
const;
262 computeEigenVectors (
const Eigen::Matrix <float, 3, 3>& covariance_matrix, Eigen::Vector3f& major_axis,
263 Eigen::Vector3f& middle_axis, Eigen::Vector3f& minor_axis,
float& major_value,
float& middle_value,
273 calculateMomentOfInertia (
const Eigen::Vector3f& current_axis,
const Eigen::Vector3f& mean_value)
const;
282 getProjectedCloud (
const Eigen::Vector3f& normal_vector,
const Eigen::Vector3f& point,
typename pcl::PointCloud <PointT>::Ptr projected_cloud)
const;
289 computeEccentricity (
const Eigen::Matrix <float, 3, 3>& covariance_matrix,
const Eigen::Vector3f& normal_vector);
307 Eigen::Vector3f mean_value_;
310 Eigen::Vector3f major_axis_;
313 Eigen::Vector3f middle_axis_;
316 Eigen::Vector3f minor_axis_;
328 std::vector <float> moment_of_inertia_;
331 std::vector <float> eccentricity_;
346 Eigen::Vector3f obb_position_;
349 Eigen::Matrix3f obb_rotational_matrix_;
352 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
356 #define PCL_INSTANTIATE_MomentOfInertiaEstimation(T) template class pcl::MomentOfInertiaEstimation<T>; 358 #ifdef PCL_NO_PRECOMPILE 359 #include <pcl/features/impl/moment_of_inertia_estimation.hpp> PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< std::vector< int > > IndicesPtr
This file defines compatibility wrappers for low level I/O functions.
boost::shared_ptr< PointCloud< PointT > > Ptr
Implements the method for extracting features based on moment of inertia.
boost::shared_ptr< PointIndices const > PointIndicesConstPtr
unsigned int computeCovarianceMatrix(const pcl::PointCloud< PointT > &cloud, const Eigen::Matrix< Scalar, 4, 1 > ¢roid, Eigen::Matrix< Scalar, 3, 3 > &covariance_matrix)
Compute the 3x3 covariance matrix of a given set of points.
pcl::PCLBase< PointT >::PointIndicesConstPtr PointIndicesConstPtr
pcl::PCLBase< PointT >::PointCloudConstPtr PointCloudConstPtr
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.