43#include <pcl/sample_consensus/sac_model.h>
44#include <pcl/sample_consensus/model_types.h>
60 template <
typename Po
intT>
123 std::vector<double> &distances)
const override;
132 const double threshold,
143 const double threshold)
const override;
176 const double threshold)
const override;
195#ifdef PCL_NO_PRECOMPILE
196#include <pcl/sample_consensus/impl/sac_model_line.hpp>
Iterator class for point clouds with or without given indices.
PointCloud represents the base class in PCL for storing collections of 3D points.
SampleConsensusModel represents the base model class.
unsigned int sample_size_
The size of a sample from which the model is computed.
typename PointCloud::ConstPtr PointCloudConstPtr
IndicesPtr indices_
A pointer to the vector of point indices to use.
PointCloudConstPtr input_
A boost shared pointer to the point cloud data array.
virtual bool isModelValid(const Eigen::VectorXf &model_coefficients) const
Check whether a model is valid given the user constraints.
std::string model_name_
The model name.
unsigned int model_size_
The number of coefficients in the model.
typename PointCloud::Ptr PointCloudPtr
std::vector< double > error_sqr_dists_
A vector holding the distances to the computed model.
SampleConsensusModelLine defines a model for 3D line segmentation.
typename SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
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.
typename SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
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.
typename SampleConsensusModel< PointT >::PointCloud PointCloud
~SampleConsensusModelLine()
Empty destructor.
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.