Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::SACSegmentationFromNormals< PointT, PointNT > Class Template Reference

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>

+ Inheritance diagram for pcl::SACSegmentationFromNormals< PointT, PointNT >:

Public Types

using PointCloud = typename SACSegmentation< PointT >::PointCloud
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointCloudN = pcl::PointCloud< PointNT >
 
using PointCloudNPtr = typename PointCloudN::Ptr
 
using PointCloudNConstPtr = typename PointCloudN::ConstPtr
 
using SampleConsensusPtr = typename SampleConsensus< PointT >::Ptr
 
using SampleConsensusModelPtr = typename SampleConsensusModel< PointT >::Ptr
 
using SampleConsensusModelFromNormalsPtr = typename SampleConsensusModelFromNormals< PointT, PointNT >::Ptr
 
- Public Types inherited from pcl::SACSegmentation< PointT >
using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using SearchPtr = typename pcl::search::Search< PointT >::Ptr
 
using SampleConsensusPtr = typename SampleConsensus< PointT >::Ptr
 
using SampleConsensusModelPtr = typename SampleConsensusModel< PointT >::Ptr
 
- Public Types inherited from pcl::PCLBase< PointT >
using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointIndicesPtr = boost::shared_ptr< PointIndices >
 
using PointIndicesConstPtr = boost::shared_ptr< PointIndices const >
 

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 ()
 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 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 ()
 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 (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr const 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 PointToperator[] (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_
 A pointer to the input dataset that contains the point normals of the XYZ dataset. More...
 
double distance_weight_
 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_
 The distance from the template plane to the origin. More...
 
double min_angle_
 The minimum and maximum allowed opening angle of valid cone model. More...
 
double max_angle_
 
- Protected Attributes inherited from pcl::SACSegmentation< PointT >
SampleConsensusModelPtr model_
 The model that needs to be segmented. More...
 
SampleConsensusPtr sac_
 The sample consensus segmentation method. More...
 
int model_type_
 The type of model to use (user given parameter). More...
 
int method_type_
 The type of sample consensus method to use (user given parameter). More...
 
double threshold_
 Distance to the model threshold (user given parameter). More...
 
bool optimize_coefficients_
 Set to true if a coefficient refinement is required. More...
 
double radius_min_
 The minimum and maximum radius limits for the model. More...
 
double radius_max_
 
double samples_radius_
 The maximum distance of subsequent samples from the first (radius search) More...
 
SearchPtr samples_radius_search_
 The search object for picking subsequent samples using radius search. More...
 
double eps_angle_
 The maximum allowed difference between the model normal and the given axis. More...
 
Eigen::Vector3f axis_
 The axis along which we need to search for a model perpendicular to. More...
 
int max_iterations_
 Maximum number of iterations before giving up (user given parameter). More...
 
double probability_
 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...
 

Detailed Description

template<typename PointT, typename PointNT>
class pcl::SACSegmentationFromNormals< PointT, PointNT >

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 310 of file sac_segmentation.h.

Member Typedef Documentation

◆ PointCloud

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloud = typename SACSegmentation<PointT>::PointCloud

Definition at line 324 of file sac_segmentation.h.

◆ PointCloudConstPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudConstPtr = typename PointCloud::ConstPtr

Definition at line 326 of file sac_segmentation.h.

◆ PointCloudN

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudN = pcl::PointCloud<PointNT>

Definition at line 328 of file sac_segmentation.h.

◆ PointCloudNConstPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudNConstPtr = typename PointCloudN::ConstPtr

Definition at line 330 of file sac_segmentation.h.

◆ PointCloudNPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudNPtr = typename PointCloudN::Ptr

Definition at line 329 of file sac_segmentation.h.

◆ PointCloudPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::PointCloudPtr = typename PointCloud::Ptr

Definition at line 325 of file sac_segmentation.h.

◆ SampleConsensusModelFromNormalsPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::SampleConsensusModelFromNormalsPtr = typename SampleConsensusModelFromNormals<PointT, PointNT>::Ptr

Definition at line 334 of file sac_segmentation.h.

◆ SampleConsensusModelPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::SampleConsensusModelPtr = typename SampleConsensusModel<PointT>::Ptr

Definition at line 333 of file sac_segmentation.h.

◆ SampleConsensusPtr

template<typename PointT , typename PointNT >
using pcl::SACSegmentationFromNormals< PointT, PointNT >::SampleConsensusPtr = typename SampleConsensus<PointT>::Ptr

Definition at line 332 of file sac_segmentation.h.

Constructor & Destructor Documentation

◆ SACSegmentationFromNormals()

template<typename PointT , typename PointNT >
pcl::SACSegmentationFromNormals< PointT, PointNT >::SACSegmentationFromNormals ( bool  random = false)
inline

Empty constructor.

Parameters
[in]randomif true set the random seed to the current time, else set to 12345 (default: false)

Definition at line 339 of file sac_segmentation.h.

Member Function Documentation

◆ getClassName()

template<typename PointT , typename PointNT >
std::string pcl::SACSegmentationFromNormals< PointT, PointNT >::getClassName ( ) const
inlineoverrideprotectedvirtual

Class get name method.

Reimplemented from pcl::SACSegmentation< PointT >.

Definition at line 424 of file sac_segmentation.h.

◆ getDistanceFromOrigin()

template<typename PointT , typename PointNT >
double pcl::SACSegmentationFromNormals< PointT, PointNT >::getDistanceFromOrigin ( ) const
inline

Get the distance of a plane model from the origin.

Definition at line 398 of file sac_segmentation.h.

◆ getInputNormals()

template<typename PointT , typename PointNT >
PointCloudNConstPtr pcl::SACSegmentationFromNormals< PointT, PointNT >::getInputNormals ( ) const
inline

Get a pointer to the normals of the input XYZ point cloud dataset.

Definition at line 357 of file sac_segmentation.h.

◆ getMinMaxOpeningAngle()

template<typename PointT , typename PointNT >
void pcl::SACSegmentationFromNormals< PointT, PointNT >::getMinMaxOpeningAngle ( double &  min_angle,
double &  max_angle 
)
inline

Get the opening angle which we need minimum to validate a cone model.

Definition at line 384 of file sac_segmentation.h.

◆ getNormalDistanceWeight()

template<typename PointT , typename PointNT >
double pcl::SACSegmentationFromNormals< PointT, PointNT >::getNormalDistanceWeight ( ) const
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 369 of file sac_segmentation.h.

◆ initSACModel()

template<typename PointT , typename PointNT >
bool pcl::SACSegmentationFromNormals< PointT, PointNT >::initSACModel ( const int  model_type)
overrideprotectedvirtual

Initialize the Sample Consensus model and set its parameters.

Parameters
[in]model_typethe type of SAC model that is to be used

Reimplemented from pcl::SACSegmentation< PointT >.

Definition at line 342 of file sac_segmentation.hpp.

References pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::getAxis(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::getAxis(), pcl::SampleConsensusModelCone< PointT, PointNT >::getAxis(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::getDistanceFromOrigin(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::getEpsAngle(), pcl::SampleConsensusModelCone< PointT, PointNT >::getEpsAngle(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::getEpsAngle(), pcl::SampleConsensusModelCone< PointT, PointNT >::getMinMaxOpeningAngle(), pcl::SampleConsensusModelFromNormals< PointT, PointNT >::getNormalDistanceWeight(), pcl::SampleConsensusModel< PointT >::getRadiusLimits(), pcl::SACMODEL_CONE, pcl::SACMODEL_CYLINDER, pcl::SACMODEL_NORMAL_PARALLEL_PLANE, pcl::SACMODEL_NORMAL_PLANE, pcl::SACMODEL_NORMAL_SPHERE, pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::setAxis(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::setAxis(), pcl::SampleConsensusModelCone< PointT, PointNT >::setAxis(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::setDistanceFromOrigin(), pcl::SampleConsensusModelCylinder< PointT, PointNT >::setEpsAngle(), pcl::SampleConsensusModelCone< PointT, PointNT >::setEpsAngle(), pcl::SampleConsensusModelNormalParallelPlane< PointT, PointNT >::setEpsAngle(), pcl::SampleConsensusModelFromNormals< PointT, PointNT >::setInputNormals(), pcl::SampleConsensusModelCone< PointT, PointNT >::setMinMaxOpeningAngle(), pcl::SampleConsensusModelFromNormals< PointT, PointNT >::setNormalDistanceWeight(), and pcl::SampleConsensusModel< PointT >::setRadiusLimits().

◆ setDistanceFromOrigin()

template<typename PointT , typename PointNT >
void pcl::SACSegmentationFromNormals< PointT, PointNT >::setDistanceFromOrigin ( const double  d)
inline

Set the distance we expect a plane model to be from the origin.

Parameters
[in]ddistance from the template plane modl to the origin

Definition at line 394 of file sac_segmentation.h.

◆ setInputNormals()

template<typename PointT , typename PointNT >
void pcl::SACSegmentationFromNormals< PointT, PointNT >::setInputNormals ( const PointCloudNConstPtr normals)
inline

Provide a pointer to the input dataset that contains the point normals of the XYZ dataset.

Parameters
[in]normalsthe const boost shared pointer to a PointCloud message

Definition at line 353 of file sac_segmentation.h.

◆ setMinMaxOpeningAngle()

template<typename PointT , typename PointNT >
void pcl::SACSegmentationFromNormals< PointT, PointNT >::setMinMaxOpeningAngle ( const double &  min_angle,
const double &  max_angle 
)
inline

Set the minimum opning angle for a cone model.

Parameters
min_anglethe opening angle which we need minimum to validate a cone model.
max_anglethe opening angle which we need maximum to validate a cone model.

Definition at line 376 of file sac_segmentation.h.

◆ setNormalDistanceWeight()

template<typename PointT , typename PointNT >
void pcl::SACSegmentationFromNormals< PointT, PointNT >::setNormalDistanceWeight ( double  distance_weight)
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.

Parameters
[in]distance_weightthe distance/angular weight

Definition at line 364 of file sac_segmentation.h.

Member Data Documentation

◆ distance_from_origin_

template<typename PointT , typename PointNT >
double pcl::SACSegmentationFromNormals< PointT, PointNT >::distance_from_origin_
protected

The distance from the template plane to the origin.

Definition at line 410 of file sac_segmentation.h.

◆ distance_weight_

template<typename PointT , typename PointNT >
double pcl::SACSegmentationFromNormals< PointT, PointNT >::distance_weight_
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 407 of file sac_segmentation.h.

◆ max_angle_

template<typename PointT , typename PointNT >
double pcl::SACSegmentationFromNormals< PointT, PointNT >::max_angle_
protected

Definition at line 414 of file sac_segmentation.h.

◆ min_angle_

template<typename PointT , typename PointNT >
double pcl::SACSegmentationFromNormals< PointT, PointNT >::min_angle_
protected

The minimum and maximum allowed opening angle of valid cone model.

Definition at line 413 of file sac_segmentation.h.

◆ normals_

template<typename PointT , typename PointNT >
PointCloudNConstPtr pcl::SACSegmentationFromNormals< PointT, PointNT >::normals_
protected

A pointer to the input dataset that contains the point normals of the XYZ dataset.

Definition at line 402 of file sac_segmentation.h.


The documentation for this class was generated from the following files: