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