SampleConsensusModelParallelPlane defines a model for 3D plane segmentation using additional angular constraints. The plane must be parallel to a user-specified axis (setAxis) within an user-specified angle threshold (setEpsAngle). More...
#include <sac_model_parallel_plane.h>
Public Types | |
typedef SampleConsensusModelPlane < PointT >::PointCloud | PointCloud |
typedef SampleConsensusModelPlane < PointT >::PointCloudConstPtr | PointCloudConstPtr |
typedef SampleConsensusModelPlane < PointT >::PointCloudPtr | PointCloudPtr |
typedef boost::shared_ptr < SampleConsensusModelParallelPlane > | Ptr |
Public Member Functions | |
virtual int | countWithinDistance (const Eigen::VectorXf &model_coefficients, const double threshold) |
Count all the points which respect the given model coefficients as inliers. | |
Eigen::Vector3f | getAxis () |
Get the axis along which we need to search for a plane perpendicular to. | |
void | getDistancesToModel (const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) |
Compute all distances from the cloud data to a given plane model. | |
double | getEpsAngle () |
Get the angle epsilon (delta) threshold. | |
pcl::SacModel | getModelType () const |
Return an unique id for this model (SACMODEL_PARALLEL_PLANE). | |
SampleConsensusModelParallelPlane (const PointCloudConstPtr &cloud, bool random=false) | |
Constructor for base SampleConsensusModelParallelPlane. | |
SampleConsensusModelParallelPlane (const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false) | |
Constructor for base SampleConsensusModelParallelPlane. | |
void | selectWithinDistance (const Eigen::VectorXf &model_coefficients, const double threshold, std::vector< int > &inliers) |
Select all the points which respect the given model coefficients as inliers. | |
void | setAxis (const Eigen::Vector3f &ax) |
Set the axis along which we need to search for a plane perpendicular to. | |
void | setEpsAngle (const double ea) |
Set the angle epsilon (delta) threshold. | |
virtual | ~SampleConsensusModelParallelPlane () |
Empty destructor. | |
Protected Member Functions | |
bool | isModelValid (const Eigen::VectorXf &model_coefficients) |
Check whether a model is valid given the user constraints. | |
Protected Attributes | |
Eigen::Vector3f | axis_ |
The axis along which we need to search for a plane perpendicular to. | |
double | eps_angle_ |
The maximum allowed difference between the plane and the given axis. | |
double | sin_angle_ |
The sine of the angle. |
SampleConsensusModelParallelPlane defines a model for 3D plane segmentation using additional angular constraints. The plane must be parallel to a user-specified axis (setAxis) within an user-specified angle threshold (setEpsAngle).
Code example for a plane model, parallel (within a 15 degrees tolerance) with the Z axis:
SampleConsensusModelParallelPlane<pcl::PointXYZ> model (cloud); model.setAxis (Eigen::Vector3f (0.0, 0.0, 1.0)); model.setEpsAngle (pcl::deg2rad (15));
Definition at line 66 of file sac_model_parallel_plane.h.
typedef SampleConsensusModelPlane<PointT>::PointCloud pcl::SampleConsensusModelParallelPlane< PointT >::PointCloud |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 69 of file sac_model_parallel_plane.h.
typedef SampleConsensusModelPlane<PointT>::PointCloudConstPtr pcl::SampleConsensusModelParallelPlane< PointT >::PointCloudConstPtr |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 71 of file sac_model_parallel_plane.h.
typedef SampleConsensusModelPlane<PointT>::PointCloudPtr pcl::SampleConsensusModelParallelPlane< PointT >::PointCloudPtr |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 70 of file sac_model_parallel_plane.h.
typedef boost::shared_ptr<SampleConsensusModelParallelPlane> pcl::SampleConsensusModelParallelPlane< PointT >::Ptr |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 73 of file sac_model_parallel_plane.h.
pcl::SampleConsensusModelParallelPlane< PointT >::SampleConsensusModelParallelPlane | ( | const PointCloudConstPtr & | cloud, |
bool | random = false |
||
) | [inline] |
Constructor for base SampleConsensusModelParallelPlane.
[in] | cloud | the input point cloud dataset |
[in] | random | if true set the random seed to the current time, else set to 12345 (default: false) |
Definition at line 79 of file sac_model_parallel_plane.h.
pcl::SampleConsensusModelParallelPlane< PointT >::SampleConsensusModelParallelPlane | ( | const PointCloudConstPtr & | cloud, |
const std::vector< int > & | indices, | ||
bool | random = false |
||
) | [inline] |
Constructor for base SampleConsensusModelParallelPlane.
[in] | cloud | the input point cloud dataset |
[in] | indices | a vector of point indices to be used from cloud |
[in] | random | if true set the random seed to the current time, else set to 12345 (default: false) |
Definition at line 93 of file sac_model_parallel_plane.h.
virtual pcl::SampleConsensusModelParallelPlane< PointT >::~SampleConsensusModelParallelPlane | ( | ) | [inline, virtual] |
Empty destructor.
Definition at line 104 of file sac_model_parallel_plane.h.
int pcl::SampleConsensusModelParallelPlane< PointT >::countWithinDistance | ( | const Eigen::VectorXf & | model_coefficients, |
const double | threshold | ||
) | [virtual] |
Count all the points which respect the given model coefficients as inliers.
[in] | model_coefficients | the coefficients of a model that we need to compute distances to |
[in] | threshold | maximum admissible distance threshold for determining the inliers from the outliers |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 63 of file sac_model_parallel_plane.hpp.
Eigen::Vector3f pcl::SampleConsensusModelParallelPlane< PointT >::getAxis | ( | ) | [inline] |
Get the axis along which we need to search for a plane perpendicular to.
Definition at line 114 of file sac_model_parallel_plane.h.
void pcl::SampleConsensusModelParallelPlane< PointT >::getDistancesToModel | ( | const Eigen::VectorXf & | model_coefficients, |
std::vector< double > & | distances | ||
) | [virtual] |
Compute all distances from the cloud data to a given plane model.
[in] | model_coefficients | the coefficients of a plane model that we need to compute distances to |
[out] | distances | the resultant estimated distances |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 75 of file sac_model_parallel_plane.hpp.
double pcl::SampleConsensusModelParallelPlane< PointT >::getEpsAngle | ( | ) | [inline] |
Get the angle epsilon (delta) threshold.
Definition at line 125 of file sac_model_parallel_plane.h.
pcl::SacModel pcl::SampleConsensusModelParallelPlane< PointT >::getModelType | ( | ) | const [inline, virtual] |
Return an unique id for this model (SACMODEL_PARALLEL_PLANE).
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 157 of file sac_model_parallel_plane.h.
bool pcl::SampleConsensusModelParallelPlane< PointT >::isModelValid | ( | const Eigen::VectorXf & | model_coefficients | ) | [protected, virtual] |
Check whether a model is valid given the user constraints.
[in] | model_coefficients | the set of model coefficients |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 90 of file sac_model_parallel_plane.hpp.
void pcl::SampleConsensusModelParallelPlane< PointT >::selectWithinDistance | ( | const Eigen::VectorXf & | model_coefficients, |
const double | threshold, | ||
std::vector< int > & | inliers | ||
) | [virtual] |
Select all the points which respect the given model coefficients as inliers.
[in] | model_coefficients | the coefficients of a plane model that we need to compute distances to |
[in] | threshold | a maximum admissible distance threshold for determining the inliers from the outliers |
[out] | inliers | the resultant model inliers |
Reimplemented from pcl::SampleConsensusModelPlane< PointT >.
Definition at line 48 of file sac_model_parallel_plane.hpp.
void pcl::SampleConsensusModelParallelPlane< PointT >::setAxis | ( | const Eigen::Vector3f & | ax | ) | [inline] |
Set the axis along which we need to search for a plane perpendicular to.
[in] | ax | the axis along which we need to search for a plane perpendicular to |
Definition at line 110 of file sac_model_parallel_plane.h.
void pcl::SampleConsensusModelParallelPlane< PointT >::setEpsAngle | ( | const double | ea | ) | [inline] |
Set the angle epsilon (delta) threshold.
[in] | ea | the maximum allowed difference between the plane normal and the given axis. |
Definition at line 121 of file sac_model_parallel_plane.h.
Eigen::Vector3f pcl::SampleConsensusModelParallelPlane< PointT >::axis_ [protected] |
The axis along which we need to search for a plane perpendicular to.
Definition at line 167 of file sac_model_parallel_plane.h.
double pcl::SampleConsensusModelParallelPlane< PointT >::eps_angle_ [protected] |
The maximum allowed difference between the plane and the given axis.
Definition at line 170 of file sac_model_parallel_plane.h.
double pcl::SampleConsensusModelParallelPlane< PointT >::sin_angle_ [protected] |
The sine of the angle.
Definition at line 173 of file sac_model_parallel_plane.h.