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);
124 std::vector<double> &distances);
133 const double threshold,
134 std::vector<int> &inliers);
144 const double threshold);
154 const Eigen::VectorXf &model_coefficients,
155 Eigen::VectorXf &optimized_coefficients);
165 const Eigen::VectorXf &model_coefficients,
166 PointCloud &projected_points,
167 bool copy_data_fields =
true);
176 const Eigen::VectorXf &model_coefficients,
177 const double threshold);
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
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients)
Check whether the given index samples can form a valid line model, compute the model coefficients fro...
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.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances)
Compute all squared distances from the cloud data to a given line model.
bool doSamplesVerifyModel(const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, const double threshold)
Verify whether a subset of indices verifies the given line model coefficients.
unsigned int model_size_
The number of coefficients in the model.
SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold)
Count all the points which respect the given model coefficients as inliers.
SampleConsensusModelLine(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelLine.
SampleConsensusModel represents the base model class.
std::string model_name_
The model name.
pcl::PointCloud< PointT >::Ptr PointCloudPtr
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients)
Recompute the line coefficients using the given inlier set and return them to the user...
boost::shared_ptr< SampleConsensusModelLine > Ptr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
pcl::PointCloud< PointT >::ConstPtr PointCloudConstPtr
void projectPoints(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool copy_data_fields=true)
Create a new point cloud with inliers projected onto the line model.
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.
pcl::SacModel getModelType() const
Return an unique id for this model (SACMODEL_LINE).
A point structure representing Euclidean xyz coordinates, and the RGB color.
virtual ~SampleConsensusModelLine()
Empty destructor.
bool isSampleGood(const std::vector< int > &samples) const
Check if a sample of indices results in a good sample of points indices.
unsigned int sample_size_
The size of a sample from which the model is computed.