42 #include <pcl/segmentation/boost.h>
43 #include <pcl/segmentation/plane_coefficient_comparator.h>
53 template<
typename Po
intT,
typename Po
intNT>
64 using Ptr = shared_ptr<EdgeAwarePlaneComparator<PointT, PointNT> >;
65 using ConstPtr = shared_ptr<const EdgeAwarePlaneComparator<PointT, PointNT> >;
182 Eigen::Vector3f vec =
input_->points[idx1].getVector3fMap ();
184 dist_threshold *= z * z;
185 euclidean_dist_threshold *= z * z;
188 float dx =
input_->points[idx1].x -
input_->points[idx2].x;
189 float dy =
input_->points[idx1].y -
input_->points[idx2].y;
190 float dz =
input_->points[idx1].z -
input_->points[idx2].z;
191 float dist = std::sqrt (dx*dx + dy*dy + dz*dz);
194 bool dist_ok = (dist < euclidean_dist_threshold);
200 curvature_ok =
false;
202 return (dist_ok && normal_ok && curvature_ok && plane_d_ok);
void setDistanceMap(const float *distance_map)
Set a distance map to use.
typename PointCloudN::Ptr PointCloudNPtr
float curvature_threshold_
void setCurvatureThreshold(float curvature_threshold)
Set the curvature threshold for creating a new segment.
typename PointCloud::ConstPtr PointCloudConstPtr
EdgeAwarePlaneComparator(const float *distance_map)
Empty constructor for PlaneCoefficientComparator.
float getEuclideanDistanceThreshold() const
Get the euclidean distance threshold.
const float * getDistanceMap() const
Return the distance map used.
float getDistanceMapThreshold() const
Get the distance map threshold (in pixels).
~EdgeAwarePlaneComparator()
Destructor for PlaneCoefficientComparator.
shared_ptr< PointCloud< PointNT > > Ptr
shared_ptr< const Comparator< PointT > > ConstPtr
EdgeAwarePlaneComparator()
Empty constructor for PlaneCoefficientComparator.
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
const float * distance_map_
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_
shared_ptr< const PointCloud< PointNT > > ConstPtr
int distance_map_threshold_
bool compare(int idx1, int idx2) const override
Compare two neighboring points, by using normal information, curvature, and euclidean distance inform...
EdgeAwarePlaneComparator is a Comparator that operates on plane coefficients, for use in planar segme...
typename PointCloudN::ConstPtr PointCloudNConstPtr
shared_ptr< Comparator< PointT > > Ptr
PointCloudConstPtr input_
float getCurvatureThreshold() const
Get the curvature threshold.
void setDistanceMapThreshold(float distance_map_threshold)
Set the distance map threshold – the number of pixel away from a border / nan.
void setEuclideanDistanceThreshold(float euclidean_distance_threshold)
Set the euclidean distance threshold.
float euclidean_distance_threshold_