Loading...
Searching...
No Matches
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$
*
*/
#pragma once
#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_;
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;
/** \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)
: random_(random)
{}
/** \brief Empty destructor. */
~SACSegmentation () override = default;
/** \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 the number of threads to use or turn off parallelization.
* \param[in] nr_threads the number of hardware threads to use (0 sets the value automatically, a negative number turns parallelization off)
* \note Not all SAC methods have a parallel implementation. Some will ignore this setting.
*/
inline void
setNumberOfThreads (const int nr_threads = -1) { threads_ = nr_threads; }
/** \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[out] 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_{nullptr};
/** \brief The sample consensus segmentation method. */
SampleConsensusPtr sac_{nullptr};
/** \brief The type of model to use (user given parameter). */
int model_type_{-1};
/** \brief The type of sample consensus method to use (user given parameter). */
int method_type_{0};
/** \brief Distance to the model threshold (user given parameter). */
double threshold_{0.0};
/** \brief Set to true if a coefficient refinement is required. */
bool optimize_coefficients_{true};
/** \brief The minimum and maximum radius limits for the model. Applicable to all models that estimate a radius. */
double radius_min_{-std::numeric_limits<double>::max()}, radius_max_{std::numeric_limits<double>::max()};
/** \brief The maximum distance of subsequent samples from the first (radius search) */
double samples_radius_{0.0};
/** \brief The search object for picking subsequent samples using radius search */
SearchPtr samples_radius_search_{nullptr};
/** \brief The maximum allowed difference between the model normal and the given axis. */
double eps_angle_{0.0};
/** \brief The axis along which we need to search for a model perpendicular to. */
Eigen::Vector3f axis_{Eigen::Vector3f::Zero()};
/** \brief Maximum number of iterations before giving up (user given parameter). */
int max_iterations_{50};
/** \brief The number of threads the scheduler should use, or a negative number if no parallelization is wanted. */
int threads_{-1};
/** \brief Desired probability of choosing at least one sample free from outliers (user given parameter). */
double probability_{0.99};
/** \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_;
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;
/** \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)
{};
/** \brief Provide a pointer to the input dataset that contains the point normals of
* the XYZ dataset.
* \param[in] normals the const 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 minimum 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 minimum 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 model 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_{nullptr};
/** \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_{0.1};
/** \brief The distance from the template plane to the origin. */
double distance_from_origin_{0.0};
/** \brief The minimum and maximum allowed opening angle of valid cone model. */
double min_angle_{0.0};
double max_angle_{M_PI_2};
/** \brief Initialize the Sample Consensus model and set its parameters.
* \param[in] model_type the type of SAC model that is to be used
*/
bool
initSACModel (const int model_type) override;
/** \brief Class get name method. */
std::string
getClassName () const override { return ("SACSegmentationFromNormals"); }
};
}
#ifdef PCL_NO_PRECOMPILE
#include <pcl/segmentation/impl/sac_segmentation.hpp>
#endif
pcl::PCLBase
PCL base class.
Definition pcl_base.h:70
pcl::PCLBase::input_
PointCloudConstPtr input_
The input point cloud dataset.
Definition pcl_base.h:147
pcl::PCLBase::indices_
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition pcl_base.h:150
pcl::PCLBase::initCompute
bool initCompute()
This method should get called before starting the actual computation.
Definition pcl_base.hpp:138
pcl::PCLBase::deinitCompute
bool deinitCompute()
This method should get called after finishing the actual computation.
Definition pcl_base.hpp:175
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition point_cloud.h:173
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition point_cloud.h:413
pcl::PointCloud::ConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition point_cloud.h:414
pcl::SACSegmentationFromNormals
SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods...
Definition sac_segmentation.h:306
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:397
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:343
pcl::SACSegmentationFromNormals::PointCloudConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
Definition sac_segmentation.h:321
pcl::SACSegmentationFromNormals::min_angle_
double min_angle_
The minimum and maximum allowed opening angle of valid cone model.
Definition sac_segmentation.h:403
pcl::SACSegmentationFromNormals::getInputNormals
PointCloudNConstPtr getInputNormals() const
Get a pointer to the normals of the input XYZ point cloud dataset.
Definition sac_segmentation.h:347
pcl::SACSegmentationFromNormals::max_angle_
double max_angle_
Definition sac_segmentation.h:404
pcl::SACSegmentationFromNormals::PointCloudNConstPtr
typename PointCloudN::ConstPtr PointCloudNConstPtr
Definition sac_segmentation.h:325
pcl::SACSegmentationFromNormals::getMinMaxOpeningAngle
void getMinMaxOpeningAngle(double &min_angle, double &max_angle)
Get the opening angle which we need minimum to validate a cone model.
Definition sac_segmentation.h:374
pcl::SACSegmentationFromNormals::getClassName
std::string getClassName() const override
Class get name method.
Definition sac_segmentation.h:414
pcl::SACSegmentationFromNormals::SACSegmentationFromNormals
SACSegmentationFromNormals(bool random=false)
Empty constructor.
Definition sac_segmentation.h:334
pcl::SACSegmentationFromNormals::initSACModel
bool initSACModel(const int model_type) override
Initialize the Sample Consensus model and set its parameters.
Definition sac_segmentation.hpp:375
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:366
pcl::SACSegmentationFromNormals::normals_
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Definition sac_segmentation.h:392
pcl::SACSegmentationFromNormals::distance_from_origin_
double distance_from_origin_
The distance from the template plane to the origin.
Definition sac_segmentation.h:400
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:384
pcl::SACSegmentationFromNormals::SampleConsensusModelPtr
typename SampleConsensusModel< PointT >::Ptr SampleConsensusModelPtr
Definition sac_segmentation.h:328
pcl::SACSegmentationFromNormals::SampleConsensusModelFromNormalsPtr
typename SampleConsensusModelFromNormals< PointT, PointNT >::Ptr SampleConsensusModelFromNormalsPtr
Definition sac_segmentation.h:329
pcl::SACSegmentationFromNormals::getDistanceFromOrigin
double getDistanceFromOrigin() const
Get the distance of a plane model from the origin.
Definition sac_segmentation.h:388
pcl::SACSegmentationFromNormals::PointCloudPtr
typename PointCloud::Ptr PointCloudPtr
Definition sac_segmentation.h:320
pcl::SACSegmentationFromNormals::PointCloudNPtr
typename PointCloudN::Ptr PointCloudNPtr
Definition sac_segmentation.h:324
pcl::SACSegmentationFromNormals::SampleConsensusPtr
typename SampleConsensus< PointT >::Ptr SampleConsensusPtr
Definition sac_segmentation.h:327
pcl::SACSegmentationFromNormals::PointCloud
typename SACSegmentation< PointT >::PointCloud PointCloud
Definition sac_segmentation.h:319
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:359
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:354
pcl::SACSegmentation
SACSegmentation represents the Nodelet segmentation class for Sample Consensus methods and models,...
Definition sac_segmentation.h:65
pcl::SACSegmentation::getMethodType
int getMethodType() const
Get the type of sample consensus method used.
Definition sac_segmentation.h:117
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:172
pcl::SACSegmentation::model_
SampleConsensusModelPtr model_
The model that needs to be segmented.
Definition sac_segmentation.h:251
pcl::SACSegmentation::radius_max_
double radius_max_
Definition sac_segmentation.h:269
pcl::SACSegmentation::~SACSegmentation
~SACSegmentation() override=default
Empty destructor.
pcl::SACSegmentation::setMethodType
void setMethodType(int method)
The type of sample consensus method to use (user given parameter).
Definition sac_segmentation.h:113
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:214
pcl::SACSegmentation::initSAC
virtual void initSAC(const int method_type)
Initialize the Sample Consensus method and set its parameters.
Definition sac_segmentation.hpp:298
pcl::SACSegmentation::probability_
double probability_
Desired probability of choosing at least one sample free from outliers (user given parameter).
Definition sac_segmentation.h:290
pcl::SACSegmentation::getDistanceThreshold
double getDistanceThreshold() const
Get the distance to the model threshold.
Definition sac_segmentation.h:127
pcl::SACSegmentation::getProbability
double getProbability() const
Get the probability of choosing at least one sample free from outliers.
Definition sac_segmentation.h:147
pcl::SACSegmentation::model_type_
int model_type_
The type of model to use (user given parameter).
Definition sac_segmentation.h:257
pcl::SACSegmentation::setMaxIterations
void setMaxIterations(int max_iterations)
Set the maximum number of iterations before giving up.
Definition sac_segmentation.h:133
pcl::SACSegmentation::segment
virtual void segment(PointIndices &inliers, ModelCoefficients &model_coefficients)
Base method for segmentation of a model in a PointCloud given by <setInputCloud (),...
Definition sac_segmentation.hpp:80
pcl::SACSegmentation::getOptimizeCoefficients
bool getOptimizeCoefficients() const
Get the coefficient refinement internal flag.
Definition sac_segmentation.h:164
pcl::SACSegmentation::getMethod
SampleConsensusPtr getMethod() const
Get a pointer to the SAC method used.
Definition sac_segmentation.h:103
pcl::SACSegmentation::setProbability
void setProbability(double probability)
Set the probability of choosing at least one sample free from outliers.
Definition sac_segmentation.h:143
pcl::SACSegmentation::initSACModel
virtual bool initSACModel(const int model_type)
Initialize the Sample Consensus model and set its parameters.
Definition sac_segmentation.hpp:138
pcl::SACSegmentation::setEpsAngle
void setEpsAngle(double ea)
Set the angle epsilon (delta) threshold.
Definition sac_segmentation.h:224
pcl::SACSegmentation::random_
bool random_
Set to true if we need a random seed.
Definition sac_segmentation.h:293
pcl::SACSegmentation::sac_
SampleConsensusPtr sac_
The sample consensus segmentation method.
Definition sac_segmentation.h:254
pcl::SACSegmentation::SampleConsensusModelPtr
typename SampleConsensusModel< PointT >::Ptr SampleConsensusModelPtr
Definition sac_segmentation.h:79
pcl::SACSegmentation::radius_min_
double radius_min_
The minimum and maximum radius limits for the model.
Definition sac_segmentation.h:269
pcl::SACSegmentation::getClassName
virtual std::string getClassName() const
Class get name method.
Definition sac_segmentation.h:297
pcl::SACSegmentation::PointCloudPtr
typename PointCloud::Ptr PointCloudPtr
Definition sac_segmentation.h:74
pcl::SACSegmentation::samples_radius_search_
SearchPtr samples_radius_search_
The search object for picking subsequent samples using radius search.
Definition sac_segmentation.h:275
pcl::SACSegmentation::getEpsAngle
double getEpsAngle() const
Get the epsilon (delta) model angle threshold in radians.
Definition sac_segmentation.h:228
pcl::SACSegmentation::getSamplesMaxDist
void getSamplesMaxDist(double &radius)
Get maximum distance allowed when drawing random samples.
Definition sac_segmentation.h:205
pcl::SACSegmentation::getModelType
int getModelType() const
Get the type of SAC model used.
Definition sac_segmentation.h:99
pcl::SACSegmentation::setModelType
void setModelType(int model)
The type of model to use (user given parameter).
Definition sac_segmentation.h:95
pcl::SACSegmentation::setDistanceThreshold
void setDistanceThreshold(double threshold)
Distance to the model threshold (user given parameter).
Definition sac_segmentation.h:123
pcl::SACSegmentation::SearchPtr
typename pcl::search::Search< PointT >::Ptr SearchPtr
Definition sac_segmentation.h:76
pcl::SACSegmentation::axis_
Eigen::Vector3f axis_
The axis along which we need to search for a model perpendicular to.
Definition sac_segmentation.h:281
pcl::SACSegmentation::optimize_coefficients_
bool optimize_coefficients_
Set to true if a coefficient refinement is required.
Definition sac_segmentation.h:266
pcl::SACSegmentation::setNumberOfThreads
void setNumberOfThreads(const int nr_threads=-1)
Set the number of threads to use or turn off parallelization.
Definition sac_segmentation.h:154
pcl::SACSegmentation::eps_angle_
double eps_angle_
The maximum allowed difference between the model normal and the given axis.
Definition sac_segmentation.h:278
pcl::SACSegmentation::getModel
SampleConsensusModelPtr getModel() const
Get a pointer to the SAC model used.
Definition sac_segmentation.h:107
pcl::SACSegmentation::setSamplesMaxDist
void setSamplesMaxDist(const double &radius, SearchPtr search)
Set the maximum distance allowed when drawing random samples.
Definition sac_segmentation.h:194
pcl::SACSegmentation::setOptimizeCoefficients
void setOptimizeCoefficients(bool optimize)
Set to true if a coefficient refinement is required.
Definition sac_segmentation.h:160
pcl::SACSegmentation::samples_radius_
double samples_radius_
The maximum distance of subsequent samples from the first (radius search)
Definition sac_segmentation.h:272
pcl::SACSegmentation::SampleConsensusPtr
typename SampleConsensus< PointT >::Ptr SampleConsensusPtr
Definition sac_segmentation.h:78
pcl::SACSegmentation::getMaxIterations
int getMaxIterations() const
Get maximum number of iterations before giving up.
Definition sac_segmentation.h:137
pcl::SACSegmentation::SACSegmentation
SACSegmentation(bool random=false)
Empty constructor.
Definition sac_segmentation.h:84
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:183
pcl::SACSegmentation::PointCloud
pcl::PointCloud< PointT > PointCloud
Definition sac_segmentation.h:73
pcl::SACSegmentation::method_type_
int method_type_
The type of sample consensus method to use (user given parameter).
Definition sac_segmentation.h:260
pcl::SACSegmentation::threshold_
double threshold_
Distance to the model threshold (user given parameter).
Definition sac_segmentation.h:263
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:218
pcl::SACSegmentation::max_iterations_
int max_iterations_
Maximum number of iterations before giving up (user given parameter).
Definition sac_segmentation.h:284
pcl::SACSegmentation::threads_
int threads_
The number of threads the scheduler should use, or a negative number if no parallelization is wanted.
Definition sac_segmentation.h:287
pcl::SACSegmentation::PointCloudConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
Definition sac_segmentation.h:75
pcl::SampleConsensus::Ptr
shared_ptr< SampleConsensus< T > > Ptr
Definition sac.h:69
pcl::SampleConsensusModelFromNormals::Ptr
shared_ptr< SampleConsensusModelFromNormals< PointT, PointNT > > Ptr
Definition sac_model.h:618
pcl::SampleConsensusModel::Ptr
shared_ptr< SampleConsensusModel< PointT > > Ptr
Definition sac_model.h:78
pcl::search::Search::Ptr
shared_ptr< pcl::search::Search< PointT > > Ptr
Definition search.h:81
pcl
Definition convolution.h:46
M_PI_2
#define M_PI_2
Definition pcl_macros.h:202
pcl::ModelCoefficients
Definition ModelCoefficients.h:12
pcl::PointIndices
Definition PointIndices.h:12
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition point_types.hpp:623