|
Finds the rotation of a rectangle of known size at a given position that contains the most points from a point cloud. More...
#include <VisionX/libraries/PointCloudTools/FitKnownRectangleRotationMaxPoints.h>
Public Types | |
using | PointT = pcl::PointXYZRGBA |
Public Member Functions | |
Eigen::Matrix4f | angleToPose (float angle) |
Get the global pose corresponding to a local rotation angle. More... | |
size_t | countInliersOfAngle (float angle) const |
Count the inliers for a given local rotation angle. More... | |
pcl::PointIndicesPtr | findInliersOfAngle (float angle) const |
Get the inliers for a given local rotation angle. More... | |
Eigen::Matrix4f | fit () |
Count the number of inliers per rotation step, and return the global pose corresponding to the rotation angle with the highest number of inliers. More... | |
Eigen::Matrix4f | fit (const pcl::PointCloud< PointT > &cloud, Eigen::Vector3f normal, Eigen::Vector3f center) |
FitKnownRectangleRotationMaxPoints () | |
float | getBestAngle () const |
Get the best local rotation angle. More... | |
std::vector< size_t > | getInlierCounts () const |
Get the inlier counts per step. More... | |
pcl::PointIndicesPtr | getInliers () const |
Get the inliers of the best local rotation angle. More... | |
size_t | getNumInliers () const |
Get the best local rotation angle. More... | |
size_t | getNumSteps () const |
Eigen::Vector2f | getRectangleSize () 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. More... | |
void | setNumSteps (const size_t &value) |
Set the number of solution steps, i.e. the resolution of the solution space. More... | |
void | setRectangleSize (const Eigen::Vector2f &value) |
Set the rectangle size. More... | |
template<typename Int > | |
float | stepToAngle (Int step) const |
Get the local rotation angle of a solution step. More... | |
Public Attributes | |
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | aligned {new pcl::PointCloud<pcl::PointXYZRGBA>} |
Transformed so center is at 0 and z = normal. More... | |
Eigen::Matrix4f | alignedTransform = Eigen::Matrix4f::Identity() |
Transformation applied to get aligned . More... | |
float | bestAngle = 0 |
The best angle. More... | |
size_t | bestStep = 0 |
std::vector< size_t > | inlierCounts |
The inlier counts per step. More... | |
const float | maxAngle = float(M_PI) |
size_t | numSteps = 180 |
The number of steps (i.e. resolution of solution space). More... | |
Eigen::Vector2f | rectangleSize = Eigen::Vector2f::Ones() |
The rectangle size. More... | |
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | rotated |
Buffer for point clouds rotated for inlier counting. More... | |
Finds the rotation of a rectangle of known size at a given position that contains the most points from a point cloud.
Definition at line 21 of file FitKnownRectangleRotationMaxPoints.h.
using PointT = pcl::PointXYZRGBA |
Definition at line 24 of file FitKnownRectangleRotationMaxPoints.h.
Definition at line 9 of file FitKnownRectangleRotationMaxPoints.cpp.
Eigen::Matrix4f angleToPose | ( | float | angle | ) |
Get the global pose corresponding to a local rotation angle.
Definition at line 140 of file FitKnownRectangleRotationMaxPoints.cpp.
size_t countInliersOfAngle | ( | float | angle | ) | const |
Count the inliers for a given local rotation angle.
Definition at line 112 of file FitKnownRectangleRotationMaxPoints.cpp.
pcl::PointIndicesPtr findInliersOfAngle | ( | float | angle | ) | const |
Get the inliers for a given local rotation angle.
Definition at line 122 of file FitKnownRectangleRotationMaxPoints.cpp.
Eigen::Matrix4f fit | ( | ) |
Count the number of inliers per rotation step, and return the global pose corresponding to the rotation angle with the highest number of inliers.
The best rotation angle can be retrieved via getAngle()
. The number of inliers per step retrieved via getInlierCounts()
.
Definition at line 46 of file FitKnownRectangleRotationMaxPoints.cpp.
Eigen::Matrix4f fit | ( | const pcl::PointCloud< PointT > & | cloud, |
Eigen::Vector3f | normal, | ||
Eigen::Vector3f | center | ||
) |
setInputCloud()
, fit()
float getBestAngle | ( | ) | const |
Get the best local rotation angle.
Definition at line 153 of file FitKnownRectangleRotationMaxPoints.cpp.
std::vector< size_t > getInlierCounts | ( | ) | const |
Get the inlier counts per step.
Definition at line 147 of file FitKnownRectangleRotationMaxPoints.cpp.
|
inline |
Get the inliers of the best local rotation angle.
Definition at line 91 of file FitKnownRectangleRotationMaxPoints.h.
|
inline |
Get the best local rotation angle.
Definition at line 84 of file FitKnownRectangleRotationMaxPoints.h.
size_t getNumSteps | ( | ) | const |
Definition at line 26 of file FitKnownRectangleRotationMaxPoints.cpp.
Eigen::Vector2f getRectangleSize | ( | ) | const |
Definition at line 14 of file FitKnownRectangleRotationMaxPoints.cpp.
void setInputCloud | ( | const pcl::PointCloud< PointT > & | cloud, |
Eigen::Vector3f | normal, | ||
Eigen::Vector3f | center | ||
) |
Set the input cloud and the rectangle's position and normal.
cloud | The input cloud. |
normal | The rectangle normal. |
center | The rectangle center. |
Definition at line 38 of file FitKnownRectangleRotationMaxPoints.cpp.
void setNumSteps | ( | const size_t & | value | ) |
Set the number of solution steps, i.e. the resolution of the solution space.
Definition at line 32 of file FitKnownRectangleRotationMaxPoints.cpp.
void setRectangleSize | ( | const Eigen::Vector2f & | value | ) |
Set the rectangle size.
Definition at line 20 of file FitKnownRectangleRotationMaxPoints.cpp.
|
inline |
Get the local rotation angle of a solution step.
Definition at line 104 of file FitKnownRectangleRotationMaxPoints.h.
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr aligned {new pcl::PointCloud<pcl::PointXYZRGBA>} |
Transformed so center is at 0 and z = normal.
Definition at line 140 of file FitKnownRectangleRotationMaxPoints.h.
Eigen::Matrix4f alignedTransform = Eigen::Matrix4f::Identity() |
Transformation applied to get aligned
.
Definition at line 142 of file FitKnownRectangleRotationMaxPoints.h.
float bestAngle = 0 |
The best angle.
Definition at line 153 of file FitKnownRectangleRotationMaxPoints.h.
size_t bestStep = 0 |
Definition at line 151 of file FitKnownRectangleRotationMaxPoints.h.
std::vector<size_t> inlierCounts |
The inlier counts per step.
Definition at line 155 of file FitKnownRectangleRotationMaxPoints.h.
Definition at line 134 of file FitKnownRectangleRotationMaxPoints.h.
size_t numSteps = 180 |
The number of steps (i.e. resolution of solution space).
Definition at line 133 of file FitKnownRectangleRotationMaxPoints.h.
Eigen::Vector2f rectangleSize = Eigen::Vector2f::Ones() |
The rectangle size.
Definition at line 130 of file FitKnownRectangleRotationMaxPoints.h.
|
mutable |
Buffer for point clouds rotated for inlier counting.
Definition at line 145 of file FitKnownRectangleRotationMaxPoints.h.