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