40 #ifndef PCL_SEGMENTATION_PLANAR_REFINEMENT_COMPARATOR_H_
41 #define PCL_SEGMENTATION_PLANAR_REFINEMENT_COMPARATOR_H_
43 #include <pcl/segmentation/boost.h>
44 #include <pcl/segmentation/plane_coefficient_comparator.h>
54 template<
typename Po
intT,
typename Po
intNT,
typename Po
intLT>
69 typedef boost::shared_ptr<PlaneRefinementComparator<PointT, PointNT, PointLT> >
Ptr;
70 typedef boost::shared_ptr<const PlaneRefinementComparator<PointT, PointNT, PointLT> >
ConstPtr;
93 boost::shared_ptr<std::vector<bool> >& refine_labels)
123 models_ = boost::make_shared<std::vector<pcl::ModelCoefficients> >(models);
141 refine_labels_ = boost::make_shared<std::vector<bool> >(refine_labels);
159 label_to_model_ = boost::make_shared<std::vector<int> >(label_to_model);
163 inline boost::shared_ptr<std::vector<pcl::ModelCoefficients> >
185 int current_label =
labels_->points[idx1].label;
186 int next_label =
labels_->points[idx2].label;
194 double ptp_dist = fabs (model_coeff.
values[0] * pt.x +
195 model_coeff.
values[1] * pt.y +
196 model_coeff.
values[2] * pt.z +
204 Eigen::Vector3f vec =
input_->points[idx1].getVector3fMap ();
210 return (ptp_dist < threshold);
214 boost::shared_ptr<std::vector<pcl::ModelCoefficients> >
models_;
223 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_
std::vector< float > values
PointCloudConstPtr input_
void setRefineLabels(std::vector< bool > &refine_labels)
Set which labels should be refined.
boost::shared_ptr< std::vector< int > > label_to_model_
PointCloudL::Ptr PointCloudLPtr
Comparator< PointT >::PointCloudConstPtr PointCloudConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
PlaneRefinementComparator(boost::shared_ptr< std::vector< pcl::ModelCoefficients > > &models, boost::shared_ptr< std::vector< bool > > &refine_labels)
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 ...
boost::shared_ptr< PointCloud< PointT > > Ptr
PlaneRefinementComparator()
Empty constructor for PlaneCoefficientComparator.
void setModelCoefficients(boost::shared_ptr< std::vector< pcl::ModelCoefficients > > &models)
Set the vector of model coefficients to which we will compare.
PointCloudN::Ptr PointCloudNPtr
virtual bool compare(int idx1, int idx2) const
Compare two neighboring points.
Comparator< PointT >::PointCloud PointCloud
void setLabelToModel(boost::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 ...
pcl::PointCloud< PointLT > PointCloudL
void setRefineLabels(boost::shared_ptr< std::vector< bool > > &refine_labels)
Set which labels should be refined.
boost::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.
boost::shared_ptr< std::vector< bool > > refine_labels_
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< PlaneRefinementComparator< PointT, PointNT, PointLT > > Ptr
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.
void setLabels(PointCloudLPtr &labels)
...
PointCloudN::ConstPtr PointCloudNConstPtr
virtual ~PlaneRefinementComparator()
Destructor for PlaneCoefficientComparator.
float distance_threshold_
boost::shared_ptr< std::vector< pcl::ModelCoefficients > > models_
pcl::PointCloud< PointNT > PointCloudN
PointCloudL::ConstPtr PointCloudLConstPtr
PlaneRefinementComparator is a Comparator that operates on plane coefficients, for use in planar segm...
boost::shared_ptr< const PlaneRefinementComparator< PointT, PointNT, PointLT > > ConstPtr