Point Cloud Library (PCL)
1.9.1
|
41 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_CIRCLE2D_H_
42 #define PCL_SAMPLE_CONSENSUS_MODEL_CIRCLE2D_H_
44 #include <pcl/sample_consensus/sac_model.h>
45 #include <pcl/sample_consensus/model_types.h>
59 template <
typename Po
intT>
74 typedef boost::shared_ptr<SampleConsensusModelCircle2D>
Ptr;
94 const std::vector<int> &indices,
133 Eigen::VectorXf &model_coefficients)
const;
141 std::vector<double> &distances)
const;
150 const double threshold,
151 std::vector<int> &inliers);
161 const double threshold)
const;
171 const Eigen::VectorXf &model_coefficients,
172 Eigen::VectorXf &optimized_coefficients)
const;
182 const Eigen::VectorXf &model_coefficients,
184 bool copy_data_fields =
true)
const;
193 const Eigen::VectorXf &model_coefficients,
194 const double threshold)
const;
208 isModelValid (
const Eigen::VectorXf &model_coefficients)
const;
218 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
219 #pragma GCC diagnostic ignored "-Weffc++"
237 operator() (
const Eigen::VectorXf &x, Eigen::VectorXf &fvec)
const
239 for (
int i = 0; i < values (); ++i)
242 float xt = model_->input_->points[
indices_[i]].x - x[0];
243 float yt = model_->input_->points[
indices_[i]].y - x[1];
246 fvec[i] = std::sqrt (xt * xt + yt * yt) - x[2];
254 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
255 #pragma GCC diagnostic warning "-Weffc++"
260 #ifdef PCL_NO_PRECOMPILE
261 #include <pcl/sample_consensus/impl/sac_model_circle.hpp>
264 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_CIRCLE2D_H_
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 2d circle model coefficients.
boost::shared_ptr< std::vector< int > > indices_
A pointer to the vector of point indices to use.
This file defines compatibility wrappers for low level I/O functions.
SampleConsensusModelCircle2D(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelCircle2D.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const
Compute all distances from the cloud data to a given 2D circle model.
SampleConsensusModelCircle2D(const SampleConsensusModelCircle2D &source)
Copy constructor.
pcl::PointCloud< PointT >::Ptr PointCloudPtr
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const
Count all the points which respect the given model coefficients as inliers.
boost::shared_ptr< SampleConsensusModelCircle2D > Ptr
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 2d circle model.
unsigned int sample_size_
The size of a sample from which the model is computed.
virtual ~SampleConsensusModelCircle2D()
Empty destructor.
SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
unsigned int model_size_
The number of coefficients in the model.
SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
SampleConsensusModelCircle2D & operator=(const SampleConsensusModelCircle2D &source)
Copy constructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
pcl::SacModel getModelType() const
Return an unique id for this model (SACMODEL_CIRCLE2D).
pcl::PointCloud< PointT >::ConstPtr PointCloudConstPtr
Base functor all the models that need non linear optimization must define their own one and implement...
bool isSampleGood(const std::vector< int > &samples) const
Check if a sample of indices results in a good sample of points indices.
SampleConsensusModelCircle2D defines a model for 2D circle segmentation on the X-Y plane.
std::string model_name_
The model name.
SampleConsensusModel< PointT >::PointCloud PointCloud
virtual bool isModelValid(const Eigen::VectorXf &model_coefficients) const
Check whether a model is valid given the user constraints.
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, std::vector< int > &inliers)
Compute all distances from the cloud data to a given 2D circle model.
SampleConsensusModelCircle2D(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelCircle2D.
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients) const
Check whether the given index samples can form a valid 2D circle model, compute the model coefficient...
SampleConsensusModel represents the base model class.
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const
Recompute the 2d circle coefficients using the given inlier set and return them to the user.