sac_segmentation.h
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2012, Willow Garage, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
#ifndef PCL_SEGMENTATION_SAC_SEGMENTATION_H_
#define PCL_SEGMENTATION_SAC_SEGMENTATION_H_
#include <pcl/pcl_base.h>
#include <pcl/PointIndices.h>
#include <pcl/ModelCoefficients.h>
// Sample Consensus methods
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/sac.h>
// Sample Consensus models
#include <pcl/sample_consensus/model_types.h>
#include <pcl/sample_consensus/sac_model.h>
#include <pcl/search/search.h>
namespace pcl
{
/** \brief @b SACSegmentation represents the Nodelet segmentation class for
* Sample Consensus methods and models, in the sense that it just creates a
* Nodelet wrapper for generic-purpose SAC-based segmentation.
* \author Radu Bogdan Rusu
* \ingroup segmentation
*/
template <typename PointT>
class SACSegmentation : public PCLBase<PointT>
{
using PCLBase<PointT>::initCompute;
using PCLBase<PointT>::deinitCompute;
public:
using PCLBase<PointT>::input_;
using PCLBase<PointT>::indices_;
typedef pcl::PointCloud<PointT> PointCloud;
typedef typename PointCloud::Ptr PointCloudPtr;
typedef typename PointCloud::ConstPtr PointCloudConstPtr;
typedef typename pcl::search::Search<PointT>::Ptr SearchPtr;
typedef typename SampleConsensus<PointT>::Ptr SampleConsensusPtr;
typedef typename SampleConsensusModel<PointT>::Ptr SampleConsensusModelPtr;
/** \brief Empty constructor.
* \param[in] random if true set the random seed to the current time, else set to 12345 (default: false)
*/
SACSegmentation (bool random = false)
: model_ ()
, sac_ ()
, model_type_ (-1)
, method_type_ (0)
, threshold_ (0)
, optimize_coefficients_ (true)
, radius_min_ (-std::numeric_limits<double>::max ())
, radius_max_ (std::numeric_limits<double>::max ())
, samples_radius_ (0.0)
, samples_radius_search_ ()
, eps_angle_ (0.0)
, axis_ (Eigen::Vector3f::Zero ())
, max_iterations_ (50)
, probability_ (0.99)
, random_ (random)
{
}
/** \brief Empty destructor. */
virtual ~SACSegmentation () { /*srv_.reset ();*/ };
/** \brief The type of model to use (user given parameter).
* \param[in] model the model type (check \a model_types.h)
*/
inline void
setModelType (int model) { model_type_ = model; }
/** \brief Get the type of SAC model used. */
inline int
getModelType () const { return (model_type_); }
/** \brief Get a pointer to the SAC method used. */
inline SampleConsensusPtr
getMethod () const { return (sac_); }
/** \brief Get a pointer to the SAC model used. */
inline SampleConsensusModelPtr
getModel () const { return (model_); }
/** \brief The type of sample consensus method to use (user given parameter).
* \param[in] method the method type (check \a method_types.h)
*/
inline void
setMethodType (int method) { method_type_ = method; }
/** \brief Get the type of sample consensus method used. */
inline int
getMethodType () const { return (method_type_); }
/** \brief Distance to the model threshold (user given parameter).
* \param[in] threshold the distance threshold to use
*/
inline void
setDistanceThreshold (double threshold) { threshold_ = threshold; }
/** \brief Get the distance to the model threshold. */
inline double
getDistanceThreshold () const { return (threshold_); }
/** \brief Set the maximum number of iterations before giving up.
* \param[in] max_iterations the maximum number of iterations the sample consensus method will run
*/
inline void
setMaxIterations (int max_iterations) { max_iterations_ = max_iterations; }
/** \brief Get maximum number of iterations before giving up. */
inline int
getMaxIterations () const { return (max_iterations_); }
/** \brief Set the probability of choosing at least one sample free from outliers.
* \param[in] probability the model fitting probability
*/
inline void
setProbability (double probability) { probability_ = probability; }
/** \brief Get the probability of choosing at least one sample free from outliers. */
inline double
getProbability () const { return (probability_); }
/** \brief Set to true if a coefficient refinement is required.
* \param[in] optimize true for enabling model coefficient refinement, false otherwise
*/
inline void
setOptimizeCoefficients (bool optimize) { optimize_coefficients_ = optimize; }
/** \brief Get the coefficient refinement internal flag. */
inline bool
getOptimizeCoefficients () const { return (optimize_coefficients_); }
/** \brief Set the minimum and maximum allowable radius limits for the model (applicable to models that estimate
* a radius)
* \param[in] min_radius the minimum radius model
* \param[in] max_radius the maximum radius model
*/
inline void
setRadiusLimits (const double &min_radius, const double &max_radius)
{
radius_min_ = min_radius;
radius_max_ = max_radius;
}
/** \brief Get the minimum and maximum allowable radius limits for the model as set by the user.
* \param[out] min_radius the resultant minimum radius model
* \param[out] max_radius the resultant maximum radius model
*/
inline void
getRadiusLimits (double &min_radius, double &max_radius)
{
min_radius = radius_min_;
max_radius = radius_max_;
}
/** \brief Set the maximum distance allowed when drawing random samples
* \param[in] radius the maximum distance (L2 norm)
* \param search
*/
inline void
setSamplesMaxDist (const double &radius, SearchPtr search)
{
samples_radius_ = radius;
samples_radius_search_ = search;
}
/** \brief Get maximum distance allowed when drawing random samples
*
* \param[out] radius the maximum distance (L2 norm)
*/
inline void
getSamplesMaxDist (double &radius)
{
radius = samples_radius_;
}
/** \brief Set the axis along which we need to search for a model perpendicular to.
* \param[in] ax the axis along which we need to search for a model perpendicular to
*/
inline void
setAxis (const Eigen::Vector3f &ax) { axis_ = ax; }
/** \brief Get the axis along which we need to search for a model perpendicular to. */
inline Eigen::Vector3f
getAxis () const { return (axis_); }
/** \brief Set the angle epsilon (delta) threshold.
* \param[in] ea the maximum allowed difference between the model normal and the given axis in radians.
*/
inline void
setEpsAngle (double ea) { eps_angle_ = ea; }
/** \brief Get the epsilon (delta) model angle threshold in radians. */
inline double
getEpsAngle () const { return (eps_angle_); }
/** \brief Base method for segmentation of a model in a PointCloud given by <setInputCloud (), setIndices ()>
* \param[in] inliers the resultant point indices that support the model found (inliers)
* \param[out] model_coefficients the resultant model coefficients
*/
virtual void
segment (PointIndices &inliers, ModelCoefficients &model_coefficients);
protected:
/** \brief Initialize the Sample Consensus model and set its parameters.
* \param[in] model_type the type of SAC model that is to be used
*/
virtual bool
initSACModel (const int model_type);
/** \brief Initialize the Sample Consensus method and set its parameters.
* \param[in] method_type the type of SAC method to be used
*/
virtual void
initSAC (const int method_type);
/** \brief The model that needs to be segmented. */
SampleConsensusModelPtr model_;
/** \brief The sample consensus segmentation method. */
SampleConsensusPtr sac_;
/** \brief The type of model to use (user given parameter). */
int model_type_;
/** \brief The type of sample consensus method to use (user given parameter). */
int method_type_;
/** \brief Distance to the model threshold (user given parameter). */
double threshold_;
/** \brief Set to true if a coefficient refinement is required. */
bool optimize_coefficients_;
/** \brief The minimum and maximum radius limits for the model. Applicable to all models that estimate a radius. */
double radius_min_, radius_max_;
/** \brief The maximum distance of subsequent samples from the first (radius search) */
double samples_radius_;
/** \brief The search object for picking subsequent samples using radius search */
SearchPtr samples_radius_search_;
/** \brief The maximum allowed difference between the model normal and the given axis. */
double eps_angle_;
/** \brief The axis along which we need to search for a model perpendicular to. */
Eigen::Vector3f axis_;
/** \brief Maximum number of iterations before giving up (user given parameter). */
int max_iterations_;
/** \brief Desired probability of choosing at least one sample free from outliers (user given parameter). */
double probability_;
/** \brief Set to true if we need a random seed. */
bool random_;
/** \brief Class get name method. */
virtual std::string
getClassName () const { return ("SACSegmentation"); }
};
/** \brief @b SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods and
* models that require the use of surface normals for estimation.
* \ingroup segmentation
*/
template <typename PointT, typename PointNT>
class SACSegmentationFromNormals: public SACSegmentation<PointT>
{
using SACSegmentation<PointT>::model_;
using SACSegmentation<PointT>::model_type_;
using SACSegmentation<PointT>::radius_min_;
using SACSegmentation<PointT>::radius_max_;
using SACSegmentation<PointT>::eps_angle_;
using SACSegmentation<PointT>::axis_;
using SACSegmentation<PointT>::random_;
public:
using PCLBase<PointT>::input_;
using PCLBase<PointT>::indices_;
typedef typename SACSegmentation<PointT>::PointCloud PointCloud;
typedef typename PointCloud::Ptr PointCloudPtr;
typedef typename PointCloud::ConstPtr PointCloudConstPtr;
typedef typename pcl::PointCloud<PointNT> PointCloudN;
typedef typename PointCloudN::Ptr PointCloudNPtr;
typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
typedef typename SampleConsensus<PointT>::Ptr SampleConsensusPtr;
typedef typename SampleConsensusModel<PointT>::Ptr SampleConsensusModelPtr;
typedef typename SampleConsensusModelFromNormals<PointT, PointNT>::Ptr SampleConsensusModelFromNormalsPtr;
/** \brief Empty constructor.
* \param[in] random if true set the random seed to the current time, else set to 12345 (default: false)
*/
SACSegmentationFromNormals (bool random = false)
: SACSegmentation<PointT> (random)
, normals_ ()
, distance_weight_ (0.1)
, distance_from_origin_ (0)
, min_angle_ ()
, max_angle_ ()
{};
/** \brief Provide a pointer to the input dataset that contains the point normals of
* the XYZ dataset.
* \param[in] normals the const boost shared pointer to a PointCloud message
*/
inline void
setInputNormals (const PointCloudNConstPtr &normals) { normals_ = normals; }
/** \brief Get a pointer to the normals of the input XYZ point cloud dataset. */
inline PointCloudNConstPtr
getInputNormals () const { return (normals_); }
/** \brief 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.
* \param[in] distance_weight the distance/angular weight
*/
inline void
setNormalDistanceWeight (double distance_weight) { distance_weight_ = distance_weight; }
/** \brief 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. */
inline double
getNormalDistanceWeight () const { return (distance_weight_); }
/** \brief Set the minimum opning angle for a cone model.
* \param min_angle the opening angle which we need minumum to validate a cone model.
* \param max_angle the opening angle which we need maximum to validate a cone model.
*/
inline void
setMinMaxOpeningAngle (const double &min_angle, const double &max_angle)
{
min_angle_ = min_angle;
max_angle_ = max_angle;
}
/** \brief Get the opening angle which we need minumum to validate a cone model. */
inline void
getMinMaxOpeningAngle (double &min_angle, double &max_angle)
{
min_angle = min_angle_;
max_angle = max_angle_;
}
/** \brief Set the distance we expect a plane model to be from the origin
* \param[in] d distance from the template plane modl to the origin
*/
inline void
setDistanceFromOrigin (const double d) { distance_from_origin_ = d; }
/** \brief Get the distance of a plane model from the origin. */
inline double
getDistanceFromOrigin () const { return (distance_from_origin_); }
protected:
/** \brief A pointer to the input dataset that contains the point normals of the XYZ dataset. */
PointCloudNConstPtr normals_;
/** \brief The relative weight (between 0 and 1) to give to the angular
* distance (0 to pi/2) between point normals and the plane normal.
*/
double distance_weight_;
/** \brief The distance from the template plane to the origin. */
double distance_from_origin_;
/** \brief The minimum and maximum allowed opening angle of valid cone model. */
double min_angle_;
double max_angle_;
/** \brief Initialize the Sample Consensus model and set its parameters.
* \param[in] model_type the type of SAC model that is to be used
*/
virtual bool
initSACModel (const int model_type);
/** \brief Class get name method. */
virtual std::string
getClassName () const { return ("SACSegmentationFromNormals"); }
};
}
#ifdef PCL_NO_PRECOMPILE
#include <pcl/segmentation/impl/sac_segmentation.hpp>
#endif
#endif //#ifndef PCL_SEGMENTATION_SAC_SEGMENTATION_H_
pcl::SACSegmentation::getDistanceThreshold
double getDistanceThreshold() const
Get the distance to the model threshold.
Definition: sac_segmentation.h:143
pcl::SACSegmentation::setOptimizeCoefficients
void setOptimizeCoefficients(bool optimize)
Set to true if a coefficient refinement is required.
Definition: sac_segmentation.h:169
pcl::SACSegmentationFromNormals::min_angle_
double min_angle_
The minimum and maximum allowed opening angle of valid cone model.
Definition: sac_segmentation.h:414
pcl::SACSegmentation::getEpsAngle
double getEpsAngle() const
Get the epsilon (delta) model angle threshold in radians.
Definition: sac_segmentation.h:237
pcl::SACSegmentation::max_iterations_
int max_iterations_
Maximum number of iterations before giving up (user given parameter).
Definition: sac_segmentation.h:293
pcl::SACSegmentation::getClassName
virtual std::string getClassName() const
Class get name method.
Definition: sac_segmentation.h:303
pcl::SACSegmentationFromNormals::getClassName
virtual std::string getClassName() const
Class get name method.
Definition: sac_segmentation.h:425
pcl::SACSegmentation::random_
bool random_
Set to true if we need a random seed.
Definition: sac_segmentation.h:299
pcl::SACSegmentation::getModel
SampleConsensusModelPtr getModel() const
Get a pointer to the SAC model used.
Definition: sac_segmentation.h:123
pcl::SACSegmentation::setSamplesMaxDist
void setSamplesMaxDist(const double &radius, SearchPtr search)
Set the maximum distance allowed when drawing random samples.
Definition: sac_segmentation.h:203
pcl::SACSegmentation::setEpsAngle
void setEpsAngle(double ea)
Set the angle epsilon (delta) threshold.
Definition: sac_segmentation.h:233
pcl
Definition: cloud_iterator.h:46
pcl::SACSegmentation
SACSegmentation represents the Nodelet segmentation class for Sample Consensus methods and models...
Definition: sac_segmentation.h:65
pcl::SACSegmentationFromNormals::setInputNormals
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input dataset that contains the point normals of the XYZ dataset...
Definition: sac_segmentation.h:354
pcl::SACSegmentation::PointCloudConstPtr
PointCloud::ConstPtr PointCloudConstPtr
Definition: sac_segmentation.h:76
std
Definition: multi_grid_octree_data.hpp:45
pcl::SACSegmentation::probability_
double probability_
Desired probability of choosing at least one sample free from outliers (user given parameter)...
Definition: sac_segmentation.h:296
pcl::ModelCoefficients
Definition: ModelCoefficients.h:12
pcl::SACSegmentation::setMethodType
void setMethodType(int method)
The type of sample consensus method to use (user given parameter).
Definition: sac_segmentation.h:129
pcl::SACSegmentation::getMaxIterations
int getMaxIterations() const
Get maximum number of iterations before giving up.
Definition: sac_segmentation.h:153
pcl::SACSegmentation::SampleConsensusPtr
SampleConsensus< PointT >::Ptr SampleConsensusPtr
Definition: sac_segmentation.h:79
pcl::SACSegmentation::getMethodType
int getMethodType() const
Get the type of sample consensus method used.
Definition: sac_segmentation.h:133
pcl::SACSegmentationFromNormals::SampleConsensusModelPtr
SampleConsensusModel< PointT >::Ptr SampleConsensusModelPtr
Definition: sac_segmentation.h:334
Eigen
Definition: bfgs.h:10
pcl::SACSegmentation::setProbability
void setProbability(double probability)
Set the probability of choosing at least one sample free from outliers.
Definition: sac_segmentation.h:159
pcl::SACSegmentation::PointCloud
pcl::PointCloud< PointT > PointCloud
Definition: sac_segmentation.h:74
pcl::SACSegmentation::samples_radius_
double samples_radius_
The maximum distance of subsequent samples from the first (radius search)
Definition: sac_segmentation.h:281
pcl::SACSegmentation::initSACModel
virtual bool initSACModel(const int model_type)
Initialize the Sample Consensus model and set its parameters.
Definition: sac_segmentation.hpp:133
pcl::SACSegmentation::threshold_
double threshold_
Distance to the model threshold (user given parameter).
Definition: sac_segmentation.h:272
pcl::PointCloud::Ptr
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:428
pcl::SACSegmentationFromNormals::PointCloudNConstPtr
PointCloudN::ConstPtr PointCloudNConstPtr
Definition: sac_segmentation.h:331
pcl::SACSegmentation::radius_min_
double radius_min_
The minimum and maximum radius limits for the model.
Definition: sac_segmentation.h:278
pcl::SACSegmentationFromNormals::distance_from_origin_
double distance_from_origin_
The distance from the template plane to the origin.
Definition: sac_segmentation.h:411
pcl::SACSegmentation::getSamplesMaxDist
void getSamplesMaxDist(double &radius)
Get maximum distance allowed when drawing random samples.
Definition: sac_segmentation.h:214
pcl::SACSegmentation::radius_max_
double radius_max_
Definition: sac_segmentation.h:278
pcl::PointIndices
Definition: PointIndices.h:12
pcl::SACSegmentation::SearchPtr
pcl::search::Search< PointT >::Ptr SearchPtr
Definition: sac_segmentation.h:77
pcl::SACSegmentationFromNormals::getMinMaxOpeningAngle
void getMinMaxOpeningAngle(double &min_angle, double &max_angle)
Get the opening angle which we need minumum to validate a cone model.
Definition: sac_segmentation.h:385
pcl::SACSegmentation::PointCloudPtr
PointCloud::Ptr PointCloudPtr
Definition: sac_segmentation.h:75
pcl::SACSegmentation::model_type_
int model_type_
The type of model to use (user given parameter).
Definition: sac_segmentation.h:266
pcl::search::Search::Ptr
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
Definition: search.h:81
pcl::SACSegmentationFromNormals::getInputNormals
PointCloudNConstPtr getInputNormals() const
Get a pointer to the normals of the input XYZ point cloud dataset.
Definition: sac_segmentation.h:358
pcl::SACSegmentation::getModelType
int getModelType() const
Get the type of SAC model used.
Definition: sac_segmentation.h:115
pcl::SACSegmentationFromNormals::PointCloudN
pcl::PointCloud< PointNT > PointCloudN
Definition: sac_segmentation.h:329
pcl::SACSegmentation::model_
SampleConsensusModelPtr model_
The model that needs to be segmented.
Definition: sac_segmentation.h:260
pcl::SACSegmentation::eps_angle_
double eps_angle_
The maximum allowed difference between the model normal and the given axis.
Definition: sac_segmentation.h:287
pcl::SACSegmentationFromNormals::SACSegmentationFromNormals
SACSegmentationFromNormals(bool random=false)
Empty constructor.
Definition: sac_segmentation.h:340
pcl::SACSegmentationFromNormals::distance_weight_
double distance_weight_
The relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point norma...
Definition: sac_segmentation.h:408
pcl::SACSegmentation::samples_radius_search_
SearchPtr samples_radius_search_
The search object for picking subsequent samples using radius search.
Definition: sac_segmentation.h:284
pcl::SACSegmentation::getOptimizeCoefficients
bool getOptimizeCoefficients() const
Get the coefficient refinement internal flag.
Definition: sac_segmentation.h:173
pcl::PCLBase
PCL base class.
Definition: pcl_base.h:68
pcl::SACSegmentationFromNormals::PointCloudConstPtr
PointCloud::ConstPtr PointCloudConstPtr
Definition: sac_segmentation.h:327
pcl::SACSegmentation::axis_
Eigen::Vector3f axis_
The axis along which we need to search for a model perpendicular to.
Definition: sac_segmentation.h:290
pcl::SACSegmentation::setAxis
void setAxis(const Eigen::Vector3f &ax)
Set the axis along which we need to search for a model perpendicular to.
Definition: sac_segmentation.h:223
pcl::SACSegmentationFromNormals::SampleConsensusPtr
SampleConsensus< PointT >::Ptr SampleConsensusPtr
Definition: sac_segmentation.h:333
pcl::SACSegmentation::setRadiusLimits
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...
Definition: sac_segmentation.h:181
pcl::PointCloud::ConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:429
pcl::SACSegmentation::getProbability
double getProbability() const
Get the probability of choosing at least one sample free from outliers.
Definition: sac_segmentation.h:163
pcl::SACSegmentationFromNormals
SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods...
Definition: sac_segmentation.h:311
pcl::SACSegmentation::optimize_coefficients_
bool optimize_coefficients_
Set to true if a coefficient refinement is required.
Definition: sac_segmentation.h:275
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points. ...
Definition: projection_matrix.h:53
pcl::SACSegmentationFromNormals::PointCloudNPtr
PointCloudN::Ptr PointCloudNPtr
Definition: sac_segmentation.h:330
pcl::SACSegmentation::setModelType
void setModelType(int model)
The type of model to use (user given parameter).
Definition: sac_segmentation.h:111
pcl::SACSegmentationFromNormals::max_angle_
double max_angle_
Definition: sac_segmentation.h:415
pcl::SACSegmentationFromNormals::getDistanceFromOrigin
double getDistanceFromOrigin() const
Get the distance of a plane model from the origin.
Definition: sac_segmentation.h:399
pcl::SACSegmentation::SampleConsensusModelPtr
SampleConsensusModel< PointT >::Ptr SampleConsensusModelPtr
Definition: sac_segmentation.h:80
pcl::SACSegmentation::sac_
SampleConsensusPtr sac_
The sample consensus segmentation method.
Definition: sac_segmentation.h:263
pcl::SACSegmentation::segment
virtual void segment(PointIndices &inliers, ModelCoefficients &model_coefficients)
Base method for segmentation of a model in a PointCloud given by <setInputCloud (), setIndices ()>
Definition: sac_segmentation.hpp:75
pcl::SampleConsensusModel::Ptr
boost::shared_ptr< SampleConsensusModel > Ptr
Definition: sac_model.h:74
pcl::SACSegmentationFromNormals::SampleConsensusModelFromNormalsPtr
SampleConsensusModelFromNormals< PointT, PointNT >::Ptr SampleConsensusModelFromNormalsPtr
Definition: sac_segmentation.h:335
pcl::SACSegmentation::~SACSegmentation
virtual ~SACSegmentation()
Empty destructor.
Definition: sac_segmentation.h:105
pcl::SACSegmentation::setMaxIterations
void setMaxIterations(int max_iterations)
Set the maximum number of iterations before giving up.
Definition: sac_segmentation.h:149
pcl::SampleConsensusModelFromNormals::Ptr
boost::shared_ptr< SampleConsensusModelFromNormals > Ptr
Definition: sac_model.h:563
pcl::SACSegmentationFromNormals::setDistanceFromOrigin
void setDistanceFromOrigin(const double d)
Set the distance we expect a plane model to be from the origin.
Definition: sac_segmentation.h:395
pcl::SACSegmentationFromNormals::getNormalDistanceWeight
double getNormalDistanceWeight() const
Get the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point n...
Definition: sac_segmentation.h:370
pcl::SACSegmentation::getRadiusLimits
void getRadiusLimits(double &min_radius, double &max_radius)
Get the minimum and maximum allowable radius limits for the model as set by the user.
Definition: sac_segmentation.h:192
pcl::SACSegmentation::getAxis
Eigen::Vector3f getAxis() const
Get the axis along which we need to search for a model perpendicular to.
Definition: sac_segmentation.h:227
pcl::SACSegmentation::SACSegmentation
SACSegmentation(bool random=false)
Empty constructor.
Definition: sac_segmentation.h:85
pcl::SACSegmentationFromNormals::setMinMaxOpeningAngle
void setMinMaxOpeningAngle(const double &min_angle, const double &max_angle)
Set the minimum opning angle for a cone model.
Definition: sac_segmentation.h:377
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition: point_types.hpp:594
pcl::SACSegmentation::setDistanceThreshold
void setDistanceThreshold(double threshold)
Distance to the model threshold (user given parameter).
Definition: sac_segmentation.h:139
pcl::SACSegmentation::initSAC
virtual void initSAC(const int method_type)
Initialize the Sample Consensus method and set its parameters.
Definition: sac_segmentation.hpp:270
pcl::SACSegmentation::getMethod
SampleConsensusPtr getMethod() const
Get a pointer to the SAC method used.
Definition: sac_segmentation.h:119
pcl::SACSegmentationFromNormals::normals_
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Definition: sac_segmentation.h:403
pcl::SACSegmentationFromNormals::PointCloud
SACSegmentation< PointT >::PointCloud PointCloud
Definition: sac_segmentation.h:325
pcl::SACSegmentationFromNormals::PointCloudPtr
PointCloud::Ptr PointCloudPtr
Definition: sac_segmentation.h:326
pcl::SampleConsensus
SampleConsensus represents the base class.
Definition: sac.h:56
pcl::SACSegmentationFromNormals::setNormalDistanceWeight
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 n...
Definition: sac_segmentation.h:365
pcl::SACSegmentation::method_type_
int method_type_
The type of sample consensus method to use (user given parameter).
Definition: sac_segmentation.h:269