43 #include <pcl/sample_consensus/sac_model.h>
44 #include <pcl/sample_consensus/model_types.h>
45 #include <pcl/common/eigen.h>
63 template <
typename Po
intT>
79 using Ptr = shared_ptr<SampleConsensusModelStick<PointT> >;
80 using ConstPtr = shared_ptr<const SampleConsensusModelStick<PointT>>;
101 const Indices &indices,
121 Eigen::VectorXf &model_coefficients)
const override;
129 std::vector<double> &distances)
const override;
138 const double threshold,
139 Indices &inliers)
override;
149 const double threshold)
const override;
159 const Eigen::VectorXf &model_coefficients,
160 Eigen::VectorXf &optimized_coefficients)
const override;
170 const Eigen::VectorXf &model_coefficients,
172 bool copy_data_fields =
true)
const override;
181 const Eigen::VectorXf &model_coefficients,
182 const double threshold)
const override;
201 #ifdef PCL_NO_PRECOMPILE
202 #include <pcl/sample_consensus/impl/sac_model_stick.hpp>
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const override
Compute all squared distances from the cloud data to a given stick model.
pcl::SacModel getModelType() const override
Return a unique id for this model (SACMODEL_STICK).
unsigned int model_size_
The number of coefficients in the model.
bool computeModelCoefficients(const Indices &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid stick model, compute the model coefficients fr...
bool isSampleGood(const Indices &samples) const override
Check if a sample of indices results in a good sample of points indices.
typename PointCloud::Ptr PointCloudPtr
void projectPoints(const Indices &inliers, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool copy_data_fields=true) const override
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.
typename PointCloud::ConstPtr PointCloudConstPtr
SampleConsensusModelStick defines a model for 3D stick segmentation.
SampleConsensusModelStick(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelStick.
bool doSamplesVerifyModel(const std::set< index_t > &indices, const Eigen::VectorXf &model_coefficients, const double threshold) const override
Verify whether a subset of indices verifies the given stick model coefficients.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
shared_ptr< const SampleConsensusModel< PointT > > ConstPtr
std::size_t countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const override
Count all the points which respect the given model coefficients as inliers.
~SampleConsensusModelStick()
Empty destructor.
SampleConsensusModelStick(const PointCloudConstPtr &cloud, const Indices &indices, bool random=false)
Constructor for base SampleConsensusModelStick.
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, Indices &inliers) override
Select all the points which respect the given model coefficients as inliers.
void optimizeModelCoefficients(const Indices &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const override
Recompute the stick coefficients using the given inlier set and return them to the user...
A point structure representing Euclidean xyz coordinates, and the RGB color.
shared_ptr< SampleConsensusModel< PointT > > Ptr
unsigned int sample_size_
The size of a sample from which the model is computed.