43 #include <pcl/sample_consensus/sac_model.h>
44 #include <pcl/sample_consensus/model_types.h>
60 template <
typename Po
intT>
74 using Ptr = shared_ptr<SampleConsensusModelLine<PointT> >;
75 using ConstPtr = shared_ptr<const SampleConsensusModelLine<PointT>>;
115 Eigen::VectorXf &model_coefficients)
const override;
123 std::vector<double> &distances)
const override;
132 const double threshold,
143 const double threshold)
const override;
153 const Eigen::VectorXf &model_coefficients,
154 Eigen::VectorXf &optimized_coefficients)
const override;
164 const Eigen::VectorXf &model_coefficients,
166 bool copy_data_fields =
true)
const override;
175 const Eigen::VectorXf &model_coefficients,
176 const double threshold)
const override;
195 #ifdef PCL_NO_PRECOMPILE
196 #include <pcl/sample_consensus/impl/sac_model_line.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
SampleConsensusModelLine defines a model for 3D line segmentation.
bool computeModelCoefficients(const Indices &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid line model, compute the model coefficients fro...
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 getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const override
Compute all squared distances from the cloud data to a given line model.
SampleConsensusModelLine(const PointCloudConstPtr &cloud, const Indices &indices, bool random=false)
Constructor for base SampleConsensusModelLine.
bool isSampleGood(const Indices &samples) const override
Check if a sample of indices results in a good sample of points indices.
pcl::SacModel getModelType() const override
Return a unique id for this model (SACMODEL_LINE).
SampleConsensusModelLine(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelLine.
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 line model coefficients.
void optimizeModelCoefficients(const Indices &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const override
Recompute the line coefficients using the given inlier set and return them to the user.
~SampleConsensusModelLine() override=default
Empty destructor.
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 line model.
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.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.