cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::io::kitti_pcd_dataset_t Class Reference

KITTI点云数据集类/KITTI point cloud dataset class. More...

#include <kitti_pcd.hpp>

Inheritance diagram for toolbox::io::kitti_pcd_dataset_t:

Public Member Functions

 kitti_pcd_dataset_t (const std::string &velodye_dir)
 构造函数,加载指定目录下的所有KITTI点云/Constructor, loads all KITTI point clouds in the given directory
 
std::size_t size_impl () const
 获取数据集中的点云数量/Get the number of point clouds in the dataset
 
std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > at_impl (std::size_t index) const
 按索引访问点云/Access a point cloud by index
 
- Public Member Functions inherited from toolbox::io::dataset_t< kitti_pcd_dataset_t, std::unique_ptr< toolbox::types::point_cloud_t< float > > >
std::size_t size () const
 获取数据集大小/Get the size of the dataset
 
std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > operator[] (std::size_t index) const
 通过下标访问数据/Access data by index
 
std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > at (std::size_t index) const
 通过下标访问数据/Access data by index
 
std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > get_item (std::size_t index) const
 获取指定索引的数据/Get data at the specified index
 
std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > get_next ()
 获取下一个元素并推进内部索引/Get the next element and advance the internal index
 
std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > peek_next () const
 查看下一个元素但不推进索引/Peek the next element without advancing the index
 
void reset_iterator ()
 重置内部迭代器索引/Reset the internal iterator index
 
std::size_t current_index () const
 获取当前迭代器索引/Get the current iterator index
 
 dataset_t (const dataset_t &)=delete
 禁用拷贝构造/Copy constructor is disabled
 
 dataset_t (dataset_t &&)=delete
 禁用移动构造/Move constructor is disabled
 
dataset_toperator= (const dataset_t &)=delete
 禁用拷贝赋值/Copy assignment is disabled
 
dataset_toperator= (dataset_t &&)=delete
 禁用移动赋值/Move assignment is disabled
 

Additional Inherited Members

- Public Types inherited from toolbox::io::dataset_t< kitti_pcd_dataset_t, std::unique_ptr< toolbox::types::point_cloud_t< float > > >
using data_type = std::unique_ptr< toolbox::types::point_cloud_t< float > >
 数据类型别名/Type alias for data type
 
- Protected Member Functions inherited from toolbox::io::dataset_t< kitti_pcd_dataset_t, std::unique_ptr< toolbox::types::point_cloud_t< float > > >
 dataset_t ()=default
 构造函数/Constructor
 
 ~dataset_t ()=default
 析构函数/Destructor
 

Detailed Description

KITTI点云数据集类/KITTI point cloud dataset class.

用于加载和访问指定目录下的KITTI格式点云数据/Used to load and access KITTI format point cloud data in a given directory

// 示例:加载KITTI点云数据集并访问点云
toolbox::io::kitti_pcd_dataset_t dataset("/path/to/velodyne");
std::size_t n = dataset.size(); // 获取点云数量/Get number of point clouds
auto cloud_opt = dataset.at(0); // 访问第一个点云/Access the first point
cloud if (cloud_opt && *cloud_opt) {
// 使用点云/Use the point cloud
}
KITTI点云数据集类/KITTI point cloud dataset class.
Definition kitti_pcd.hpp:33

Constructor & Destructor Documentation

◆ kitti_pcd_dataset_t()

toolbox::io::kitti_pcd_dataset_t::kitti_pcd_dataset_t ( const std::string &  velodye_dir)
explicit

构造函数,加载指定目录下的所有KITTI点云/Constructor, loads all KITTI point clouds in the given directory

Parameters
velodye_dirKITTI点云文件所在目录/Directory containing KITTI point cloud files
toolbox::io::kitti_pcd_dataset_t dataset("/path/to/velodyne");

Member Function Documentation

◆ at_impl()

std::optional< std::unique_ptr< toolbox::types::point_cloud_t< float > > > toolbox::io::kitti_pcd_dataset_t::at_impl ( std::size_t  index) const

按索引访问点云/Access a point cloud by index

Parameters
index点云索引/Index of the point cloud
Returns
对应索引的点云的unique_ptr(可选)/Optional unique_ptr to the point cloud at the given index
auto cloud_opt = dataset.at_impl(0);
if (cloud_opt && *cloud_opt) {
// 处理点云/Process the point cloud
}

◆ size_impl()

std::size_t toolbox::io::kitti_pcd_dataset_t::size_impl ( ) const

获取数据集中的点云数量/Get the number of point clouds in the dataset

Returns
点云数量/Number of point clouds
std::size_t n = dataset.size_impl();

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