Point Cloud Library (PCL)  1.9.1-dev
List of all members | Classes | Public Types | Public Member Functions
pcl::TSDFVolume< VoxelT, WeightT > Class Template Reference

#include </__w/1/s/gpu/kinfu/tools/tsdf_volume.h>

Classes

struct  Header
 Structure storing voxel grid resolution, volume size (in mm) and element_size of stored data. More...
 
struct  Intr
 Camera intrinsics structure. More...
 

Public Types

typedef boost::shared_ptr< TSDFVolume< VoxelT, WeightT > > Ptr
 
typedef boost::shared_ptr< const TSDFVolume< VoxelT, WeightT > > ConstPtr
 
typedef Eigen::VectorXf VoxelTVec
 

Public Member Functions

 TSDFVolume ()
 Default constructor. More...
 
 TSDFVolume (const std::string &filename)
 Constructor loading data from file. More...
 
void setHeader (const Eigen::Vector3i &resolution, const Eigen::Vector3f &volume_size)
 Set the header directly. More...
 
void resize (Eigen::Vector3i &grid_resolution, const Eigen::Vector3f &volume_size=Eigen::Vector3f(DEFAULT_VOLUME_SIZE_X, DEFAULT_VOLUME_SIZE_Y, DEFAULT_VOLUME_SIZE_Z))
 Resizes the internal storage and updates the header accordingly. More...
 
void resizeDefaultSize ()
 Resize internal storage and header to default sizes defined in tsdf_volume.h. More...
 
bool load (const std::string &filename, bool binary=true)
 Loads volume from file. More...
 
bool save (const std::string &filename="tsdf_volume.dat", bool binary=true) const
 Saves volume to file. More...
 
size_t size () const
 Returns overall number of voxels in grid. More...
 
const Eigen::Vector3f & volumeSize () const
 Returns the volume size in mm. More...
 
Eigen::Vector3f voxelSize () const
 Returns the size of one voxel in mm. More...
 
const Eigen::Vector3i & gridResolution () const
 Returns the voxel grid resolution. More...
 
const Headerheader () const
 Returns constant reference to header. More...
 
const std::vector< VoxelT > & volume () const
 Returns constant reference to the volume std::vector. More...
 
std::vector< VoxelT > & volumeWriteable () const
 Returns writebale(!) reference to volume. More...
 
const std::vector< WeightT > & weights () const
 Returns constant reference to the weights std::vector. More...
 
std::vector< WeightT > & weightsWriteable () const
 Returns writebale(!) reference to volume. More...
 
void convertToTsdfCloud (pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const unsigned step=2) const
 Converts volume to cloud of TSDF values. More...
 
template<typename PointT >
void getVoxelCoord (const PointT &point, Eigen::Vector3i &voxel_coord) const
 Converts the volume to a surface representation via a point cloud. More...
 
template<typename PointT >
void getVoxelCoordAndOffset (const PointT &point, Eigen::Vector3i &voxel_coord, Eigen::Vector3f &offset) const
 Returns the 3D voxel coordinate and point offset wrt. More...
 
bool extractNeighborhood (const Eigen::Vector3i &voxel_coord, int neighborhood_size, VoxelTVec &neighborhood) const
 extracts voxels in neighborhood of given voxel More...
 
bool addNeighborhood (const Eigen::Vector3i &voxel_coord, int neighborhood_size, const VoxelTVec &neighborhood, WeightT voxel_weight)
 adds voxel values in local neighborhood More...
 
void averageValues ()
 averages voxel values by the weight value More...
 
int getLinearVoxelIndex (const Eigen::Array3i &indices) const
 Returns and index for linear access of the volume and weights. More...
 
Eigen::VectorXi getLinearVoxelIndinces (const Eigen::Matrix< int, 3, Eigen::Dynamic > &indices_matrix) const
 Returns a vector of linear indices for voxel coordinates given in 3xn matrix. More...
 

Detailed Description

template<typename VoxelT, typename WeightT>
class pcl::TSDFVolume< VoxelT, WeightT >

Definition at line 56 of file tsdf_volume.h.

Member Typedef Documentation

template<typename VoxelT , typename WeightT >
typedef boost::shared_ptr<const TSDFVolume<VoxelT, WeightT> > pcl::TSDFVolume< VoxelT, WeightT >::ConstPtr

Definition at line 61 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
typedef boost::shared_ptr<TSDFVolume<VoxelT, WeightT> > pcl::TSDFVolume< VoxelT, WeightT >::Ptr

Definition at line 60 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
typedef Eigen::VectorXf pcl::TSDFVolume< VoxelT, WeightT >::VoxelTVec

Definition at line 64 of file tsdf_volume.h.

Constructor & Destructor Documentation

template<typename VoxelT , typename WeightT >
pcl::TSDFVolume< VoxelT, WeightT >::TSDFVolume ( )
inline

Default constructor.

Definition at line 133 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
pcl::TSDFVolume< VoxelT, WeightT >::TSDFVolume ( const std::string &  filename)
inline

Constructor loading data from file.

Definition at line 139 of file tsdf_volume.h.

References pcl::TSDFVolume< VoxelT, WeightT >::load(), and pcl::TSDFVolume< VoxelT, WeightT >::size().

Member Function Documentation

template<typename VoxelT , typename WeightT >
bool pcl::TSDFVolume< VoxelT, WeightT >::addNeighborhood ( const Eigen::Vector3i &  voxel_coord,
int  neighborhood_size,
const VoxelTVec neighborhood,
WeightT  voxel_weight 
)

adds voxel values in local neighborhood

Definition at line 280 of file tsdf_volume.hpp.

References pcl::console::print_info().

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::weightsWriteable().

template<typename VoxelT , typename WeightT >
void pcl::TSDFVolume< VoxelT, WeightT >::averageValues ( )

averages voxel values by the weight value

Definition at line 330 of file tsdf_volume.hpp.

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::weightsWriteable().

template<typename VoxelT , typename WeightT >
void pcl::TSDFVolume< VoxelT, WeightT >::convertToTsdfCloud ( pcl::PointCloud< pcl::PointXYZI >::Ptr cloud,
const unsigned  step = 2 
) const
template<typename VoxelT , typename WeightT >
bool pcl::TSDFVolume< VoxelT, WeightT >::extractNeighborhood ( const Eigen::Vector3i &  voxel_coord,
int  neighborhood_size,
VoxelTVec neighborhood 
) const

extracts voxels in neighborhood of given voxel

Definition at line 227 of file tsdf_volume.hpp.

References pcl::console::print_info().

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::weightsWriteable().

template<typename VoxelT , typename WeightT >
int pcl::TSDFVolume< VoxelT, WeightT >::getLinearVoxelIndex ( const Eigen::Array3i &  indices) const
inline

Returns and index for linear access of the volume and weights.

Definition at line 264 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
Eigen::VectorXi pcl::TSDFVolume< VoxelT, WeightT >::getLinearVoxelIndinces ( const Eigen::Matrix< int, 3, Eigen::Dynamic > &  indices_matrix) const
inline

Returns a vector of linear indices for voxel coordinates given in 3xn matrix.

Definition at line 270 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
template<typename PointT >
void pcl::TSDFVolume< VoxelT, WeightT >::getVoxelCoord ( const PointT point,
Eigen::Vector3i &  voxel_coord 
) const

Converts the volume to a surface representation via a point cloud.

Crate Volume from Point Cloud Returns the 3D voxel coordinate

Definition at line 194 of file tsdf_volume.hpp.

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::weightsWriteable().

template<typename VoxelT , typename WeightT >
template<typename PointT >
void pcl::TSDFVolume< VoxelT, WeightT >::getVoxelCoordAndOffset ( const PointT point,
Eigen::Vector3i &  coord,
Eigen::Vector3f &  offset 
) const

Returns the 3D voxel coordinate and point offset wrt.

to the voxel center (in mm)

Definition at line 209 of file tsdf_volume.hpp.

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::weightsWriteable().

template<typename VoxelT , typename WeightT >
const Eigen::Vector3i& pcl::TSDFVolume< VoxelT, WeightT >::gridResolution ( ) const
inline

Returns the voxel grid resolution.

Definition at line 201 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
const Header& pcl::TSDFVolume< VoxelT, WeightT >::header ( ) const
inline

Returns constant reference to header.

Definition at line 205 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
bool pcl::TSDFVolume< VoxelT, WeightT >::load ( const std::string &  filename,
bool  binary = true 
)
template<typename VoxelT , typename WeightT >
void pcl::TSDFVolume< VoxelT, WeightT >::resize ( Eigen::Vector3i &  grid_resolution,
const Eigen::Vector3f &  volume_size = Eigen::Vector3f (DEFAULT_VOLUME_SIZE_X, DEFAULT_VOLUME_SIZE_Y, DEFAULT_VOLUME_SIZE_Z) 
)
inline

Resizes the internal storage and updates the header accordingly.

Definition at line 159 of file tsdf_volume.h.

References pcl::TSDFVolume< VoxelT, WeightT >::setHeader(), and pcl::TSDFVolume< VoxelT, WeightT >::Header::volume_size.

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::resizeDefaultSize().

template<typename VoxelT , typename WeightT >
void pcl::TSDFVolume< VoxelT, WeightT >::resizeDefaultSize ( )
inline

Resize internal storage and header to default sizes defined in tsdf_volume.h.

Definition at line 168 of file tsdf_volume.h.

References pcl::TSDFVolume< VoxelT, WeightT >::load(), pcl::TSDFVolume< VoxelT, WeightT >::resize(), and pcl::TSDFVolume< VoxelT, WeightT >::save().

template<typename VoxelT , typename WeightT >
bool pcl::TSDFVolume< VoxelT, WeightT >::save ( const std::string &  filename = "tsdf_volume.dat",
bool  binary = true 
) const
template<typename VoxelT , typename WeightT >
void pcl::TSDFVolume< VoxelT, WeightT >::setHeader ( const Eigen::Vector3i &  resolution,
const Eigen::Vector3f &  volume_size 
)
inline

Set the header directly.

Useful if directly writing into volume and weights

Definition at line 151 of file tsdf_volume.h.

References pcl::TSDFVolume< VoxelT, WeightT >::Header::Header(), pcl::console::print_warn(), and pcl::TSDFVolume< VoxelT, WeightT >::size().

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::resize().

template<typename VoxelT , typename WeightT >
size_t pcl::TSDFVolume< VoxelT, WeightT >::size ( ) const
inline

Returns overall number of voxels in grid.

Definition at line 186 of file tsdf_volume.h.

Referenced by pcl::TSDFVolume< VoxelT, WeightT >::setHeader(), and pcl::TSDFVolume< VoxelT, WeightT >::TSDFVolume().

template<typename VoxelT , typename WeightT >
const std::vector<VoxelT>& pcl::TSDFVolume< VoxelT, WeightT >::volume ( ) const
inline

Returns constant reference to the volume std::vector.

Definition at line 209 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
const Eigen::Vector3f& pcl::TSDFVolume< VoxelT, WeightT >::volumeSize ( ) const
inline

Returns the volume size in mm.

Definition at line 190 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
std::vector<VoxelT>& pcl::TSDFVolume< VoxelT, WeightT >::volumeWriteable ( ) const
inline

Returns writebale(!) reference to volume.

Definition at line 213 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
Eigen::Vector3f pcl::TSDFVolume< VoxelT, WeightT >::voxelSize ( ) const
inline

Returns the size of one voxel in mm.

Definition at line 194 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
const std::vector<WeightT>& pcl::TSDFVolume< VoxelT, WeightT >::weights ( ) const
inline

Returns constant reference to the weights std::vector.

Definition at line 217 of file tsdf_volume.h.

template<typename VoxelT , typename WeightT >
std::vector<WeightT>& pcl::TSDFVolume< VoxelT, WeightT >::weightsWriteable ( ) const
inline

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