Point Cloud Library (PCL)
1.9.1
|
40 #ifndef PCL_SEGMENTATION_EUCLIDEAN_CLUSTER_COMPARATOR_H_
41 #define PCL_SEGMENTATION_EUCLIDEAN_CLUSTER_COMPARATOR_H_
43 #include <pcl/segmentation/boost.h>
44 #include <pcl/segmentation/comparator.h>
49 namespace experimental
51 template<
typename Po
intT,
typename Po
intLT = pcl::Label>
66 typedef boost::shared_ptr<EuclideanClusterComparator<PointT, PointLT> >
Ptr;
67 typedef boost::shared_ptr<const EuclideanClusterComparator<PointT, PointLT> >
ConstPtr;
84 Eigen::Matrix3f rot =
input_->sensor_orientation_.toRotationMatrix ();
140 const uint32_t &label1 = (*labels_)[idx1].label;
141 const uint32_t &label2 = (*labels_)[idx2].label;
143 const std::set<uint32_t>::const_iterator it1 =
exclude_labels_->find (label1);
147 const std::set<uint32_t>::const_iterator it2 =
exclude_labels_->find (label2);
155 Eigen::Vector3f vec =
input_->points[idx1].getVector3fMap ();
157 dist_threshold *= z * z;
160 const float dist = ((*input_)[idx1].getVector3fMap ()
161 - (*input_)[idx2].getVector3fMap ()).norm ();
162 return (dist < dist_threshold);
196 template<
typename Po
intT,
typename Po
intNT,
typename Po
intLT = deprecated::T>
209 typedef boost::shared_ptr<EuclideanClusterComparator<PointT, PointNT, PointLT> >
Ptr;
210 typedef boost::shared_ptr<const EuclideanClusterComparator<PointT, PointNT, PointLT> >
ConstPtr;
215 PCL_DEPRECATED (
"Remove PointNT from template parameters.")
225 PCL_DEPRECATED (
"EuclideadClusterComparator never actually used normals and angular threshold, "
226 "this function has no effect on the behavior of the comparator. Therefore it is "
227 "deprecated and will be removed in future releases.")
232 PCL_DEPRECATED (
"EuclideadClusterComparator never actually used normals and angular threshold, "
233 "this function has no effect on the behavior of the comparator. Therefore it is "
234 "deprecated and will be removed in future releases.")
241 PCL_DEPRECATED (
"EuclideadClusterComparator never actually used normals and angular threshold, "
242 "this function has no effect on the behavior of the comparator. Therefore it is "
243 "deprecated and will be removed in future releases.")
251 PCL_DEPRECATED (
"EuclideadClusterComparator never actually used normals and angular threshold, "
252 "this function has no effect on the behavior of the comparator. Therefore it is "
253 "deprecated and will be removed in future releases.")
260 PCL_DEPRECATED (
"Use setExcludeLabels (const ExcludeLabelSetConstPtr &) instead")
264 for (uint32_t i = 0; i < exclude_labels.size (); ++i)
265 if (exclude_labels[i])
276 template<
typename Po
intT,
typename Po
intLT>
281 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_
boost::shared_ptr< const EuclideanClusterComparator< PointT, PointLT > > ConstPtr
This file defines compatibility wrappers for low level I/O functions.
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< PointCloud< PointT > > Ptr
PointCloudN::ConstPtr PointCloudNConstPtr
float getDistanceThreshold() const
Get the distance threshold in meters (d component of plane equation) between neighboring points,...
void setDistanceThreshold(float distance_threshold, bool depth_dependent)
Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) ...
PointCloudN::Ptr PointCloudNPtr
virtual bool compare(int idx1, int idx2) const
Compare points at two indices by their euclidean distance.
pcl::PointCloud< PointLT > PointCloudL
PointCloudL::ConstPtr PointCloudLConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud for the comparator.
A point structure representing Euclidean xyz coordinates, and the RGB color.
const ExcludeLabelSetConstPtr & getExcludeLabels() const
boost::shared_ptr< EuclideanClusterComparator< PointT, PointNT, PointLT > > Ptr
float distance_threshold_
EuclideanClusterComparator()
Default constructor for EuclideanClusterComparator.
std::set< uint32_t > ExcludeLabelSet
ExcludeLabelSetConstPtr exclude_labels_
Specifies which labels should be excluded com being clustered.
boost::shared_ptr< const ExcludeLabelSet > ExcludeLabelSetConstPtr
PointCloudLPtr labels_
Set of labels with similar size as the input point cloud, aggregating points into groups based on a s...
boost::shared_ptr< ExcludeLabelSet > ExcludeLabelSetPtr
void setExcludeLabels(const ExcludeLabelSetConstPtr &exclude_labels)
Set labels in the label cloud to exclude.
Comparator is the base class for comparators that compare two points given some function.
float getAngularThreshold() const
Get the angular threshold in radians for difference in normal direction between neighboring points,...
EuclideanClusterComparator is a comparator used for finding clusters based on euclidian distance.
PointCloudL::Ptr PointCloudLPtr
boost::shared_ptr< const EuclideanClusterComparator< PointT, PointNT, PointLT > > ConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
PointCloudNConstPtr getInputNormals() const
Get the input normals.
void setExcludeLabels(const std::vector< bool > &exclude_labels)
Set labels in the label cloud to exclude.
void setAngularThreshold(float angular_threshold)
Set the tolerance in radians for difference in normal direction between neighboring points,...
pcl::PointCloud< PointNT > PointCloudN
PointCloudConstPtr input_
boost::shared_ptr< EuclideanClusterComparator< PointT, PointLT > > Ptr
PointCloudNConstPtr normals_
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input normals.
void setLabels(const PointCloudLPtr &labels)
Set label cloud.