Point Cloud Library (PCL)  1.14.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...
 
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.

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

Converts the triangles buffer device to a PolygonMesh.

Parameters
[in]trianglesthe triangles buffer containing the points of the mesh
Returns
pointer to the PolygonMesh egnerated by marchign cubes

Definition at line 218 of file standalone_marching_cubes.hpp.

References pcl::gpu::DeviceArray< T >::download(), pcl::gpu::DeviceMemory::empty(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::points, pcl::gpu::DeviceArray< T >::size(), pcl::toPCLPointCloud2(), pcl::Vertices::vertices, and pcl::PointCloud< PointT >::width.

◆ 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 >::size().

◆ 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().

◆ 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.

◆ 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.

◆ runMarchingCubes()

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 249 of file standalone_marching_cubes.hpp.

References pcl::fromPCLPointCloud2().

◆ 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.

◆ 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.


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