Class to manage a hierarchy of point clouds with different resolutions The hierarchy is organized with coarser levels having fewer points (parents) and finer levels having more points (children).
More...
#include <PointCloudHierarchy.h>
|
| PointCloudHierarchyManager (int min_points=100, int max_points=1000) |
| Constructor.
|
|
template<int spacedim> |
int | generateHierarchy (const std::vector< Point< spacedim > > &input_points, const std::vector< double > &input_density, const std::string &output_dir) |
| Generate hierarchy of point clouds from input points.
|
|
void | setMaxPoints (int max_points) |
| Set the maximum number of points for level 1.
|
|
void | setMinPoints (int min_points) |
| Set the minimum number of points for coarsest level.
|
|
int | getNumLevels () const |
| Get the number of levels in the last generated hierarchy.
|
|
int | getPointCount (int level) const |
| Get the number of points at a specific level.
|
|
int | getPointsForLevel (int base_points, int level) const |
| Calculate number of points for a given level.
|
|
const std::vector< std::vector< size_t > > & | getParentIndices (int level) const |
| Get the parent indices for points at level L-1.
|
|
const std::vector< std::vector< size_t > > & | getChildIndices (int level) const |
| Get the child indices for points at level L.
|
|
|
void | ensureDirectoryExists (const std::string &path) const |
| Ensure directory exists, create if it doesn't.
|
|
template<int spacedim> |
std::tuple< std::vector< std::array< double, spacedim > >, std::vector< double >, std::vector< int > > | kmeansClustering (const std::vector< std::array< double, spacedim > > &points, const std::vector< double > &densities, size_t k) |
| Performs parallel k-means clustering on a set of points with parent-child tracking.
|
|
Class to manage a hierarchy of point clouds with different resolutions The hierarchy is organized with coarser levels having fewer points (parents) and finer levels having more points (children).
Definition at line 23 of file PointCloudHierarchy.h.
◆ PointCloudHierarchyManager()
PointCloudHierarchy::PointCloudHierarchyManager::PointCloudHierarchyManager |
( |
int |
min_points = 100 , |
|
|
int |
max_points = 1000 |
|
) |
| |
Constructor.
- Parameters
-
min_points | Minimum number of points for the coarsest level (parent level) |
max_points | Maximum number of points for level 1 point cloud |
Definition at line 18 of file PointCloudHierarchy.cc.
◆ generateHierarchy()
template<int spacedim>
template int PointCloudHierarchy::PointCloudHierarchyManager::generateHierarchy< 3 > |
( |
const std::vector< Point< spacedim > > & |
input_points, |
|
|
const std::vector< double > & |
input_density, |
|
|
const std::string & |
output_dir |
|
) |
| |
Generate hierarchy of point clouds from input points.
- Parameters
-
input_points | Vector of input points (finest level) |
input_density | Vector of input density values (optional, uniform density if empty) |
output_dir | Directory to save the point cloud hierarchy |
- Returns
- Number of levels generated
- Exceptions
-
std::runtime_error | if processing fails |
Definition at line 127 of file PointCloudHierarchy.cc.
◆ setMaxPoints()
void PointCloudHierarchy::PointCloudHierarchyManager::setMaxPoints |
( |
int |
max_points | ) |
|
◆ setMinPoints()
void PointCloudHierarchy::PointCloudHierarchyManager::setMinPoints |
( |
int |
min_points | ) |
|
◆ getNumLevels()
int PointCloudHierarchy::PointCloudHierarchyManager::getNumLevels |
( |
| ) |
const |
◆ getPointCount()
int PointCloudHierarchy::PointCloudHierarchyManager::getPointCount |
( |
int |
level | ) |
const |
◆ getPointsForLevel()
int PointCloudHierarchy::PointCloudHierarchyManager::getPointsForLevel |
( |
int |
base_points, |
|
|
int |
level |
|
) |
| const |
◆ getParentIndices()
const std::vector< std::vector< size_t > > & PointCloudHierarchy::PointCloudHierarchyManager::getParentIndices |
( |
int |
level | ) |
const |
Get the parent indices for points at level L-1.
- Parameters
-
level | The level of the parents (must be > 0) |
- Returns
- For each point at level L-1, returns index of its parent at level L
Definition at line 43 of file PointCloudHierarchy.cc.
◆ getChildIndices()
const std::vector< std::vector< size_t > > & PointCloudHierarchy::PointCloudHierarchyManager::getChildIndices |
( |
int |
level | ) |
const |
Get the child indices for points at level L.
- Parameters
-
level | The level of points whose children we want (must be < num_levels-1) |
- Returns
- For each point at level L, returns indices of its children at level L-1
Definition at line 50 of file PointCloudHierarchy.cc.
◆ ensureDirectoryExists()
void PointCloudHierarchy::PointCloudHierarchyManager::ensureDirectoryExists |
( |
const std::string & |
path | ) |
const |
|
private |
◆ kmeansClustering()
template<int spacedim>
template std::tuple< std::vector< std::array< double, 3 > >, std::vector< double >, std::vector< int > > PointCloudHierarchy::PointCloudHierarchyManager::kmeansClustering< 3 > |
( |
const std::vector< std::array< double, spacedim > > & |
points, |
|
|
const std::vector< double > & |
densities, |
|
|
size_t |
k |
|
) |
| |
|
private |
Performs parallel k-means clustering on a set of points with parent-child tracking.
- Parameters
-
points | Input points from finer level |
densities | Input densities |
k | Number of clusters (points at coarser level) |
- Returns
- Tuple of:
- cluster centers (parent points)
- aggregated densities for parents
- assignments (mapping of each child to its parent cluster)
Definition at line 80 of file PointCloudHierarchy.cc.
◆ min_points_
int PointCloudHierarchy::PointCloudHierarchyManager::min_points_ |
|
private |
◆ max_points_
int PointCloudHierarchy::PointCloudHierarchyManager::max_points_ |
|
private |
◆ num_levels_
int PointCloudHierarchy::PointCloudHierarchyManager::num_levels_ |
|
private |
◆ level_point_counts_
std::vector<int> PointCloudHierarchy::PointCloudHierarchyManager::level_point_counts_ |
|
private |
◆ parent_indices_
std::vector<std::vector<std::vector<size_t> > > PointCloudHierarchy::PointCloudHierarchyManager::parent_indices_ |
|
private |
◆ child_indices_
std::vector<std::vector<std::vector<size_t> > > PointCloudHierarchy::PointCloudHierarchyManager::child_indices_ |
|
private |
The documentation for this class was generated from the following files: