40 #ifndef PCL_RGB_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_ 41 #define PCL_RGB_SEGMENTATION_PLANE_COEFFICIENT_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<RGBPlaneCoefficientComparator<PointT, PointNT> >
Ptr;
66 typedef boost::shared_ptr<const RGBPlaneCoefficientComparator<PointT, PointNT> >
ConstPtr;
116 float dx =
input_->points[idx1].x -
input_->points[idx2].x;
117 float dy =
input_->points[idx1].y -
input_->points[idx2].y;
118 float dz =
input_->points[idx1].z -
input_->points[idx2].z;
119 float dist = std::sqrt (dx*dx + dy*dy + dz*dz);
120 int dr =
input_->points[idx1].r -
input_->points[idx2].r;
121 int dg =
input_->points[idx1].g -
input_->points[idx2].g;
122 int db =
input_->points[idx1].b -
input_->points[idx2].b;
124 float color_dist =
static_cast<float> (dr*dr + dg*dg + db*db);
135 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_ PointCloud::ConstPtr PointCloudConstPtr
PointCloudN::ConstPtr PointCloudNConstPtr
boost::shared_ptr< RGBPlaneCoefficientComparator< PointT, PointNT > > Ptr
This file defines compatibility wrappers for low level I/O functions.
boost::shared_ptr< const RGBPlaneCoefficientComparator< PointT, PointNT > > ConstPtr
RGBPlaneCoefficientComparator(boost::shared_ptr< std::vector< float > > &plane_coeff_d)
Constructor for RGBPlaneCoefficientComparator.
Comparator is the base class for comparators that compare two points given some function.
float getColorThreshold() const
Get the color threshold between neighboring points, to be considered part of the same plane...
boost::shared_ptr< PointCloud< PointNT > > Ptr
RGBPlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar segmentation.
pcl::PointCloud< PointNT > PointCloudN
void setColorThreshold(float color_threshold)
Set the tolerance in color space between neighboring points, to be considered part of the same plane...
PointCloudN::Ptr PointCloudNPtr
boost::shared_ptr< const PointCloud< PointNT > > ConstPtr
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
RGBPlaneCoefficientComparator()
Empty constructor for RGBPlaneCoefficientComparator.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
float distance_threshold_
PointCloudNConstPtr normals_
virtual ~RGBPlaneCoefficientComparator()
Destructor for RGBPlaneCoefficientComparator.
PointCloudConstPtr input_
A point structure representing Euclidean xyz coordinates, and the RGB color.
bool compare(int idx1, int idx2) const
Compare two neighboring points, by using normal information, euclidean distance, and color informatio...
Comparator< PointT >::PointCloud PointCloud
Comparator< PointT >::PointCloudConstPtr PointCloudConstPtr