Point Cloud Library (PCL)
1.10.0
|
43 #include <pcl/sample_consensus/sac_model.h>
44 #include <pcl/sample_consensus/model_types.h>
54 template <
typename Po
int>
inline void
55 projectPoint (
const Point &p,
const Eigen::Vector4f &model_coefficients, Point &q)
58 Eigen::Vector4f pp (p.x, p.y, p.z, 1);
60 float distance_to_plane = pp.dot(model_coefficients);
67 Eigen::Vector4f q_e = pp - distance_to_plane * model_coefficients;
81 template <
typename Po
int>
inline double
84 return (a * p.x + b * p.y + c * p.z + d);
92 template <
typename Po
int>
inline double
95 return ( plane_coefficients[0] * p.x + plane_coefficients[1] * p.y + plane_coefficients[2] * p.z + plane_coefficients[3] );
106 template <
typename Po
int>
inline double
117 template <
typename Po
int>
inline double
134 template <
typename Po
intT>
169 const std::vector<int> &indices,
189 Eigen::VectorXf &model_coefficients)
const override;
197 std::vector<double> &distances)
const override;
206 const double threshold,
207 std::vector<int> &inliers)
override;
217 const double threshold)
const override;
227 const Eigen::VectorXf &model_coefficients,
228 Eigen::VectorXf &optimized_coefficients)
const override;
238 const Eigen::VectorXf &model_coefficients,
240 bool copy_data_fields =
true)
const override;
249 const Eigen::VectorXf &model_coefficients,
250 const double threshold)
const override;
266 isSampleGood (
const std::vector<int> &samples)
const override;
270 #ifdef PCL_NO_PRECOMPILE
271 #include <pcl/sample_consensus/impl/sac_model_plane.hpp>
This file defines compatibility wrappers for low level I/O functions.
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.
SampleConsensusModelPlane defines a model for 3D plane segmentation.
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, std::vector< int > &inliers) override
Select all the points which respect the given model coefficients as inliers.
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.
PointCloud represents the base class in PCL for storing collections of 3D points.
double pointToPlaneDistance(const Point &p, double a, double b, double c, double d)
Get the distance from a point to a plane (unsigned) defined by ax+by+cz+d=0.
SampleConsensusModelPlane(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelPlane.
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) const override
Create a new point cloud with inliers projected onto the plane model.
shared_ptr< const SampleConsensusModel< PointT > > ConstPtr
shared_ptr< SampleConsensusModel< PointT > > Ptr
std::string model_name_
The model name.
typename PointCloud::ConstPtr PointCloudConstPtr
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const override
Compute all distances from the cloud data to a given plane model.
bool computeModelCoefficients(const std::vector< int > &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid plane model, compute the model coefficients fr...
void optimizeModelCoefficients(const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const override
Recompute the plane coefficients using the given inlier set and return them to the user.
typename PointCloud::Ptr PointCloudPtr
SampleConsensusModel represents the base model class.
void projectPoint(const Point &p, const Eigen::Vector4f &model_coefficients, Point &q)
Project a point on a planar model given by a set of normalized coefficients.
pcl::SacModel getModelType() const override
Return a unique id for this model (SACMODEL_PLANE).
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 plane model coefficients.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
~SampleConsensusModelPlane()
Empty destructor.
double pointToPlaneDistanceSigned(const Point &p, double a, double b, double c, double d)
Get the distance from a point to a plane (signed) defined by ax+by+cz+d=0.
SampleConsensusModelPlane(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelPlane.