Point Cloud Library (PCL)
1.11.1-dev
|
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)
117 models_ = pcl::make_shared<std::vector<pcl::ModelCoefficients> >(models);
135 refine_labels_ = pcl::make_shared<std::vector<bool> >(refine_labels);
157 inline shared_ptr<std::vector<pcl::ModelCoefficients> >
179 int current_label = (*labels_)[idx1].label;
180 int next_label = (*labels_)[idx2].label;
187 PointT pt = (*input_)[idx2];
188 double ptp_dist = std::fabs (model_coeff.
values[0] * pt.x +
189 model_coeff.
values[1] * pt.y +
190 model_coeff.
values[2] * pt.z +
198 Eigen::Vector3f vec = (*input_)[idx1].getVector3fMap ();
204 return (ptp_dist < threshold);
208 shared_ptr<std::vector<pcl::ModelCoefficients> >
models_;
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 setModelCoefficients(std::vector< pcl::ModelCoefficients > &models)
Set the vector of model coefficients to which we will compare.
typename PointCloudN::Ptr PointCloudNPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
std::vector< float > values
typename PointCloudL::ConstPtr PointCloudLConstPtr
typename PointCloudL::Ptr PointCloudLPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
shared_ptr< const Comparator< PointT > > ConstPtr
void setLabels(PointCloudLPtr &labels)
...
void setRefineLabels(shared_ptr< std::vector< bool > > &refine_labels)
Set which labels should be refined.
float distance_threshold_
typename PointCloudN::ConstPtr PointCloudNConstPtr
~PlaneRefinementComparator()
Destructor for PlaneCoefficientComparator.
shared_ptr< std::vector< pcl::ModelCoefficients > > models_
shared_ptr< std::vector< bool > > refine_labels_
bool compare(int idx1, int idx2) const override
Compare two neighboring points.
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 ...
shared_ptr< std::vector< pcl::ModelCoefficients > > getModelCoefficients() const
Get 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.
void setRefineLabels(std::vector< bool > &refine_labels)
Set which labels should be refined.
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< PointCloud< PointNT > > Ptr
PlaneRefinementComparator(shared_ptr< std::vector< pcl::ModelCoefficients > > &models, shared_ptr< std::vector< bool > > &refine_labels)
Empty constructor for PlaneCoefficientComparator.
shared_ptr< const PointCloud< PointNT > > ConstPtr
PlaneRefinementComparator is a Comparator that operates on plane coefficients, for use in planar segm...
shared_ptr< std::vector< int > > label_to_model_
shared_ptr< Comparator< PointT > > Ptr
Defines functions, macros and traits for allocating and using memory.
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...