45 #include <pcl/pcl_base.h>
53 template <
typename Po
intT>
80 setIndices (
const IndicesPtr& indices)
override;
103 setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
override;
117 setAngleStep (
const float step);
121 getAngleStep ()
const;
129 setNormalizePointMassFlag (
bool need_to_normalize);
133 getNormalizePointMassFlag ()
const;
141 setPointMass (
const float point_mass);
145 getPointMass ()
const;
174 getOBB (
PointT& min_point,
PointT& max_point,
PointT& position, Eigen::Matrix3f& rotational_matrix)
const;
183 getEigenValues (
float& major,
float& middle,
float& minor)
const;
192 getEigenVectors (Eigen::Vector3f& major, Eigen::Vector3f& middle, Eigen::Vector3f& minor)
const;
199 getMomentOfInertia (std::vector <float>& moment_of_inertia)
const;
206 getEccentricity (std::vector <float>& eccentricity)
const;
214 getMassCenter (Eigen::Vector3f& mass_center)
const;
225 rotateVector (
const Eigen::Vector3f& vector,
const Eigen::Vector3f& axis,
const float angle, Eigen::Vector3f& rotated_vector)
const;
261 computeEigenVectors (
const Eigen::Matrix <float, 3, 3>& covariance_matrix, Eigen::Vector3f& major_axis,
262 Eigen::Vector3f& middle_axis, Eigen::Vector3f& minor_axis,
float& major_value,
float& middle_value,
272 calculateMomentOfInertia (
const Eigen::Vector3f& current_axis,
const Eigen::Vector3f& mean_value)
const;
281 getProjectedCloud (
const Eigen::Vector3f& normal_vector,
const Eigen::Vector3f& point,
typename pcl::PointCloud <PointT>::Ptr projected_cloud)
const;
288 computeEccentricity (
const Eigen::Matrix <float, 3, 3>& covariance_matrix,
const Eigen::Vector3f& normal_vector);
294 bool is_valid_{
false};
300 float point_mass_{0.0001f};
303 bool normalize_{
true};
306 Eigen::Vector3f mean_value_;
309 Eigen::Vector3f major_axis_;
312 Eigen::Vector3f middle_axis_;
315 Eigen::Vector3f minor_axis_;
318 float major_value_{0.0f};
321 float middle_value_{0.0f};
324 float minor_value_{0.0f};
327 std::vector <float> moment_of_inertia_;
330 std::vector <float> eccentricity_;
345 Eigen::Vector3f obb_position_;
348 Eigen::Matrix3f obb_rotational_matrix_;
355 #define PCL_INSTANTIATE_MomentOfInertiaEstimation(T) template class PCL_EXPORTS pcl::MomentOfInertiaEstimation<T>;
357 #ifdef PCL_NO_PRECOMPILE
358 #include <pcl/features/impl/moment_of_inertia_estimation.hpp>
Implements the method for extracting features based on moment of inertia.
typename PointCloud::ConstPtr PointCloudConstPtr
PointIndices::ConstPtr PointIndicesConstPtr
shared_ptr< PointCloud< PointT > > Ptr
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
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.
Defines functions, macros and traits for allocating and using memory.
shared_ptr< const Indices > IndicesConstPtr
shared_ptr< Indices > IndicesPtr
Defines all the PCL and non-PCL macros used.
A point structure representing Euclidean xyz coordinates, and the RGB color.