Point Cloud Library (PCL) 1.15.0
Loading...
Searching...
No Matches
pcl::people::HeightMap2D< PointT > Class Template Reference

HeightMap2D represents a class for creating a 2D height map from a point cloud and searching for its local maxima More...

#include <pcl/people/height_map_2d.h>

Public Types

using PointCloud = pcl::PointCloud<PointT>
using PointCloudPtr = typename PointCloud::Ptr
using PointCloudConstPtr = typename PointCloud::ConstPtr

Public Member Functions

 HeightMap2D ()
 Constructor.
virtual ~HeightMap2D ()
 Destructor.
void compute (pcl::people::PersonCluster< PointT > &cluster)
 Compute the height map with the projection of cluster points onto the ground plane.
void searchLocalMaxima ()
 Compute local maxima of the height map.
void filterMaxima ()
 Filter maxima of the height map by imposing a minimum distance between them.
void setInputCloud (PointCloudPtr &cloud)
 Set initial cluster indices.
void setGround (Eigen::VectorXf &ground_coeffs)
 Set the ground coefficients.
void setBinSize (float bin_size)
 Set bin size for the height map.
void setMinimumDistanceBetweenMaxima (float minimum_distance_between_maxima)
 Set minimum distance between maxima.
void setSensorPortraitOrientation (bool vertical)
 Set sensor orientation to landscape mode (false) or portrait mode (true).
std::vector< int > & getHeightMap ()
 Get the height map as a vector of int.
float getBinSize ()
 Get bin size for the height map.
float getMinimumDistanceBetweenMaxima ()
 Get minimum distance between maxima of the height map.
int & getMaximaNumberAfterFiltering ()
 Return the maxima number after the filterMaxima method.
std::vector< int > & getMaximaCloudIndicesFiltered ()
 Return the point cloud indices corresponding to the maxima computed after the filterMaxima method.

Protected Attributes

Eigen::VectorXf ground_coeffs_
 ground plane coefficients
float sqrt_ground_coeffs_
 ground plane normalization factor
PointCloudPtr cloud_
 pointer to the input cloud
bool vertical_
 if true, the sensor is considered to be vertically placed (portrait mode)
std::vector< int > buckets_
 vector with maximum height values for every bin (height map)
std::vector< int > buckets_cloud_indices_
 indices of the pointcloud points with maximum height for every bin
float bin_size_
 bin dimension
int maxima_number_
 number of local maxima in the height map
std::vector< int > maxima_indices_
 contains the position of the maxima in the buckets vector
std::vector< int > maxima_cloud_indices_
 contains the point cloud position of the maxima (indices of the point cloud)
int maxima_number_after_filtering_
 number of local maxima after filtering
std::vector< int > maxima_indices_filtered_
 contains the position of the maxima in the buckets array after filtering
std::vector< int > maxima_cloud_indices_filtered_
 contains the point cloud position of the maxima after filtering
float min_dist_between_maxima_
 minimum allowed distance between maxima

Detailed Description

template<typename PointT>
class pcl::people::HeightMap2D< PointT >

HeightMap2D represents a class for creating a 2D height map from a point cloud and searching for its local maxima

Author
Matteo Munaro

Definition at line 57 of file height_map_2d.h.

Member Typedef Documentation

◆ PointCloud

Definition at line 61 of file height_map_2d.h.

◆ PointCloudConstPtr

template<typename PointT>
using pcl::people::HeightMap2D< PointT >::PointCloudConstPtr = typename PointCloud::ConstPtr

Definition at line 63 of file height_map_2d.h.

◆ PointCloudPtr

template<typename PointT>
using pcl::people::HeightMap2D< PointT >::PointCloudPtr = typename PointCloud::Ptr

Definition at line 62 of file height_map_2d.h.

Constructor & Destructor Documentation

◆ HeightMap2D()

template<typename PointT>
pcl::people::HeightMap2D< PointT >::HeightMap2D ( )

Constructor.

Definition at line 47 of file height_map_2d.hpp.

References bin_size_, min_dist_between_maxima_, sqrt_ground_coeffs_, and vertical_.

◆ ~HeightMap2D()

template<typename PointT>
pcl::people::HeightMap2D< PointT >::~HeightMap2D ( )
virtualdefault

Destructor.

Member Function Documentation

◆ compute()

◆ filterMaxima()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::filterMaxima ( )

Filter maxima of the height map by imposing a minimum distance between them.

Definition at line 202 of file height_map_2d.hpp.

References ground_coeffs_, maxima_cloud_indices_, maxima_cloud_indices_filtered_, maxima_indices_, maxima_indices_filtered_, maxima_number_, maxima_number_after_filtering_, min_dist_between_maxima_, and sqrt_ground_coeffs_.

Referenced by compute().

◆ getBinSize()

template<typename PointT>
float pcl::people::HeightMap2D< PointT >::getBinSize ( )

Get bin size for the height map.

Definition at line 283 of file height_map_2d.hpp.

References bin_size_.

◆ getHeightMap()

template<typename PointT>
std::vector< int > & pcl::people::HeightMap2D< PointT >::getHeightMap ( )

Get the height map as a vector of int.

Definition at line 277 of file height_map_2d.hpp.

References buckets_.

◆ getMaximaCloudIndicesFiltered()

template<typename PointT>
std::vector< int > & pcl::people::HeightMap2D< PointT >::getMaximaCloudIndicesFiltered ( )

Return the point cloud indices corresponding to the maxima computed after the filterMaxima method.

Definition at line 301 of file height_map_2d.hpp.

References maxima_cloud_indices_filtered_.

Referenced by pcl::people::HeadBasedSubclustering< PointT >::subcluster().

◆ getMaximaNumberAfterFiltering()

template<typename PointT>
int & pcl::people::HeightMap2D< PointT >::getMaximaNumberAfterFiltering ( )

Return the maxima number after the filterMaxima method.

Definition at line 295 of file height_map_2d.hpp.

References maxima_number_after_filtering_.

Referenced by pcl::people::HeadBasedSubclustering< PointT >::subcluster().

◆ getMinimumDistanceBetweenMaxima()

template<typename PointT>
float pcl::people::HeightMap2D< PointT >::getMinimumDistanceBetweenMaxima ( )

Get minimum distance between maxima of the height map.

Definition at line 289 of file height_map_2d.hpp.

References min_dist_between_maxima_.

◆ searchLocalMaxima()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::searchLocalMaxima ( )

Compute local maxima of the height map.

Definition at line 119 of file height_map_2d.hpp.

References buckets_, buckets_cloud_indices_, maxima_cloud_indices_, maxima_indices_, and maxima_number_.

Referenced by compute().

◆ setBinSize()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::setBinSize ( float bin_size)

Set bin size for the height map.

Parameters
[in]bin_sizeBin size for the height map (default = 0.06).

Definition at line 259 of file height_map_2d.hpp.

References bin_size_.

◆ setGround()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::setGround ( Eigen::VectorXf & ground_coeffs)

Set the ground coefficients.

Parameters
[in]ground_coeffsThe ground plane coefficients.

Definition at line 252 of file height_map_2d.hpp.

References ground_coeffs_, and sqrt_ground_coeffs_.

Referenced by pcl::people::HeadBasedSubclustering< PointT >::subcluster().

◆ setInputCloud()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::setInputCloud ( PointCloudPtr & cloud)

Set initial cluster indices.

Parameters
[in]cloudA pointer to the input cloud.

Definition at line 246 of file height_map_2d.hpp.

References cloud_.

Referenced by pcl::people::HeadBasedSubclustering< PointT >::subcluster().

◆ setMinimumDistanceBetweenMaxima()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::setMinimumDistanceBetweenMaxima ( float minimum_distance_between_maxima)

Set minimum distance between maxima.

Parameters
[in]minimum_distance_between_maximaMinimum allowed distance between maxima (default = 0.3).

Definition at line 265 of file height_map_2d.hpp.

References min_dist_between_maxima_.

Referenced by pcl::people::HeadBasedSubclustering< PointT >::subcluster().

◆ setSensorPortraitOrientation()

template<typename PointT>
void pcl::people::HeightMap2D< PointT >::setSensorPortraitOrientation ( bool vertical)

Set sensor orientation to landscape mode (false) or portrait mode (true).

Parameters
[in]verticalLandscape (false) or portrait (true) mode (default = false).

Definition at line 271 of file height_map_2d.hpp.

References vertical_.

Referenced by pcl::people::HeadBasedSubclustering< PointT >::subcluster().

Member Data Documentation

◆ bin_size_

template<typename PointT>
float pcl::people::HeightMap2D< PointT >::bin_size_
protected

bin dimension

Definition at line 181 of file height_map_2d.h.

Referenced by compute(), getBinSize(), HeightMap2D(), and setBinSize().

◆ buckets_

template<typename PointT>
std::vector<int> pcl::people::HeightMap2D< PointT >::buckets_
protected

vector with maximum height values for every bin (height map)

Definition at line 175 of file height_map_2d.h.

Referenced by compute(), getHeightMap(), and searchLocalMaxima().

◆ buckets_cloud_indices_

template<typename PointT>
std::vector<int> pcl::people::HeightMap2D< PointT >::buckets_cloud_indices_
protected

indices of the pointcloud points with maximum height for every bin

Definition at line 178 of file height_map_2d.h.

Referenced by compute(), and searchLocalMaxima().

◆ cloud_

template<typename PointT>
PointCloudPtr pcl::people::HeightMap2D< PointT >::cloud_
protected

pointer to the input cloud

Definition at line 169 of file height_map_2d.h.

Referenced by compute(), and setInputCloud().

◆ ground_coeffs_

template<typename PointT>
Eigen::VectorXf pcl::people::HeightMap2D< PointT >::ground_coeffs_
protected

ground plane coefficients

Definition at line 163 of file height_map_2d.h.

Referenced by compute(), filterMaxima(), and setGround().

◆ maxima_cloud_indices_

template<typename PointT>
std::vector<int> pcl::people::HeightMap2D< PointT >::maxima_cloud_indices_
protected

contains the point cloud position of the maxima (indices of the point cloud)

Definition at line 190 of file height_map_2d.h.

Referenced by compute(), filterMaxima(), and searchLocalMaxima().

◆ maxima_cloud_indices_filtered_

template<typename PointT>
std::vector<int> pcl::people::HeightMap2D< PointT >::maxima_cloud_indices_filtered_
protected

contains the point cloud position of the maxima after filtering

Definition at line 199 of file height_map_2d.h.

Referenced by compute(), filterMaxima(), and getMaximaCloudIndicesFiltered().

◆ maxima_indices_

template<typename PointT>
std::vector<int> pcl::people::HeightMap2D< PointT >::maxima_indices_
protected

contains the position of the maxima in the buckets vector

Definition at line 187 of file height_map_2d.h.

Referenced by compute(), filterMaxima(), and searchLocalMaxima().

◆ maxima_indices_filtered_

template<typename PointT>
std::vector<int> pcl::people::HeightMap2D< PointT >::maxima_indices_filtered_
protected

contains the position of the maxima in the buckets array after filtering

Definition at line 196 of file height_map_2d.h.

Referenced by compute(), and filterMaxima().

◆ maxima_number_

template<typename PointT>
int pcl::people::HeightMap2D< PointT >::maxima_number_
protected

number of local maxima in the height map

Definition at line 184 of file height_map_2d.h.

Referenced by filterMaxima(), and searchLocalMaxima().

◆ maxima_number_after_filtering_

template<typename PointT>
int pcl::people::HeightMap2D< PointT >::maxima_number_after_filtering_
protected

number of local maxima after filtering

Definition at line 193 of file height_map_2d.h.

Referenced by filterMaxima(), and getMaximaNumberAfterFiltering().

◆ min_dist_between_maxima_

template<typename PointT>
float pcl::people::HeightMap2D< PointT >::min_dist_between_maxima_
protected

minimum allowed distance between maxima

Definition at line 202 of file height_map_2d.h.

Referenced by filterMaxima(), getMinimumDistanceBetweenMaxima(), HeightMap2D(), and setMinimumDistanceBetweenMaxima().

◆ sqrt_ground_coeffs_

template<typename PointT>
float pcl::people::HeightMap2D< PointT >::sqrt_ground_coeffs_
protected

ground plane normalization factor

Definition at line 166 of file height_map_2d.h.

Referenced by compute(), filterMaxima(), HeightMap2D(), and setGround().

◆ vertical_

template<typename PointT>
bool pcl::people::HeightMap2D< PointT >::vertical_
protected

if true, the sensor is considered to be vertically placed (portrait mode)

Definition at line 172 of file height_map_2d.h.

Referenced by compute(), HeightMap2D(), and setSensorPortraitOrientation().


The documentation for this class was generated from the following files: