42 #include <pcl/common/angles.h>
43 #include <pcl/memory.h>
44 #include <pcl/pcl_macros.h>
45 #include <pcl/segmentation/comparator.h>
54 template<
typename Po
intT,
typename Po
intNT>
65 using Ptr = shared_ptr<PlaneCoefficientComparator<PointT, PointNT> >;
66 using ConstPtr = shared_ptr<const PlaneCoefficientComparator<PointT, PointNT> >;
136 plane_coeff_d_ = pcl::make_shared<std::vector<float> >(plane_coeff_d);
140 const std::vector<float>&
168 bool depth_dependent =
false)
192 Eigen::Vector3f vec =
input_->points[idx1].getVector3fMap ();
float deg2rad(float alpha)
Convert an angle from degrees to radians.
typename PointCloud::ConstPtr PointCloudConstPtr
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input normals.
const std::vector< float > & getPlaneCoeffD() const
Get a pointer to the vector of the d-coefficient of the planes' hessian normal form.
float getAngularThreshold() const
Get the angular threshold in radians for difference in normal direction between neighboring points...
void setPlaneCoeffD(shared_ptr< std::vector< float > > &plane_coeff_d)
Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form.
typename PointCloudN::Ptr PointCloudNPtr
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Comparator is the base class for comparators that compare two points given some function.
~PlaneCoefficientComparator()
Destructor for PlaneCoefficientComparator.
shared_ptr< PointCloud< PointNT > > Ptr
PlaneCoefficientComparator(shared_ptr< std::vector< float > > &plane_coeff_d)
Constructor for PlaneCoefficientComparator.
shared_ptr< const Comparator< PointT > > ConstPtr
void setPlaneCoeffD(std::vector< float > &plane_coeff_d)
Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form.
float getDistanceThreshold() const
Get the distance threshold in meters (d component of plane equation) between neighboring points...
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
void setInputCloud(const PointCloudConstPtr &cloud) override
Set the input cloud for the comparator.
float distance_threshold_
PointCloud represents the base class in PCL for storing collections of 3D points. ...
shared_ptr< std::vector< float > > plane_coeff_d_
PointCloudNConstPtr normals_
typename PointCloudN::ConstPtr PointCloudNConstPtr
shared_ptr< const PointCloud< PointNT > > ConstPtr
void setDistanceThreshold(float distance_threshold, bool depth_dependent=false)
Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) ...
PointCloudNConstPtr getInputNormals() const
Get the input normals.
shared_ptr< Comparator< PointT > > Ptr
PointCloudConstPtr input_
bool compare(int idx1, int idx2) const override
Compare points at two indices by their plane equations.
virtual void setAngularThreshold(float angular_threshold)
Set the tolerance in radians for difference in normal direction between neighboring points...
PlaneCoefficientComparator()
Empty constructor for PlaneCoefficientComparator.