40 #ifndef PCL_SEGMENTATION_SAC_SEGMENTATION_H_
41 #define PCL_SEGMENTATION_SAC_SEGMENTATION_H_
43 #include <pcl/pcl_base.h>
44 #include <pcl/PointIndices.h>
45 #include <pcl/ModelCoefficients.h>
48 #include <pcl/sample_consensus/method_types.h>
49 #include <pcl/sample_consensus/sac.h>
51 #include <pcl/sample_consensus/model_types.h>
52 #include <pcl/sample_consensus/sac_model.h>
54 #include <pcl/search/search.h>
64 template <
typename Po
intT>
92 ,
radius_min_ (-std::numeric_limits<double>::max ())
97 ,
axis_ (Eigen::Vector3f::Zero ())
225 inline Eigen::Vector3f
256 initSAC (
const int method_type);
309 template <
typename Po
intT,
typename Po
intNT>
427 #ifdef PCL_NO_PRECOMPILE
428 #include <pcl/segmentation/impl/sac_segmentation.hpp>
431 #endif //#ifndef PCL_SEGMENTATION_SAC_SEGMENTATION_H_
double distance_weight_
The relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point norma...
void setModelType(int model)
The type of model to use (user given parameter).
SACSegmentation< PointT >::PointCloud PointCloud
SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods...
PointCloudN::ConstPtr PointCloudNConstPtr
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
double distance_from_origin_
The distance from the template plane to the origin.
PointCloudNConstPtr getInputNormals() const
Get a pointer to the normals of the input XYZ point cloud dataset.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
int max_iterations_
Maximum number of iterations before giving up (user given parameter).
Eigen::Vector3f axis_
The axis along which we need to search for a model perpendicular to.
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...
virtual std::string getClassName() const
Class get name method.
pcl::search::Search< PointT >::Ptr SearchPtr
void getMinMaxOpeningAngle(double &min_angle, double &max_angle)
Get the opening angle which we need minumum to validate a cone model.
double min_angle_
The minimum and maximum allowed opening angle of valid cone model.
boost::shared_ptr< PointCloud< PointT > > Ptr
double getProbability() const
Get the probability of choosing at least one sample free from outliers.
boost::shared_ptr< SampleConsensusModel > Ptr
double radius_min_
The minimum and maximum radius limits for the model.
SampleConsensus< PointT >::Ptr SampleConsensusPtr
void setMinMaxOpeningAngle(const double &min_angle, const double &max_angle)
Set the minimum opning angle for a cone model.
void setEpsAngle(double ea)
Set the angle epsilon (delta) threshold.
virtual bool initSACModel(const int model_type)
Initialize the Sample Consensus model and set its parameters.
void setMaxIterations(int max_iterations)
Set the maximum number of iterations before giving up.
SACSegmentationFromNormals(bool random=false)
Empty constructor.
SampleConsensusModel< PointT >::Ptr SampleConsensusModelPtr
virtual ~SACSegmentation()
Empty destructor.
SACSegmentation(bool random=false)
Empty constructor.
void setOptimizeCoefficients(bool optimize)
Set to true if a coefficient refinement is required.
SACSegmentation represents the Nodelet segmentation class for Sample Consensus methods and models...
SampleConsensusPtr sac_
The sample consensus segmentation method.
double eps_angle_
The maximum allowed difference between the model normal and the given axis.
SampleConsensusModelPtr model_
The model that needs to be segmented.
void getRadiusLimits(double &min_radius, double &max_radius)
Get the minimum and maximum allowable radius limits for the model as set by the user.
double getEpsAngle() const
Get the epsilon (delta) model angle threshold in radians.
double threshold_
Distance to the model threshold (user given parameter).
virtual void initSAC(const int method_type)
Initialize the Sample Consensus method and set its parameters.
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...
PointCloud::ConstPtr PointCloudConstPtr
double getDistanceThreshold() const
Get the distance to the model threshold.
void setAxis(const Eigen::Vector3f &ax)
Set the axis along which we need to search for a model perpendicular to.
int method_type_
The type of sample consensus method to use (user given parameter).
SampleConsensusPtr getMethod() const
Get a pointer to the SAC method used.
PointCloud::Ptr PointCloudPtr
double getNormalDistanceWeight() const
Get the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point n...
SampleConsensusModelFromNormals< PointT, PointNT >::Ptr SampleConsensusModelFromNormalsPtr
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input dataset that contains the point normals of the XYZ dataset...
void setSamplesMaxDist(const double &radius, SearchPtr search)
Set the maximum distance allowed when drawing random samples.
PointCloud::ConstPtr PointCloudConstPtr
void setMethodType(int method)
The type of sample consensus method to use (user given parameter).
SearchPtr samples_radius_search_
The search object for picking subsequent samples using radius search.
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
SampleConsensus represents the base class.
PointCloudN::Ptr PointCloudNPtr
int getMethodType() const
Get the type of sample consensus method used.
void setProbability(double probability)
Set the probability of choosing at least one sample free from outliers.
void getSamplesMaxDist(double &radius)
Get maximum distance allowed when drawing random samples.
double samples_radius_
The maximum distance of subsequent samples from the first (radius search)
int getMaxIterations() const
Get maximum number of iterations before giving up.
bool random_
Set to true if we need a random seed.
bool optimize_coefficients_
Set to true if a coefficient refinement is required.
pcl::PointCloud< PointT > PointCloud
void setDistanceFromOrigin(const double d)
Set the distance we expect a plane model to be from the origin.
A point structure representing Euclidean xyz coordinates, and the RGB color.
double probability_
Desired probability of choosing at least one sample free from outliers (user given parameter)...
double getDistanceFromOrigin() const
Get the distance of a plane model from the origin.
virtual bool initSACModel(const int model_type)
Initialize the Sample Consensus model and set its parameters.
SampleConsensusModel< PointT >::Ptr SampleConsensusModelPtr
SampleConsensusModelPtr getModel() const
Get a pointer to the SAC model used.
bool getOptimizeCoefficients() const
Get the coefficient refinement internal flag.
virtual void segment(PointIndices &inliers, ModelCoefficients &model_coefficients)
Base method for segmentation of a model in a PointCloud given by <setInputCloud (), setIndices ()>
Eigen::Vector3f getAxis() const
Get the axis along which we need to search for a model perpendicular to.
PointCloud::Ptr PointCloudPtr
SampleConsensus< PointT >::Ptr SampleConsensusPtr
int getModelType() const
Get the type of SAC model used.
void setDistanceThreshold(double threshold)
Distance to the model threshold (user given parameter).
int model_type_
The type of model to use (user given parameter).
boost::shared_ptr< SampleConsensusModelFromNormals > Ptr
pcl::PointCloud< PointNT > PointCloudN
virtual std::string getClassName() const
Class get name method.