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 = sqrtf (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_
PointCloudConstPtr input_
virtual ~RGBPlaneCoefficientComparator()
Destructor for RGBPlaneCoefficientComparator.
bool compare(int idx1, int idx2) const
Compare two neighboring points, by using normal information, euclidean distance, and color informatio...
boost::shared_ptr< RGBPlaneCoefficientComparator< PointT, PointNT > > Ptr
boost::shared_ptr< const RGBPlaneCoefficientComparator< PointT, PointNT > > ConstPtr
pcl::PointCloud< PointNT > PointCloudN
PointCloudNConstPtr normals_
Comparator< PointT >::PointCloudConstPtr PointCloudConstPtr
PointCloudN::Ptr PointCloudNPtr
Comparator is the base class for comparators that compare two points given some function.
boost::shared_ptr< const PointCloud< PointNT > > ConstPtr
RGBPlaneCoefficientComparator(boost::shared_ptr< std::vector< float > > &plane_coeff_d)
Constructor for RGBPlaneCoefficientComparator.
RGBPlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar segmentation.
PointCloud::ConstPtr PointCloudConstPtr
void setColorThreshold(float color_threshold)
Set the tolerance in color space between neighboring points, to be considered part of the same plane...
PointCloudN::ConstPtr PointCloudNConstPtr
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
A point structure representing Euclidean xyz coordinates, and the RGB color.
boost::shared_ptr< PointCloud< PointNT > > Ptr
float distance_threshold_
float getColorThreshold() const
Get the color threshold between neighboring points, to be considered part of the same plane...
PointCloud represents the base class in PCL for storing collections of 3D points. ...
Comparator< PointT >::PointCloud PointCloud
RGBPlaneCoefficientComparator()
Empty constructor for RGBPlaneCoefficientComparator.