Point Cloud Library (PCL)
1.14.1-dev
|
SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods and models that require the use of surface normals for estimation. More...
#include <pcl/segmentation/sac_segmentation.h>
Public Member Functions | |
SACSegmentationFromNormals (bool random=false) | |
Empty constructor. More... | |
void | setInputNormals (const PointCloudNConstPtr &normals) |
Provide a pointer to the input dataset that contains the point normals of the XYZ dataset. More... | |
PointCloudNConstPtr | getInputNormals () const |
Get a pointer to the normals of the input XYZ point cloud dataset. More... | |
void | setNormalDistanceWeight (double distance_weight) |
Set the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point normals and the plane normal. More... | |
double | getNormalDistanceWeight () const |
Get the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point normals and the plane normal. More... | |
void | setMinMaxOpeningAngle (const double &min_angle, const double &max_angle) |
Set the minimum opning angle for a cone model. More... | |
void | getMinMaxOpeningAngle (double &min_angle, double &max_angle) |
Get the opening angle which we need minimum to validate a cone model. More... | |
void | setDistanceFromOrigin (const double d) |
Set the distance we expect a plane model to be from the origin. More... | |
double | getDistanceFromOrigin () const |
Get the distance of a plane model from the origin. More... | |
Public Member Functions inherited from pcl::SACSegmentation< PointT > | |
SACSegmentation (bool random=false) | |
Empty constructor. More... | |
~SACSegmentation () override=default | |
Empty destructor. More... | |
void | setModelType (int model) |
The type of model to use (user given parameter). More... | |
int | getModelType () const |
Get the type of SAC model used. More... | |
SampleConsensusPtr | getMethod () const |
Get a pointer to the SAC method used. More... | |
SampleConsensusModelPtr | getModel () const |
Get a pointer to the SAC model used. More... | |
void | setMethodType (int method) |
The type of sample consensus method to use (user given parameter). More... | |
int | getMethodType () const |
Get the type of sample consensus method used. More... | |
void | setDistanceThreshold (double threshold) |
Distance to the model threshold (user given parameter). More... | |
double | getDistanceThreshold () const |
Get the distance to the model threshold. More... | |
void | setMaxIterations (int max_iterations) |
Set the maximum number of iterations before giving up. More... | |
int | getMaxIterations () const |
Get maximum number of iterations before giving up. More... | |
void | setProbability (double probability) |
Set the probability of choosing at least one sample free from outliers. More... | |
double | getProbability () const |
Get the probability of choosing at least one sample free from outliers. More... | |
void | setNumberOfThreads (const int nr_threads=-1) |
Set the number of threads to use or turn off parallelization. More... | |
void | setOptimizeCoefficients (bool optimize) |
Set to true if a coefficient refinement is required. More... | |
bool | getOptimizeCoefficients () const |
Get the coefficient refinement internal flag. More... | |
void | setRadiusLimits (const double &min_radius, const double &max_radius) |
Set the minimum and maximum allowable radius limits for the model (applicable to models that estimate a radius) More... | |
void | getRadiusLimits (double &min_radius, double &max_radius) |
Get the minimum and maximum allowable radius limits for the model as set by the user. More... | |
void | setSamplesMaxDist (const double &radius, SearchPtr search) |
Set the maximum distance allowed when drawing random samples. More... | |
void | getSamplesMaxDist (double &radius) |
Get maximum distance allowed when drawing random samples. More... | |
void | setAxis (const Eigen::Vector3f &ax) |
Set the axis along which we need to search for a model perpendicular to. More... | |
Eigen::Vector3f | getAxis () const |
Get the axis along which we need to search for a model perpendicular to. More... | |
void | setEpsAngle (double ea) |
Set the angle epsilon (delta) threshold. More... | |
double | getEpsAngle () const |
Get the epsilon (delta) model angle threshold in radians. More... | |
virtual void | segment (PointIndices &inliers, ModelCoefficients &model_coefficients) |
Base method for segmentation of a model in a PointCloud given by <setInputCloud (), setIndices ()> More... | |
Public Member Functions inherited from pcl::PCLBase< PointT > | |
PCLBase () | |
Empty constructor. More... | |
PCLBase (const PCLBase &base) | |
Copy constructor. More... | |
virtual | ~PCLBase ()=default |
Destructor. More... | |
virtual void | setInputCloud (const PointCloudConstPtr &cloud) |
Provide a pointer to the input dataset. More... | |
PointCloudConstPtr const | getInputCloud () const |
Get a pointer to the input point cloud dataset. More... | |
virtual void | setIndices (const IndicesPtr &indices) |
Provide a pointer to the vector of indices that represents the input data. More... | |
virtual void | setIndices (const IndicesConstPtr &indices) |
Provide a pointer to the vector of indices that represents the input data. More... | |
virtual void | setIndices (const PointIndicesConstPtr &indices) |
Provide a pointer to the vector of indices that represents the input data. More... | |
virtual void | setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols) |
Set the indices for the points laying within an interest region of the point cloud. More... | |
IndicesPtr | getIndices () |
Get a pointer to the vector of indices used. More... | |
IndicesConstPtr const | getIndices () const |
Get a pointer to the vector of indices used. More... | |
const PointT & | operator[] (std::size_t pos) const |
Override PointCloud operator[] to shorten code. More... | |
Protected Member Functions | |
bool | initSACModel (const int model_type) override |
Initialize the Sample Consensus model and set its parameters. More... | |
std::string | getClassName () const override |
Class get name method. More... | |
Protected Member Functions inherited from pcl::SACSegmentation< PointT > | |
virtual void | initSAC (const int method_type) |
Initialize the Sample Consensus method and set its parameters. More... | |
Protected Member Functions inherited from pcl::PCLBase< PointT > | |
bool | initCompute () |
This method should get called before starting the actual computation. More... | |
bool | deinitCompute () |
This method should get called after finishing the actual computation. More... | |
Protected Attributes | |
PointCloudNConstPtr | normals_ {nullptr} |
A pointer to the input dataset that contains the point normals of the XYZ dataset. More... | |
double | distance_weight_ {0.1} |
The relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point normals and the plane normal. More... | |
double | distance_from_origin_ {0.0} |
The distance from the template plane to the origin. More... | |
double | min_angle_ {0.0} |
The minimum and maximum allowed opening angle of valid cone model. More... | |
double | max_angle_ {M_PI_2} |
Protected Attributes inherited from pcl::SACSegmentation< PointT > | |
SampleConsensusModelPtr | model_ {nullptr} |
The model that needs to be segmented. More... | |
SampleConsensusPtr | sac_ {nullptr} |
The sample consensus segmentation method. More... | |
int | model_type_ {-1} |
The type of model to use (user given parameter). More... | |
int | method_type_ {0} |
The type of sample consensus method to use (user given parameter). More... | |
double | threshold_ {0.0} |
Distance to the model threshold (user given parameter). More... | |
bool | optimize_coefficients_ {true} |
Set to true if a coefficient refinement is required. More... | |
double | radius_min_ {-std::numeric_limits<double>::max()} |
The minimum and maximum radius limits for the model. More... | |
double | radius_max_ {std::numeric_limits<double>::max()} |
double | samples_radius_ {0.0} |
The maximum distance of subsequent samples from the first (radius search) More... | |
SearchPtr | samples_radius_search_ {nullptr} |
The search object for picking subsequent samples using radius search. More... | |
double | eps_angle_ {0.0} |
The maximum allowed difference between the model normal and the given axis. More... | |
Eigen::Vector3f | axis_ {Eigen::Vector3f::Zero()} |
The axis along which we need to search for a model perpendicular to. More... | |
int | max_iterations_ {50} |
Maximum number of iterations before giving up (user given parameter). More... | |
int | threads_ {-1} |
The number of threads the scheduler should use, or a negative number if no parallelization is wanted. More... | |
double | probability_ {0.99} |
Desired probability of choosing at least one sample free from outliers (user given parameter). More... | |
bool | random_ |
Set to true if we need a random seed. More... | |
Protected Attributes inherited from pcl::PCLBase< PointT > | |
PointCloudConstPtr | input_ |
The input point cloud dataset. More... | |
IndicesPtr | indices_ |
A pointer to the vector of point indices to use. More... | |
bool | use_indices_ |
Set to true if point indices are used. More... | |
bool | fake_indices_ |
If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More... | |
SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods and models that require the use of surface normals for estimation.
Definition at line 305 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloud = typename SACSegmentation<PointT>::PointCloud |
Definition at line 319 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudConstPtr = typename PointCloud::ConstPtr |
Definition at line 321 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudN = pcl::PointCloud<PointNT> |
Definition at line 323 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudNConstPtr = typename PointCloudN::ConstPtr |
Definition at line 325 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudNPtr = typename PointCloudN::Ptr |
Definition at line 324 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudPtr = typename PointCloud::Ptr |
Definition at line 320 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::SampleConsensusModelFromNormalsPtr = typename SampleConsensusModelFromNormals<PointT, PointNT>::Ptr |
Definition at line 329 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::SampleConsensusModelPtr = typename SampleConsensusModel<PointT>::Ptr |
Definition at line 328 of file sac_segmentation.h.
using pcl::SACSegmentationFromNormals< PointT, PointNT >::SampleConsensusPtr = typename SampleConsensus<PointT>::Ptr |
Definition at line 327 of file sac_segmentation.h.
|
inline |
Empty constructor.
[in] | random | if true set the random seed to the current time, else set to 12345 (default: false) |
Definition at line 334 of file sac_segmentation.h.
|
inlineoverrideprotectedvirtual |
Class get name method.
Reimplemented from pcl::SACSegmentation< PointT >.
Definition at line 414 of file sac_segmentation.h.
|
inline |
Get the distance of a plane model from the origin.
Definition at line 388 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::distance_from_origin_.
|
inline |
Get a pointer to the normals of the input XYZ point cloud dataset.
Definition at line 347 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::normals_.
|
inline |
Get the opening angle which we need minimum to validate a cone model.
Definition at line 374 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::max_angle_, and pcl::SACSegmentationFromNormals< PointT, PointNT >::min_angle_.
|
inline |
Get the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point normals and the plane normal.
Definition at line 359 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::distance_weight_.
|
overrideprotectedvirtual |
Initialize the Sample Consensus model and set its parameters.
[in] | model_type | the type of SAC model that is to be used |
Reimplemented from pcl::SACSegmentation< PointT >.
Definition at line 375 of file sac_segmentation.hpp.
References pcl::SampleConsensusModelCone< PointT, PointNT >::getAxis(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::getAxis(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::getAxis(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::getDistanceFromOrigin(), pcl::SampleConsensusModelCone< PointT, PointNT >::getEpsAngle(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::getEpsAngle(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::getEpsAngle(), pcl::SampleConsensusModelCone< PointT, PointNT >::getMinMaxOpeningAngle(), pcl::SampleConsensusModelFromNormals< PointT, PointNT >::getNormalDistanceWeight(), pcl::SampleConsensusModel< PointT >::getRadiusLimits(), M_PI, pcl::SACMODEL_CONE, pcl::SACMODEL_CYLINDER, pcl::SACMODEL_NORMAL_PARALLEL_PLANE, pcl::SACMODEL_NORMAL_PLANE, pcl::SACMODEL_NORMAL_SPHERE, pcl::SampleConsensusModelCone< PointT, PointNT >::setAxis(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::setAxis(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::setAxis(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::setDistanceFromOrigin(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::setEpsAngle(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::setEpsAngle(), pcl::SampleConsensusModelCone< PointT, PointNT >::setEpsAngle(), pcl::SampleConsensusModelFromNormals< PointT, PointNT >::setInputNormals(), pcl::SampleConsensusModelCone< PointT, PointNT >::setMinMaxOpeningAngle(), pcl::SampleConsensusModelFromNormals< PointT, PointNT >::setNormalDistanceWeight(), and pcl::SampleConsensusModel< PointT >::setRadiusLimits().
|
inline |
Set the distance we expect a plane model to be from the origin.
[in] | d | distance from the template plane model to the origin |
Definition at line 384 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::distance_from_origin_.
|
inline |
Provide a pointer to the input dataset that contains the point normals of the XYZ dataset.
[in] | normals | the const shared pointer to a PointCloud message |
Definition at line 343 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::normals_.
|
inline |
Set the minimum opning angle for a cone model.
min_angle | the opening angle which we need minimum to validate a cone model. |
max_angle | the opening angle which we need maximum to validate a cone model. |
Definition at line 366 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::max_angle_, and pcl::SACSegmentationFromNormals< PointT, PointNT >::min_angle_.
|
inline |
Set the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point normals and the plane normal.
[in] | distance_weight | the distance/angular weight |
Definition at line 354 of file sac_segmentation.h.
References pcl::SACSegmentationFromNormals< PointT, PointNT >::distance_weight_.
|
protected |
The distance from the template plane to the origin.
Definition at line 400 of file sac_segmentation.h.
Referenced by pcl::SACSegmentationFromNormals< PointT, PointNT >::getDistanceFromOrigin(), and pcl::SACSegmentationFromNormals< PointT, PointNT >::setDistanceFromOrigin().
|
protected |
The relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point normals and the plane normal.
Definition at line 397 of file sac_segmentation.h.
Referenced by pcl::SACSegmentationFromNormals< PointT, PointNT >::getNormalDistanceWeight(), and pcl::SACSegmentationFromNormals< PointT, PointNT >::setNormalDistanceWeight().
|
protected |
Definition at line 404 of file sac_segmentation.h.
Referenced by pcl::SACSegmentationFromNormals< PointT, PointNT >::getMinMaxOpeningAngle(), and pcl::SACSegmentationFromNormals< PointT, PointNT >::setMinMaxOpeningAngle().
|
protected |
The minimum and maximum allowed opening angle of valid cone model.
Definition at line 403 of file sac_segmentation.h.
Referenced by pcl::SACSegmentationFromNormals< PointT, PointNT >::getMinMaxOpeningAngle(), and pcl::SACSegmentationFromNormals< PointT, PointNT >::setMinMaxOpeningAngle().
|
protected |
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Definition at line 392 of file sac_segmentation.h.
Referenced by pcl::SACSegmentationFromNormals< PointT, PointNT >::getInputNormals(), and pcl::SACSegmentationFromNormals< PointT, PointNT >::setInputNormals().