43 #include <pcl/sample_consensus/sac_model.h>
44 #include <pcl/sample_consensus/model_types.h>
63 template <
typename Po
intT>
64 #ifdef SAC_MODEL_STICK_DONT_WARN_DEPRECATED
65 class SampleConsensusModelStick :
public SampleConsensusModel<PointT>
83 using Ptr = shared_ptr<SampleConsensusModelStick<PointT> >;
84 using ConstPtr = shared_ptr<const SampleConsensusModelStick<PointT>>;
125 Eigen::VectorXf &model_coefficients)
const override;
133 std::vector<double> &distances)
const override;
142 const double threshold,
153 const double threshold)
const override;
163 const Eigen::VectorXf &model_coefficients,
164 Eigen::VectorXf &optimized_coefficients)
const override;
174 const Eigen::VectorXf &model_coefficients,
176 bool copy_data_fields =
true)
const override;
185 const Eigen::VectorXf &model_coefficients,
186 const double threshold)
const override;
205 #ifdef PCL_NO_PRECOMPILE
206 #include <pcl/sample_consensus/impl/sac_model_stick.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
SampleConsensusModel represents the base model class.
shared_ptr< SampleConsensusModel< PointT > > Ptr
unsigned int sample_size_
The size of a sample from which the model is computed.
typename PointCloud::ConstPtr PointCloudConstPtr
std::string model_name_
The model name.
unsigned int model_size_
The number of coefficients in the model.
typename PointCloud::Ptr PointCloudPtr
shared_ptr< const SampleConsensusModel< PointT > > ConstPtr
SampleConsensusModelStick defines a model for 3D stick segmentation.
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.
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.
SampleConsensusModelStick(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelStick.
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...
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.
~SampleConsensusModelStick() override=default
Empty destructor.
pcl::SacModel getModelType() const override
Return a unique id for this model (SACMODEL_STICK).
bool isSampleGood(const Indices &samples) const override
Check if a sample of indices results in a good sample of points indices.
SampleConsensusModelStick(const PointCloudConstPtr &cloud, const Indices &indices, bool random=false)
Constructor for base SampleConsensusModelStick.
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.
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.
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.
IndicesAllocator<> Indices
Type used for indices in PCL.
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
A point structure representing Euclidean xyz coordinates, and the RGB color.