Go to the documentation of this file.
3 #include <pcl/point_cloud.h>
4 #include <pcl/point_types.h>
5 #include <pcl/common/transforms.h>
7 #include <Eigen/Geometry>
52 Eigen::Vector3f normal, Eigen::Vector3f center);
70 Eigen::Vector3f normal, Eigen::Vector3f center);
102 template <
typename Int>
114 void initAlignedPointCloud(
const pcl::PointCloud<PointT>& cloud, Eigen::Vector3f normal, Eigen::Vector3f center);
115 pcl::PointCloud<PointT>::ConstPtr getAlignedPointCloud()
const;
118 void setRotated(
float angle)
const;
120 bool isInlier(
const PointT& p)
const;
138 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
aligned {
new pcl::PointCloud<pcl::PointXYZRGBA>};
143 mutable pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
rotated {
new pcl::PointCloud<pcl::PointXYZRGBA>};
void setRectangleSize(const Eigen::Vector2f &value)
Set the rectangle size.
Eigen::Matrix4f alignedTransform
Transformation applied to get aligned.
Eigen::Vector2f getRectangleSize() const
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr aligned
Transformed so center is at 0 and z = normal.
Eigen::Matrix4f fit()
Count the number of inliers per rotation step, and return the global pose corresponding to the rotati...
size_t numSteps
The number of steps (i.e. resolution of solution space).
Eigen::Vector2f rectangleSize
The rectangle size.
Eigen::Matrix4f angleToPose(float angle)
Get the global pose corresponding to a local rotation angle.
std::vector< size_t > getInlierCounts() const
Get the inlier counts per step.
size_t countInliersOfAngle(float angle) const
Count the inliers for a given local rotation angle.
Finds the rotation of a rectangle of known size at a given position that contains the most points fro...
void Identity(MatrixXX< N, N, T > *a)
pcl::PointIndicesPtr getInliers() const
Get the inliers of the best local rotation angle.
std::shared_ptr< Value > value()
std::vector< size_t > inlierCounts
The inlier counts per step.
Hyperplane< float, 3 > Hyperplane3f
size_t getNumSteps() const
void setInputCloud(const pcl::PointCloud< PointT > &cloud, Eigen::Vector3f normal, Eigen::Vector3f center)
Set the input cloud and the rectangle's position and normal.
void setNumSteps(const size_t &value)
Set the number of solution steps, i.e. the resolution of the solution space.
MatrixXX< 4, 4, float > Matrix4f
float stepToAngle(Int step) const
Get the local rotation angle of a solution step.
FitKnownRectangleRotationMaxPoints()
float bestAngle
The best angle.
size_t getNumInliers() const
Get the best local rotation angle.
double angle(const Point &a, const Point &b, const Point &c)
float getBestAngle() const
Get the best local rotation angle.
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr rotated
Buffer for point clouds rotated for inlier counting.
pcl::PointIndicesPtr findInliersOfAngle(float angle) const
Get the inliers for a given local rotation angle.