41 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_STICK_H_
42 #define PCL_SAMPLE_CONSENSUS_MODEL_STICK_H_
44 #include <pcl/sample_consensus/sac_model.h>
45 #include <pcl/sample_consensus/model_types.h>
46 #include <pcl/common/eigen.h>
63 template <
typename Po
intT>
77 typedef boost::shared_ptr<SampleConsensusModelStick>
Ptr;
93 const std::vector<int> &indices,
108 Eigen::VectorXf &model_coefficients);
116 std::vector<double> &distances);
125 const double threshold,
126 std::vector<int> &inliers);
136 const double threshold);
146 const Eigen::VectorXf &model_coefficients,
147 Eigen::VectorXf &optimized_coefficients);
157 const Eigen::VectorXf &model_coefficients,
158 PointCloud &projected_points,
159 bool copy_data_fields =
true);
168 const Eigen::VectorXf &model_coefficients,
169 const double threshold);
182 if (model_coefficients.size () != 7)
184 PCL_ERROR (
"[pcl::SampleConsensusModelStick::selectWithinDistance] Invalid number of model coefficients given (%lu)!\n", model_coefficients.size ());
200 #ifdef PCL_NO_PRECOMPILE
201 #include <pcl/sample_consensus/impl/sac_model_stick.hpp>
204 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_STICK_H_
SampleConsensusModel< PointT >::PointCloud PointCloud
pcl::SacModel getModelType() const
Return an unique id for this model (SACMODEL_STACK).
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients)
Recompute the stick coefficients using the given inlier set and return them to the user...
boost::shared_ptr< SampleConsensusModelStick > Ptr
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients)
Check whether the given index samples can form a valid stick model, compute the model coefficients fr...
bool doSamplesVerifyModel(const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, const double threshold)
Verify whether a subset of indices verifies the given stick model coefficients.
bool isModelValid(const Eigen::VectorXf &model_coefficients)
Check whether a model is valid given the user constraints.
SampleConsensusModel represents the base model class.
pcl::PointCloud< PointT >::Ptr PointCloudPtr
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances)
Compute all squared distances from the cloud data to a given stick model.
bool isSampleGood(const std::vector< int > &samples) const
Check if a sample of indices results in a good sample of points indices.
SampleConsensusModelStick defines a model for 3D stick segmentation.
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.
SampleConsensusModelStick(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelStick.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
pcl::PointCloud< PointT >::ConstPtr PointCloudConstPtr
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold)
Count all the points which respect the given model coefficients as inliers.
SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
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 stick model.
virtual ~SampleConsensusModelStick()
Empty destructor.
SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
SampleConsensusModelStick(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelStick.