Point Cloud Library (PCL)
1.10.1
|
43 #include <pcl/sample_consensus/sac_model.h>
44 #include <pcl/sample_consensus/model_types.h>
58 template <
typename Po
intT>
94 const std::vector<int> &indices,
133 Eigen::VectorXf &model_coefficients)
const override;
141 std::vector<double> &distances)
const override;
150 const double threshold,
151 std::vector<int> &inliers)
override;
161 const double threshold)
const override;
171 const Eigen::VectorXf &model_coefficients,
172 Eigen::VectorXf &optimized_coefficients)
const override;
182 const Eigen::VectorXf &model_coefficients,
184 bool copy_data_fields =
true)
const override;
193 const Eigen::VectorXf &model_coefficients,
194 const double threshold)
const override;
208 isModelValid (
const Eigen::VectorXf &model_coefficients)
const override;
214 isSampleGood(
const std::vector<int> &samples)
const override;
233 operator() (
const Eigen::VectorXf &x, Eigen::VectorXf &fvec)
const
235 for (
int i = 0; i < values (); ++i)
238 float xt = model_->input_->points[
indices_[i]].x - x[0];
239 float yt = model_->input_->points[
indices_[i]].y - x[1];
242 fvec[i] = std::sqrt (xt * xt + yt * yt) - x[2];
253 #ifdef PCL_NO_PRECOMPILE
254 #include <pcl/sample_consensus/impl/sac_model_circle.hpp>
This file defines compatibility wrappers for low level I/O functions.
SampleConsensusModelCircle2D(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelCircle2D.
SampleConsensusModelCircle2D(const SampleConsensusModelCircle2D &source)
Copy constructor.
bool doSamplesVerifyModel(const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, const double threshold) const override
Verify whether a subset of indices verifies the given 2d circle model coefficients.
unsigned int sample_size_
The size of a sample from which the model is computed.
unsigned int model_size_
The number of coefficients in the model.
SampleConsensusModelCircle2D & operator=(const SampleConsensusModelCircle2D &source)
Copy constructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
bool isModelValid(const Eigen::VectorXf &model_coefficients) const override
Check whether a model is valid given the user constraints.
pcl::SacModel getModelType() const override
Return a unique id for this model (SACMODEL_CIRCLE2D).
void projectPoints(const std::vector< int > &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 2d circle model.
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid 2D circle model, compute the model coefficient...
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, std::vector< int > &inliers) override
Compute all distances from the cloud data to a given 2D circle model.
Base functor all the models that need non linear optimization must define their own one and implement...
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const override
Compute all distances from the cloud data to a given 2D circle model.
IndicesPtr indices_
A pointer to the vector of point indices to use.
shared_ptr< const SampleConsensusModel< pcl::PointXYZRGB > > ConstPtr
SampleConsensusModelCircle2D defines a model for 2D circle segmentation on the X-Y plane.
shared_ptr< SampleConsensusModel< pcl::PointXYZRGB > > Ptr
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.
std::string model_name_
The model name.
typename PointCloud::ConstPtr PointCloudConstPtr
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const override
Recompute the 2d circle coefficients using the given inlier set and return them to the user.
SampleConsensusModelCircle2D(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelCircle2D.
typename PointCloud::Ptr PointCloudPtr
SampleConsensusModel represents the base model class.
bool isSampleGood(const std::vector< int > &samples) const override
Check if a sample of indices results in a good sample of points indices.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
~SampleConsensusModelCircle2D()
Empty destructor.