Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions
pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT > Class Template Reference

The Standalone Marching Cubes Class provides encapsulated functionality for the Marching Cubes implementation originally by Anatoly Baksheev. More...

#include </__w/1/s/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/standalone_marching_cubes.h>

Public Types

using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using MeshPtr = pcl::PolygonMesh::Ptr
 

Public Member Functions

 StandaloneMarchingCubes (int voxels_x=512, int voxels_y=512, int voxels_z=512, float volume_size=3.0f)
 Constructor. More...
 
 ~StandaloneMarchingCubes ()
 Destructor. More...
 
MeshPtr getMeshFromTSDFCloud (const PointCloud &cloud)
 Run marching cubes in a TSDF cloud and returns a PolygonMesh. More...
 
void getMeshesFromTSDFVector (const std::vector< PointCloudPtr > &tsdf_clouds, const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &tsdf_offsets)
 Runs marching cubes on every pointcloud in the vector. More...
 
TsdfVolume::Ptr tsdfVolumeGPU ()
 Returns the associated Tsdf Volume buffer in GPU. More...
 
std::vector< int > & tsdfVolumeCPU ()
 Returns the associated Tsdf Volume buffer in CPU. More...
 

Protected Member Functions

void loadTsdfCloudToGPU (const PointCloud &cloud)
 Loads a TSDF Cloud to the TSDF Volume in GPU. More...
 
void convertTsdfVectors (const PointCloud &cloud, std::vector< int > &output)
 Read the data in the point cloud. More...
 
MeshPtr convertTrianglesToMesh (const pcl::gpu::DeviceArray< pcl::PointXYZ > &triangles)
 Converts the triangles buffer device to a PolygonMesh. More...
 
MeshPtr runMarchingCubes ()
 Runs marching cubes on the data that is contained in the TSDF Volume in GPU. More...
 

Detailed Description

template<typename PointT>
class pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >

The Standalone Marching Cubes Class provides encapsulated functionality for the Marching Cubes implementation originally by Anatoly Baksheev.

Author
Raphael Favier
Francisco Heredia

Definition at line 77 of file standalone_marching_cubes.h.

Member Typedef Documentation

◆ MeshPtr

Definition at line 82 of file standalone_marching_cubes.h.

◆ PointCloud

Definition at line 80 of file standalone_marching_cubes.h.

◆ PointCloudPtr

template<typename PointT>
using pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::PointCloudPtr = typename PointCloud::Ptr

Definition at line 81 of file standalone_marching_cubes.h.

Constructor & Destructor Documentation

◆ StandaloneMarchingCubes()

template<typename PointT >
pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::StandaloneMarchingCubes ( int  voxels_x = 512,
int  voxels_y = 512,
int  voxels_z = 512,
float  volume_size = 3.0f 
)

Constructor.

Creating GPU TSDF Volume instance

Creating CPU TSDF Volume instance

Definition at line 46 of file standalone_marching_cubes.hpp.

◆ ~StandaloneMarchingCubes()

Member Function Documentation

◆ convertTrianglesToMesh()

template<typename PointT >
pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh ( const pcl::gpu::DeviceArray< pcl::PointXYZ > &  triangles)
protected

◆ convertTsdfVectors()

template<typename PointT >
void pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTsdfVectors ( const PointCloud cloud,
std::vector< int > &  output 
)
protected

Read the data in the point cloud.

Performs a conversion to a suitable format for the TSDF Volume. Loads the converted data to the output vector.

Parameters
[in]cloudpoint cloud to be converted
[out]outputthe vector of converted values, ready to be loaded to the GPU.

For every point in the cloud

Calculate the index to write to

Definition at line 189 of file standalone_marching_cubes.hpp.

References pcl::PointCloud< PointT >::points.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

◆ getMeshesFromTSDFVector()

template<typename PointT >
void pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::getMeshesFromTSDFVector ( const std::vector< PointCloudPtr > &  tsdf_clouds,
const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &  tsdf_offsets 
)

Runs marching cubes on every pointcloud in the vector.

Returns a vector containing the PolygonMeshes.

Parameters
[in]tsdf_cloudsVector of TSDF Clouds
[in]tsdf_offsetsVector of the offsets for every pointcloud in TsdfClouds. This offset (in indices) indicates the position of the cloud with respect to the absolute origin of the world model

Definition at line 94 of file standalone_marching_cubes.hpp.

References pcl::fromPCLPointCloud2(), pcl::io::savePLYFile(), pcl::toPCLPointCloud2(), and pcl::transformPointCloud().

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

◆ getMeshFromTSDFCloud()

template<typename PointT >
pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::getMeshFromTSDFCloud ( const PointCloud cloud)

Run marching cubes in a TSDF cloud and returns a PolygonMesh.

Input X,Y,Z coordinates must be in indices of the TSDF volume grid, output is in meters.

Parameters
[in]cloudTSDF cloud with indices between [0 ... VOXELS_X][0 ... VOXELS_Y][0 ... VOXELS_Z]. Intensity value corresponds to the TSDF value in that coordinate.
Returns
pointer to a PolygonMesh in meters generated by marching cubes.

Definition at line 70 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

◆ loadTsdfCloudToGPU()

template<typename PointT >
void pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::loadTsdfCloudToGPU ( const PointCloud cloud)
protected

Loads a TSDF Cloud to the TSDF Volume in GPU.

Parameters
[in]cloudTSDF cloud that will be loaded. X,Y,Z of the cloud will only be loaded if their range is between [0 ... VOXELS_X][0 ... VOXELS_Y][0 ... VOXELS_Z]

Definition at line 176 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

◆ runMarchingCubes()

template<typename PointT >
pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::runMarchingCubes ( )
protected

Runs marching cubes on the data that is contained in the TSDF Volume in GPU.

Returns
param[return] pointer to a PolygonMesh in meters generated by marching cubes.

Definition at line 248 of file standalone_marching_cubes.hpp.

References pcl::fromPCLPointCloud2().

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

◆ tsdfVolumeCPU()

template<typename PointT >
std::vector< int > & pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::tsdfVolumeCPU ( )

Returns the associated Tsdf Volume buffer in CPU.

Returns
the Tsdf Volume buffer in CPU returned returned by reference

Definition at line 168 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().

◆ tsdfVolumeGPU()

Returns the associated Tsdf Volume buffer in GPU.

Returns
pointer to the Tsdf Volume buffer in GPU

Definition at line 160 of file standalone_marching_cubes.hpp.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::~StandaloneMarchingCubes().


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