41#ifndef PCL_PEOPLE_HEAD_BASED_SUBCLUSTER_HPP_
42#define PCL_PEOPLE_HEAD_BASED_SUBCLUSTER_HPP_
44#include <pcl/people/head_based_subcluster.h>
46template <
typename Po
intT>
51 head_centroid_ =
true;
56 heads_minimum_distance_ = 0.3;
59 sqrt_ground_coeffs_ = std::numeric_limits<float>::quiet_NaN();
62template <
typename Po
intT>
void
68template <
typename Po
intT>
void
75template <
typename Po
intT>
void
81template <
typename Po
intT>
void
87template <
typename Po
intT>
void
94template <
typename Po
intT>
void
101template <
typename Po
intT>
void
107template <
typename Po
intT>
void
113template <
typename Po
intT>
void
120template <
typename Po
intT>
void
127template <
typename Po
intT>
float
130 return (heads_minimum_distance_);
133template <
typename Po
intT>
void
193template <
typename Po
intT>
void
252template <
typename Po
intT>
void
256 if (std::isnan(sqrt_ground_coeffs_))
258 PCL_ERROR (
"[pcl::people::pcl::people::HeadBasedSubclustering::subcluster] Floor parameters have not been set or they are not valid!\n");
261 if (cluster_indices_.empty ())
263 PCL_ERROR (
"[pcl::people::pcl::people::HeadBasedSubclustering::subcluster] Cluster indices have not been set!\n");
266 if (cloud_ ==
nullptr)
268 PCL_ERROR (
"[pcl::people::pcl::people::HeadBasedSubclustering::subcluster] Input cloud has not been set!\n");
273 for(std::vector<pcl::PointIndices>::const_iterator
it = cluster_indices_.begin();
it != cluster_indices_.end(); ++
it)
280 std::vector<pcl::people::PersonCluster<PointT> >
new_clusters;
283 if (
clusters[i].getHeight() <= max_height_)
293 std::vector<pcl::people::PersonCluster<PointT> >
subclusters;
302 height_map_obj.setMinimumDistanceBetweenMaxima(heads_minimum_distance_);
305 float height =
it->getHeight();
307 if(height > min_height_ && height < max_height_)
333template <
typename Po
intT>
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
void setGround(Eigen::VectorXf &ground_coeffs)
Set the ground coefficients.
void setDimensionLimits(int min_points, int max_points)
Set minimum and maximum allowed number of points for a person cluster.
virtual ~HeadBasedSubclustering()
Destructor.
void setHeadCentroid(bool head_centroid)
Set head_centroid_ to true (person centroid is in the head) or false (person centroid is the whole bo...
void subcluster(std::vector< pcl::people::PersonCluster< PointT > > &clusters)
Compute subclusters and return them into a vector of PersonCluster.
typename PointCloud::Ptr PointCloudPtr
void mergeClustersCloseInFloorCoordinates(std::vector< pcl::people::PersonCluster< PointT > > &input_clusters, std::vector< pcl::people::PersonCluster< PointT > > &output_clusters)
Merge clusters close in floor coordinates.
void getHeightLimits(float &min_height, float &max_height)
Get minimum and maximum allowed height for a person cluster.
void setInitialClusters(std::vector< pcl::PointIndices > &cluster_indices)
Set initial cluster indices.
void setMinimumDistanceBetweenHeads(float heads_minimum_distance)
Set minimum distance between persons' heads.
void getDimensionLimits(int &min_points, int &max_points)
Get minimum and maximum allowed number of points for a person cluster.
float getMinimumDistanceBetweenHeads()
Get minimum distance between persons' heads.
void setSensorPortraitOrientation(bool vertical)
Set sensor orientation to landscape mode (false) or portrait mode (true).
void setHeightLimits(float min_height, float max_height)
Set minimum and maximum allowed height for a person cluster.
void createSubClusters(pcl::people::PersonCluster< PointT > &cluster, int maxima_number_after_filtering, std::vector< int > &maxima_cloud_indices_filtered, std::vector< pcl::people::PersonCluster< PointT > > &subclusters)
Create subclusters centered on the heads position from the current cluster.
HeadBasedSubclustering()
Constructor.
void setInputCloud(PointCloudPtr &cloud)
Set input cloud.
HeightMap2D represents a class for creating a 2D height map from a point cloud and searching for its ...
PersonCluster represents a class for representing information about a cluster containing a person.
pcl::PointIndices & getIndices()
Returns the indices of the point cloud points corresponding to the cluster.
A point structure representing Euclidean xyz coordinates, and the RGB color.