Skip to content

Commit 06a0748

Browse files
committed
Deprecating API with unused parameter
1 parent e5f4a17 commit 06a0748

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

segmentation/include/pcl/segmentation/extract_labeled_clusters.h

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,30 @@ namespace pcl
5252
* \param[in] max_label
5353
* \ingroup segmentation
5454
*/
55-
template <typename PointT> void
55+
template <typename PointT>
56+
PCL_DEPRECATED(1, 14, "Use of max_label is deprecated")
57+
void
58+
extractLabeledEuclideanClusters (
59+
const PointCloud<PointT> &cloud, const typename search::Search<PointT>::Ptr &tree,
60+
float tolerance, std::vector<std::vector<PointIndices> > &labeled_clusters,
61+
unsigned int min_pts_per_cluster, unsigned int max_pts_per_cluster,
62+
unsigned int max_label);
63+
64+
/** \brief Decompose a region of space into clusters based on the Euclidean distance between points
65+
* \param[in] cloud the point cloud message
66+
* \param[in] tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
67+
* \note the tree has to be created as a spatial locator on \a cloud
68+
* \param[in] tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
69+
* \param[out] labeled_clusters the resultant clusters containing point indices (as a vector of PointIndices)
70+
* \param[in] min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
71+
* \param[in] max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
72+
* \ingroup segmentation
73+
*/
74+
template <typename PointT> void
5675
extractLabeledEuclideanClusters (
5776
const PointCloud<PointT> &cloud, const typename search::Search<PointT>::Ptr &tree,
5877
float tolerance, std::vector<std::vector<PointIndices> > &labeled_clusters,
59-
unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = std::numeric_limits<unsigned int>::max (),
60-
unsigned int max_label = std::numeric_limits<unsigned int>::max ());
78+
unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = std::numeric_limits<unsigned int>::max ());
6179

6280
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6381
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -135,10 +153,12 @@ namespace pcl
135153
/** \brief Set the maximum number of labels in the cloud.
136154
* \param[in] max_label the maximum
137155
*/
156+
PCL_DEPRECATED(1, 14, "Max label is being deprecated")
138157
inline void
139158
setMaxLabels (unsigned int max_label) { max_label_ = max_label; }
140159

141160
/** \brief Get the maximum number of labels */
161+
PCL_DEPRECATED(1, 14, "Max label is being deprecated")
142162
inline unsigned int
143163
getMaxLabels () const { return (max_label_); }
144164

segmentation/include/pcl/segmentation/impl/extract_labeled_clusters.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pcl::LabeledEuclideanClusterExtraction<PointT>::extract (std::vector<std::vector
144144

145145
// Send the input dataset to the spatial locator
146146
tree_->setInputCloud (input_);
147-
extractLabeledEuclideanClusters (*input_, tree_, static_cast<float> (cluster_tolerance_), labeled_clusters, min_pts_per_cluster_, max_pts_per_cluster_, max_label_);
147+
extractLabeledEuclideanClusters (*input_, tree_, static_cast<float> (cluster_tolerance_), labeled_clusters, min_pts_per_cluster_, max_pts_per_cluster_);
148148

149149
// Sort the clusters based on their size (largest one first)
150150
for (auto &labeled_cluster : labeled_clusters)
@@ -154,6 +154,7 @@ pcl::LabeledEuclideanClusterExtraction<PointT>::extract (std::vector<std::vector
154154
}
155155

156156
#define PCL_INSTANTIATE_LabeledEuclideanClusterExtraction(T) template class PCL_EXPORTS pcl::LabeledEuclideanClusterExtraction<T>;
157-
#define PCL_INSTANTIATE_extractLabeledEuclideanClusters(T) template void PCL_EXPORTS pcl::extractLabeledEuclideanClusters<T>(const pcl::PointCloud<T> &, const typename pcl::search::Search<T>::Ptr &, float , std::vector<std::vector<pcl::PointIndices> > &, unsigned int, unsigned int, unsigned int);
157+
#define PCL_INSTANTIATE_extractLabeledEuclideanClusters_deprecated(T) template void PCL_EXPORTS pcl::extractLabeledEuclideanClusters<T>(const pcl::PointCloud<T> &, const typename pcl::search::Search<T>::Ptr &, float , std::vector<std::vector<pcl::PointIndices> > &, unsigned int, unsigned int, unsigned int);
158+
#define PCL_INSTANTIATE_extractLabeledEuclideanClusters(T) template void PCL_EXPORTS pcl::extractLabeledEuclideanClusters<T>(const pcl::PointCloud<T> &, const typename pcl::search::Search<T>::Ptr &, float , std::vector<std::vector<pcl::PointIndices> > &, unsigned int, unsigned int);
158159

159160
#endif // PCL_EXTRACT_CLUSTERS_IMPL_H_

segmentation/src/extract_clusters.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@
5353
PCL_INSTANTIATE(extractEuclideanClusters_indices, PCL_XYZ_POINT_TYPES)
5454
#endif
5555
PCL_INSTANTIATE(LabeledEuclideanClusterExtraction, PCL_XYZL_POINT_TYPES)
56+
PCL_INSTANTIATE(extractLabeledEuclideanClusters_deprecated, PCL_XYZL_POINT_TYPES)
5657
PCL_INSTANTIATE(extractLabeledEuclideanClusters, PCL_XYZL_POINT_TYPES)
5758

0 commit comments

Comments
 (0)