50#include <pcl/sample_consensus/sac_model.h>
51#include <pcl/sample_consensus/model_types.h>
61 template <
typename Po
int>
inline void
65 Eigen::Vector4f
pp (p.x, p.y, p.z, 1);
88 template <
typename Po
int>
inline double
91 return (a * p.x + b * p.y +
c * p.z + d);
99 template <
typename Po
int>
inline double
113 template <
typename Po
int>
inline double
124 template <
typename Po
int>
inline double
141 template <
typename Po
intT>
204 std::vector<double> &distances)
const override;
213 const double threshold,
224 const double threshold)
const override;
257 const double threshold)
const override;
272 const double threshold,
273 std::size_t i = 0)
const;
275#if defined (__SSE__) && defined (__SSE2__) && defined (__SSE4_1__)
281 const double threshold,
282 std::size_t i = 0)
const;
285#if defined (__AVX__) && defined (__AVX2__)
291 const double threshold,
292 std::size_t i = 0)
const;
313#ifdef PCL_NO_PRECOMPILE
314#include <pcl/sample_consensus/impl/sac_model_plane.hpp>
Iterator class for point clouds with or without given indices.
PointCloud represents the base class in PCL for storing collections of 3D points.
SampleConsensusModel represents the base model class.
unsigned int sample_size_
The size of a sample from which the model is computed.
typename PointCloud::ConstPtr PointCloudConstPtr
IndicesPtr indices_
A pointer to the vector of point indices to use.
PointCloudConstPtr input_
A boost shared pointer to the point cloud data array.
virtual bool isModelValid(const Eigen::VectorXf &model_coefficients) const
Check whether a model is valid given the user constraints.
std::string model_name_
The model name.
unsigned int model_size_
The number of coefficients in the model.
typename PointCloud::Ptr PointCloudPtr
std::vector< double > error_sqr_dists_
A vector holding the distances to the computed model.
SampleConsensusModelPlane defines a model for 3D plane segmentation.
typename SampleConsensusModel< PointT >::PointCloud PointCloud
void optimizeModelCoefficients(const Indices &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.
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.
~SampleConsensusModelPlane()
Empty destructor.
typename SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
bool doSamplesVerifyModel(const std::set< index_t > &indices, const Eigen::VectorXf &model_coefficients, const double threshold) const override
Verify whether a subset of indices verifies the given plane model coefficients.
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, Indices &inliers) override
Select all the points which respect the given model coefficients as inliers.
void projectPoints(const Indices &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.
typename SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
bool computeModelCoefficients(const Indices &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid plane model, compute the model coefficients fr...
std::size_t countWithinDistanceStandard(const Eigen::VectorXf &model_coefficients, const double threshold, std::size_t i=0) const
This implementation uses no SIMD instructions.
pcl::SacModel getModelType() const override
Return a unique id for this model (SACMODEL_PLANE).
SampleConsensusModelPlane(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelPlane.
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(const PointCloudConstPtr &cloud, const Indices &indices, bool random=false)
Constructor for base SampleConsensusModelPlane.
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.
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.
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.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.