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

typedef pcl::PointCloud< PointTPointCloud
 
typedef pcl::PointCloud< PointT >::Ptr PointCloudPtr
 
typedef boost::shared_ptr< pcl::PolygonMeshMeshPtr
 

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

template<typename PointT>
typedef boost::shared_ptr<pcl::PolygonMesh> pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr

Definition at line 82 of file standalone_marching_cubes.h.

Definition at line 80 of file standalone_marching_cubes.h.

Definition at line 81 of file standalone_marching_cubes.h.

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename PointT >
pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::MeshPtr pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh ( const pcl::gpu::DeviceArray< pcl::PointXYZ > &  triangles)
protected
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 190 of file standalone_marching_cubes.hpp.

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

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

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

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

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

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

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

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

References pcl::fromPCLPointCloud2().

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

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

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

Returns the associated Tsdf Volume buffer in GPU.

Returns
pointer to the Tsdf Volume buffer in GPU

Definition at line 161 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: