40 #ifndef PCL_SEGMENTATION_PLANAR_REFINEMENT_COMPARATOR_H_
41 #define PCL_SEGMENTATION_PLANAR_REFINEMENT_COMPARATOR_H_
44 #include <boost/make_shared.hpp>
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;
84 , depth_dependent_ (false)
93 boost::shared_ptr<std::vector<bool> >& refine_labels)
96 , refine_labels_ (refine_labels)
98 , depth_dependent_ (false)
123 models_ = boost::make_shared<std::vector<pcl::ModelCoefficients> >(models);
132 refine_labels_ = refine_labels;
141 refine_labels_ = boost::make_shared<std::vector<bool> >(refine_labels);
150 label_to_model_ = label_to_model;
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;
188 if (!((*refine_labels_)[current_label] && !(*refine_labels_)[next_label]))
193 PointT pt = input_->points[idx2];
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 +
200 float threshold = distance_threshold_;
201 if (depth_dependent_)
204 Eigen::Vector3f vec = input_->points[idx1].getVector3fMap ();
206 float z = vec.dot (z_axis_);
210 return (ptp_dist < threshold);
214 boost::shared_ptr<std::vector<pcl::ModelCoefficients> > models_;
216 boost::shared_ptr<std::vector<bool> > refine_labels_;
217 boost::shared_ptr<std::vector<int> > label_to_model_;
218 bool depth_dependent_;
223 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_