41 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_LINE_H_
42 #define PCL_SAMPLE_CONSENSUS_MODEL_LINE_H_
44 #include <pcl/sample_consensus/sac_model.h>
45 #include <pcl/sample_consensus/model_types.h>
46 #include <pcl/common/eigen.h>
62 template <
typename Po
intT>
76 typedef boost::shared_ptr<SampleConsensusModelLine>
Ptr;
96 const std::vector<int> &indices,
116 Eigen::VectorXf &model_coefficients)
const;
124 std::vector<double> &distances)
const;
133 const double threshold,
134 std::vector<int> &inliers);
144 const double threshold)
const;
154 const Eigen::VectorXf &model_coefficients,
155 Eigen::VectorXf &optimized_coefficients)
const;
165 const Eigen::VectorXf &model_coefficients,
166 PointCloud &projected_points,
167 bool copy_data_fields =
true)
const;
176 const Eigen::VectorXf &model_coefficients,
177 const double threshold)
const;
196 #ifdef PCL_NO_PRECOMPILE
197 #include <pcl/sample_consensus/impl/sac_model_line.hpp>
200 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_LINE_H_
SampleConsensusModel< PointT >::PointCloud PointCloud
SampleConsensusModelLine defines a model for 3D line segmentation.
SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
SampleConsensusModelLine(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelLine.
This file defines compatibility wrappers for low level I/O functions.
unsigned int model_size_
The number of coefficients in the model.
SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
SampleConsensusModelLine(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelLine.
SampleConsensusModel represents the base model class.
bool isSampleGood(const std::vector< int > &samples) const
Check if a sample of indices results in a good sample of points indices.
std::string model_name_
The model name.
pcl::PointCloud< PointT >::Ptr PointCloudPtr
boost::shared_ptr< SampleConsensusModelLine > Ptr
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients) const
Check whether the given index samples can form a valid line model, compute the model coefficients fro...
pcl::SacModel getModelType() const
Return an unique id for this model (SACMODEL_LINE).
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 line model coefficients.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const
Compute all squared distances from the cloud data to a given line model.
pcl::PointCloud< PointT >::ConstPtr PointCloudConstPtr
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const
Recompute the line coefficients using the given inlier set and return them to the user...
PointCloud represents the base class in PCL for storing collections of 3D points. ...
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 line model.
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const
Count all the points which respect the given model coefficients as inliers.
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.
A point structure representing Euclidean xyz coordinates, and the RGB color.
virtual ~SampleConsensusModelLine()
Empty destructor.
unsigned int sample_size_
The size of a sample from which the model is computed.