40 #ifndef PCL_SEGMENTATION_EUCLIDEAN_CLUSTER_COMPARATOR_H_
41 #define PCL_SEGMENTATION_EUCLIDEAN_CLUSTER_COMPARATOR_H_
44 #include <boost/make_shared.hpp>
53 template<
typename Po
intT,
typename Po
intNT,
typename Po
intLT>
68 typedef boost::shared_ptr<EuclideanClusterComparator<PointT, PointNT, PointLT> >
Ptr;
69 typedef boost::shared_ptr<const EuclideanClusterComparator<PointT, PointNT, PointLT> >
ConstPtr;
76 , angular_threshold_ (0.0f)
77 , distance_threshold_ (0.005f)
93 Eigen::Matrix3f rot = input_->sensor_orientation_.toRotationMatrix ();
94 z_axis_ = rot.col (2);
119 angular_threshold_ = cosf (angular_threshold);
126 return (acos (angular_threshold_) );
135 distance_threshold_ = distance_threshold;
136 depth_dependent_ = depth_dependent;
143 return (distance_threshold_);
161 exclude_labels_ = boost::make_shared<std::vector<bool> >(exclude_labels);
172 int label1 = labels_->points[idx1].label;
173 int label2 = labels_->points[idx2].label;
175 if (label1 == -1 || label2 == -1)
178 if ( (*exclude_labels_)[label1] || (*exclude_labels_)[label2])
181 float dx = input_->points[idx1].x - input_->points[idx2].x;
182 float dy = input_->points[idx1].y - input_->points[idx2].y;
183 float dz = input_->points[idx1].z - input_->points[idx2].z;
184 float dist =
sqrt (dx*dx + dy*dy + dz*dz);
186 return (dist < distance_threshold_);
193 boost::shared_ptr<std::vector<bool> > exclude_labels_;
194 float angular_threshold_;
195 float distance_threshold_;
196 bool depth_dependent_;
197 Eigen::Vector3f z_axis_;
201 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_