43 #include <pcl/segmentation/plane_coefficient_comparator.h>
53 template<
typename Po
intT,
typename Po
intNT,
typename Po
intLT>
68 using Ptr = shared_ptr<PlaneRefinementComparator<PointT, PointNT, PointLT> >;
69 using ConstPtr = shared_ptr<const PlaneRefinementComparator<PointT, PointNT, PointLT> >;
89 shared_ptr<std::vector<bool> >& refine_labels)
115 models_ = pcl::make_shared<std::vector<pcl::ModelCoefficients> >(models);
133 refine_labels_ = pcl::make_shared<std::vector<bool> >(refine_labels);
155 inline shared_ptr<std::vector<pcl::ModelCoefficients> >
177 int current_label = (*labels_)[idx1].label;
178 int next_label = (*labels_)[idx2].label;
185 PointT pt = (*input_)[idx2];
186 double ptp_dist = std::fabs (model_coeff.
values[0] * pt.x +
187 model_coeff.
values[1] * pt.y +
188 model_coeff.
values[2] * pt.z +
196 Eigen::Vector3f vec = (*input_)[idx1].getVector3fMap ();
202 return (ptp_dist < threshold);
206 shared_ptr<std::vector<pcl::ModelCoefficients> >
models_;
shared_ptr< Comparator< PointT > > Ptr
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< const Comparator< PointT > > ConstPtr
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
typename PointCloudN::Ptr PointCloudNPtr
float distance_threshold_
typename PointCloudN::ConstPtr PointCloudNConstPtr
PlaneRefinementComparator is a Comparator that operates on plane coefficients, for use in planar segm...
shared_ptr< std::vector< pcl::ModelCoefficients > > models_
shared_ptr< std::vector< pcl::ModelCoefficients > > getModelCoefficients() const
Get the vector of model coefficients to which we will compare.
void setModelCoefficients(std::vector< pcl::ModelCoefficients > &models)
Set the vector of model coefficients to which we will compare.
void setModelCoefficients(shared_ptr< std::vector< pcl::ModelCoefficients > > &models)
Set the vector of model coefficients to which we will compare.
typename PointCloudL::Ptr PointCloudLPtr
PlaneRefinementComparator(shared_ptr< std::vector< pcl::ModelCoefficients > > &models, shared_ptr< std::vector< bool > > &refine_labels)
Empty constructor for PlaneCoefficientComparator.
shared_ptr< std::vector< int > > label_to_model_
shared_ptr< std::vector< bool > > refine_labels_
~PlaneRefinementComparator() override=default
Destructor for PlaneCoefficientComparator.
PlaneRefinementComparator()
Empty constructor for PlaneCoefficientComparator.
void setLabelToModel(std::vector< int > &label_to_model)
A mapping from label to index in the vector of models, allowing the model coefficients of a label to ...
void setRefineLabels(std::vector< bool > &refine_labels)
Set which labels should be refined.
void setRefineLabels(shared_ptr< std::vector< bool > > &refine_labels)
Set which labels should be refined.
void setLabelToModel(shared_ptr< std::vector< int > > &label_to_model)
A mapping from label to index in the vector of models, allowing the model coefficients of a label to ...
void setLabels(PointCloudLPtr &labels)
...
typename PointCloudL::ConstPtr PointCloudLConstPtr
bool compare(int idx1, int idx2) const override
Compare two neighboring points.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointNT > > Ptr
shared_ptr< const PointCloud< PointNT > > ConstPtr
Defines functions, macros and traits for allocating and using memory.
std::vector< float > values
A point structure representing Euclidean xyz coordinates, and the RGB color.