|
Point Cloud Library (PCL)
1.11.1-dev
|
45 #include <pcl/segmentation/boost.h>
46 #include <pcl/segmentation/comparator.h>
55 template<
typename Po
intT,
typename Po
intLT = pcl::Label>
70 using Ptr = shared_ptr<EuclideanClusterComparator<PointT, PointLT> >;
71 using ConstPtr = shared_ptr<const EuclideanClusterComparator<PointT, PointLT> >;
84 Eigen::Matrix3f rot =
input_->sensor_orientation_.toRotationMatrix ();
155 const std::uint32_t &label1 = (*labels_)[idx1].label;
156 const std::uint32_t &label2 = (*labels_)[idx2].label;
158 const std::set<std::uint32_t>::const_iterator it1 =
exclude_labels_->find (label1);
162 const std::set<std::uint32_t>::const_iterator it2 =
exclude_labels_->find (label2);
170 Eigen::Vector3f vec = (*input_)[idx1].getVector3fMap ();
172 dist_threshold *= z * z;
175 const float dist = ((*input_)[idx1].getVector3fMap ()
176 - (*input_)[idx2].getVector3fMap ()).norm ();
177 return (dist < dist_threshold);
const ExcludeLabelSetConstPtr & getExcludeLabels() const
Get exlude labels.
bool getDepthDependent() const
Get if depth dependent.
Defines all the PCL and non-PCL macros used.
void setInputCloud(const PointCloudConstPtr &cloud) override
Set the input cloud for the comparator.
EuclideanClusterComparator()=default
Default constructor for EuclideanClusterComparator.
const PointCloudLPtr & getLabels() const
Get labels.
ExcludeLabelSetConstPtr exclude_labels_
Specifies which labels should be excluded com being clustered.
shared_ptr< ExcludeLabelSet > ExcludeLabelSetPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< const Comparator< PointT > > ConstPtr
std::set< std::uint32_t > ExcludeLabelSet
float distance_threshold_
float getDistanceThreshold() const
Get the distance threshold in meters (d component of plane equation) between neighboring points,...
void setExcludeLabels(const ExcludeLabelSetConstPtr &exclude_labels)
Set labels in the label cloud to exclude.
void setDistanceThreshold(float distance_threshold, bool depth_dependent)
Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) ...
bool compare(int idx1, int idx2) const override
Compare points at two indices by their euclidean distance.
void setLabels(const PointCloudLPtr &labels)
Set label cloud.
PointCloudLPtr labels_
Set of labels with similar size as the input point cloud, aggregating points into groups based on a s...
shared_ptr< const ExcludeLabelSet > ExcludeLabelSetConstPtr
Comparator is the base class for comparators that compare two points given some function.
EuclideanClusterComparator is a comparator used for finding clusters based on euclidian distance.
typename PointCloudL::ConstPtr PointCloudLConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
PointCloudConstPtr input_
shared_ptr< Comparator< PointT > > Ptr
Defines functions, macros and traits for allocating and using memory.
typename PointCloudL::Ptr PointCloudLPtr