41 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_STICK_H_
42 #define PCL_SAMPLE_CONSENSUS_MODEL_STICK_H_
44 #include <pcl/sample_consensus/sac_model.h>
45 #include <pcl/sample_consensus/model_types.h>
46 #include <pcl/common/eigen.h>
63 template <
typename Po
intT>
79 typedef boost::shared_ptr<SampleConsensusModelStick>
Ptr;
100 const std::vector<int> &indices,
120 Eigen::VectorXf &model_coefficients)
const;
128 std::vector<double> &distances)
const;
137 const double threshold,
138 std::vector<int> &inliers);
148 const double threshold)
const;
158 const Eigen::VectorXf &model_coefficients,
159 Eigen::VectorXf &optimized_coefficients)
const;
169 const Eigen::VectorXf &model_coefficients,
170 PointCloud &projected_points,
171 bool copy_data_fields =
true)
const;
180 const Eigen::VectorXf &model_coefficients,
181 const double threshold)
const;
200 #ifdef PCL_NO_PRECOMPILE
201 #include <pcl/sample_consensus/impl/sac_model_stick.hpp>
204 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_STICK_H_
SampleConsensusModel< PointT >::PointCloud PointCloud
pcl::SacModel getModelType() const
Return an unique id for this model (SACMODEL_STICK).
This file defines compatibility wrappers for low level I/O functions.
boost::shared_ptr< SampleConsensusModelStick > Ptr
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const
Count all the points which respect the given model coefficients as inliers.
unsigned int model_size_
The number of coefficients in the model.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const
Compute all squared distances from the cloud data to a given stick model.
void projectPoints(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool copy_data_fields=true) const
Create a new point cloud with inliers projected onto the stick model.
SampleConsensusModel represents the base model class.
std::string model_name_
The model name.
pcl::PointCloud< PointT >::Ptr PointCloudPtr
bool isSampleGood(const std::vector< int > &samples) const
Check if a sample of indices results in a good sample of points indices.
SampleConsensusModelStick defines a model for 3D stick segmentation.
bool doSamplesVerifyModel(const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, const double threshold) const
Verify whether a subset of indices verifies the given stick model coefficients.
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, std::vector< int > &inliers)
Select all the points which respect the given model coefficients as inliers.
SampleConsensusModelStick(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelStick.
pcl::PointCloud< PointT >::ConstPtr PointCloudConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const
Recompute the stick coefficients using the given inlier set and return them to the user...
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients) const
Check whether the given index samples can form a valid stick model, compute the model coefficients fr...
SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
virtual ~SampleConsensusModelStick()
Empty destructor.
unsigned int sample_size_
The size of a sample from which the model is computed.
SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
SampleConsensusModelStick(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelStick.