Point Cloud Library (PCL)
1.10.1
|
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>
83 Eigen::Matrix3f rot =
input_->sensor_orientation_.toRotationMatrix ();
139 const std::uint32_t &label1 = (*labels_)[idx1].label;
140 const std::uint32_t &label2 = (*labels_)[idx2].label;
142 const std::set<std::uint32_t>::const_iterator it1 =
exclude_labels_->find (label1);
146 const std::set<std::uint32_t>::const_iterator it2 =
exclude_labels_->find (label2);
154 Eigen::Vector3f vec =
input_->points[idx1].getVector3fMap ();
156 dist_threshold *= z * z;
159 const float dist = ((*input_)[idx1].getVector3fMap ()
160 - (*input_)[idx2].getVector3fMap ()).norm ();
161 return (dist < dist_threshold);
195 template<
typename Po
intT,
typename Po
intNT,
typename Po
intLT = deprecated::T>
223 PCL_DEPRECATED(
"EuclideadClusterComparator never actually used normals and angular threshold, this function has no effect on the behavior of the comparator. It is deprecated and will be removed in future releases.")
228 PCL_DEPRECATED(
"EuclideadClusterComparator never actually used normals and angular threshold, this function has no effect on the behavior of the comparator. It is deprecated and will be removed in future releases.")
235 PCL_DEPRECATED(
"EuclideadClusterComparator never actually used normals and angular threshold, this function has no effect on the behavior of the comparator. It is deprecated and will be removed in future releases.")
243 PCL_DEPRECATED(
"EuclideadClusterComparator never actually used normals and angular threshold, this function has no effect on the behavior of the comparator. It is deprecated and will be removed in future releases.")
250 PCL_DEPRECATED(
"use setExcludeLabels(const ExcludeLabelSetConstPtr &) instead")
255 for (std::size_t i = 0; i < exclude_labels.size (); ++i)
256 if (exclude_labels[i])
267 template<
typename Po
intT,
typename Po
intLT>
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
bool compare(int idx1, int idx2) const override
Compare points at two indices by their euclidean distance.
float getDistanceThreshold() const
Get the distance threshold in meters (d component of plane equation) between neighboring points,...
typename PointCloudN::ConstPtr PointCloudNConstPtr
std::set< std::uint32_t > ExcludeLabelSet
typename PointCloudL::Ptr PointCloudLPtr
void setDistanceThreshold(float distance_threshold, bool depth_dependent)
Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) ...
typename PointCloudL::ConstPtr PointCloudLConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.
shared_ptr< const Comparator< PointT > > ConstPtr
const ExcludeLabelSetConstPtr & getExcludeLabels() const
float distance_threshold_
EuclideanClusterComparator()
Default constructor for EuclideanClusterComparator.
ExcludeLabelSetConstPtr exclude_labels_
Specifies which labels should be excluded com being clustered.
PointCloudLPtr labels_
Set of labels with similar size as the input point cloud, aggregating points into groups based on a s...
void setExcludeLabels(const ExcludeLabelSetConstPtr &exclude_labels)
Set labels in the label cloud to exclude.
shared_ptr< const ExcludeLabelSet > ExcludeLabelSetConstPtr
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,...
void setInputCloud(const PointCloudConstPtr &cloud) override
Set the input cloud for the comparator.
EuclideanClusterComparator is a comparator used for finding clusters based on euclidian distance.
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< PointCloud< PointT > > Ptr
typename PointCloudN::Ptr PointCloudNPtr
PointCloudNConstPtr getInputNormals() const
Get the input normals.
void setExcludeLabels(const std::vector< bool > &exclude_labels)
Set labels in the label cloud to exclude.
shared_ptr< ExcludeLabelSet > ExcludeLabelSetPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
void setAngularThreshold(float angular_threshold)
Set the tolerance in radians for difference in normal direction between neighboring points,...
#define PCL_DEPRECATED(message)
PointCloudConstPtr input_
shared_ptr< Comparator< PointT > > Ptr
PointCloudNConstPtr normals_
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input normals.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
void setLabels(const PointCloudLPtr &labels)
Set label cloud.