40 #ifndef PCL_SEGMENTATION_EDGE_AWARE_PLANE_COMPARATOR_H_ 41 #define PCL_SEGMENTATION_EDGE_AWARE_PLANE_COMPARATOR_H_ 43 #include <pcl/segmentation/boost.h> 44 #include <pcl/segmentation/plane_coefficient_comparator.h> 54 template<
typename Po
intT,
typename Po
intNT>
65 typedef boost::shared_ptr<EdgeAwarePlaneComparator<PointT, PointNT> >
Ptr;
66 typedef boost::shared_ptr<const EdgeAwarePlaneComparator<PointT, PointNT> >
ConstPtr;
183 Eigen::Vector3f vec =
input_->points[idx1].getVector3fMap ();
185 dist_threshold *= z * z;
186 euclidean_dist_threshold *= z * z;
189 float dx =
input_->points[idx1].x -
input_->points[idx2].x;
190 float dy =
input_->points[idx1].y -
input_->points[idx2].y;
191 float dz =
input_->points[idx1].z -
input_->points[idx2].z;
192 float dist = sqrtf (dx*dx + dy*dy + dz*dz);
195 bool dist_ok = (dist < euclidean_dist_threshold);
201 curvature_ok =
false;
203 return (dist_ok && normal_ok && curvature_ok && plane_d_ok);
214 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_ PointCloud::ConstPtr PointCloudConstPtr
void setDistanceMap(const float *distance_map)
Set a distance map to use.
PointCloudN::ConstPtr PointCloudNConstPtr
float curvature_threshold_
void setCurvatureThreshold(float curvature_threshold)
Set the curvature threshold for creating a new segment.
PointCloudN::Ptr PointCloudNPtr
EdgeAwarePlaneComparator(const float *distance_map)
Empty constructor for PlaneCoefficientComparator.
const float * getDistanceMap() const
Return the distance map used.
pcl::PointCloud< PointNT > PointCloudN
boost::shared_ptr< PointCloud< PointNT > > Ptr
boost::shared_ptr< const EdgeAwarePlaneComparator< PointT, PointNT > > ConstPtr
float getEuclideanDistanceThreshold() const
Get the euclidean distance threshold.
bool compare(int idx1, int idx2) const
Compare two neighboring points, by using normal information, curvature, and euclidean distance inform...
virtual ~EdgeAwarePlaneComparator()
Destructor for PlaneCoefficientComparator.
Comparator< PointT >::PointCloud PointCloud
EdgeAwarePlaneComparator()
Empty constructor for PlaneCoefficientComparator.
boost::shared_ptr< const PointCloud< PointNT > > ConstPtr
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
const float * distance_map_
PointCloud represents the base class in PCL for storing collections of 3D points. ...
float distance_threshold_
PointCloudNConstPtr normals_
float getCurvatureThreshold() const
Get the curvature threshold.
boost::shared_ptr< std::vector< float > > plane_coeff_d_
int distance_map_threshold_
EdgeAwarePlaneComparator is a Comparator that operates on plane coefficients, for use in planar segme...
PointCloudConstPtr input_
void setDistanceMapThreshold(float distance_map_threshold)
Set the distance map threshold – the number of pixel away from a border / nan.
boost::shared_ptr< EdgeAwarePlaneComparator< PointT, PointNT > > Ptr
Comparator< PointT >::PointCloudConstPtr PointCloudConstPtr
void setEuclideanDistanceThreshold(float euclidean_distance_threshold)
Set the euclidean distance threshold.
float getDistanceMapThreshold() const
Get the distance map threshold (in pixels).
float euclidean_distance_threshold_