3#include <Eigen/Geometry>
5#include <pcl/common/transforms.h>
6#include <pcl/point_cloud.h>
7#include <pcl/point_types.h>
49 Eigen::Vector3f normal,
50 Eigen::Vector3f center);
65 Eigen::Matrix4f
fit();
68 fit(
const pcl::PointCloud<PointT>& cloud, Eigen::Vector3f normal, Eigen::Vector3f center);
102 template <
typename Int>
115 void initAlignedPointCloud(
const pcl::PointCloud<PointT>& cloud,
116 Eigen::Vector3f normal,
117 Eigen::Vector3f center);
118 pcl::PointCloud<PointT>::ConstPtr getAlignedPointCloud()
const;
121 void setRotated(
float angle)
const;
123 bool isInlier(
const PointT& p)
const;
140 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
aligned{
new pcl::PointCloud<pcl::PointXYZRGBA>};
145 mutable pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
rotated{
146 new pcl::PointCloud<pcl::PointXYZRGBA>};
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr aligned
Transformed so center is at 0 and z = normal.
Eigen::Vector2f rectangleSize
The rectangle size.
std::vector< size_t > inlierCounts
The inlier counts per step.
float bestAngle
The best angle.
void setInputCloud(const pcl::PointCloud< PointT > &cloud, Eigen::Vector3f normal, Eigen::Vector3f center)
Set the input cloud and the rectangle's position and normal.
Eigen::Matrix4f fit(const pcl::PointCloud< PointT > &cloud, Eigen::Vector3f normal, Eigen::Vector3f center)
std::vector< size_t > getInlierCounts() const
Get the inlier counts per step.
float getBestAngle() const
Get the best local rotation angle.
pcl::PointIndicesPtr findInliersOfAngle(float angle) const
Get the inliers for a given local rotation angle.
float stepToAngle(Int step) const
Get the local rotation angle of a solution step.
Eigen::Matrix4f alignedTransform
Transformation applied to get aligned.
size_t getNumInliers() const
Get the best local rotation angle.
void setNumSteps(const size_t &value)
Set the number of solution steps, i.e. the resolution of the solution space.
Eigen::Matrix4f angleToPose(float angle)
Get the global pose corresponding to a local rotation angle.
FitKnownRectangleRotationMaxPoints()
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr rotated
Buffer for point clouds rotated for inlier counting.
size_t numSteps
The number of steps (i.e. resolution of solution space).
size_t countInliersOfAngle(float angle) const
Count the inliers for a given local rotation angle.
size_t getNumSteps() const
Eigen::Matrix4f fit()
Count the number of inliers per rotation step, and return the global pose corresponding to the rotati...
pcl::PointIndicesPtr getInliers() const
Get the inliers of the best local rotation angle.
Eigen::Vector2f getRectangleSize() const
void setRectangleSize(const Eigen::Vector2f &value)
Set the rectangle size.
Hyperplane< float, 3 > Hyperplane3f
double angle(const Point &a, const Point &b, const Point &c)