Open3D (C++ API)  0.14.1+b449b58
Public Types | Public Member Functions
open3d::t::geometry::TSDFVoxelGrid Class Reference

#include <TSDFVoxelGrid.h>

Public Types

enum  SurfaceMaskCode {
  None = 0, VertexMap = (1 << 0), DepthMap = (1 << 1), ColorMap = (1 << 2),
  NormalMap = (1 << 3), RangeMap = (1 << 4)
}
 

Public Member Functions

 TSDFVoxelGrid (std::unordered_map< std::string, core::Dtype > attr_dtype_map={{"tsdf", core::Float32}, {"weight", core::UInt16}, {"color", core::UInt16}}, float voxel_size=3.0/512.0, float sdf_trunc=0.04, int64_t block_resolution=16, int64_t block_count=1000, const core::Device &device=core::Device("CPU:0"), const core::HashBackendType &backend=core::HashBackendType::Default)
 Default Constructor. More...
 
 ~TSDFVoxelGrid ()
 
void Integrate (const Image &depth, const core::Tensor &intrinsics, const core::Tensor &extrinsics, float depth_scale=1000.0f, float depth_max=3.0f)
 Depth-only integration. More...
 
void Integrate (const Image &depth, const Image &color, const core::Tensor &intrinsics, const core::Tensor &extrinsics, float depth_scale=1000.0f, float depth_max=3.0f)
 RGB-D integration. More...
 
std::unordered_map< SurfaceMaskCode, core::TensorRayCast (const core::Tensor &intrinsics, const core::Tensor &extrinsics, int width, int height, float depth_scale=1000.0f, float depth_min=0.1f, float depth_max=3.0f, float weight_threshold=3.0f, int ray_cast_mask=SurfaceMaskCode::DepthMap|SurfaceMaskCode::ColorMap)
 
PointCloud ExtractSurfacePoints (int estimate_number=-1, float weight_threshold=3.0f, int surface_mask=SurfaceMaskCode::VertexMap|SurfaceMaskCode::ColorMap)
 
TriangleMesh ExtractSurfaceMesh (int estimate_vertices=-1, float weight_threshold=3.0f, int surface_mask=SurfaceMaskCode::VertexMap|SurfaceMaskCode::NormalMap|SurfaceMaskCode::ColorMap)
 
TSDFVoxelGrid To (const core::Device &device, bool copy=false) const
 
TSDFVoxelGrid Clone () const
 Clone TSDFVoxelGrid on the same device. More...
 
float GetVoxelSize () const
 
float GetSDFTrunc () const
 
int64_t GetBlockResolution () const
 
int64_t GetBlockCount () const
 
std::unordered_map< std::string, core::DtypeGetAttrDtypeMap () const
 
core::Device GetDevice () const
 
std::shared_ptr< core::HashMapGetBlockHashMap ()
 
std::shared_ptr< core::HashMapGetBlockHashMap () const
 

Detailed Description

Scalable voxel grid specialized for TSDF integration. The 3D space is organized in such a way: Space is first coarsely divided into blocks that can be indexed by 3D coordinates. Each block is then further divided into voxels as a Tensor of shape (resolution, resolution, resolution, channel). For pure geometric TSDF voxels, channel = 2 (TSDF + weight). For colored TSDF voxels, channel = 5 (TSDF + weight + color). Users may specialize their own channels that can be reinterpreted from the internal Tensor.

Member Enumeration Documentation

◆ SurfaceMaskCode

Enumerator
None 
VertexMap 
DepthMap 
ColorMap 
NormalMap 
RangeMap 

Constructor & Destructor Documentation

◆ TSDFVoxelGrid()

open3d::t::geometry::TSDFVoxelGrid::TSDFVoxelGrid ( std::unordered_map< std::string, core::Dtype attr_dtype_map = {{"tsdf", core::Float32}, {"weight", core::UInt16}, {"color", core::UInt16}},
float  voxel_size = 3.0 / 512.0,
float  sdf_trunc = 0.04,
int64_t  block_resolution = 16,
int64_t  block_count = 1000,
const core::Device device = core::Device("CPU:0"),
const core::HashBackendType backend = core::HashBackendType::Default 
)

Default Constructor.

◆ ~TSDFVoxelGrid()

open3d::t::geometry::TSDFVoxelGrid::~TSDFVoxelGrid ( )
inline

Member Function Documentation

◆ Clone()

TSDFVoxelGrid open3d::t::geometry::TSDFVoxelGrid::Clone ( ) const
inline

Clone TSDFVoxelGrid on the same device.

◆ ExtractSurfaceMesh()

TriangleMesh open3d::t::geometry::TSDFVoxelGrid::ExtractSurfaceMesh ( int  estimate_vertices = -1,
float  weight_threshold = 3.0f,
int  surface_mask = SurfaceMaskCode::VertexMap | SurfaceMaskCode::NormalMap | SurfaceMaskCode::ColorMap 
)

Extract mesh near iso-surfaces with Marching Cubes. Weight threshold is used to filter outliers. By default we use 3.0, where we assume a reliable surface point comes from the fusion of at least 3 viewpoints. Use as low as 0.0 to accept all the possible observations.

◆ ExtractSurfacePoints()

PointCloud open3d::t::geometry::TSDFVoxelGrid::ExtractSurfacePoints ( int  estimate_number = -1,
float  weight_threshold = 3.0f,
int  surface_mask = SurfaceMaskCode::VertexMap | SurfaceMaskCode::ColorMap 
)

Extract point cloud near iso-surfaces. Weight threshold is used to filter outliers. By default we use 3.0, where we assume a reliable surface point comes from the fusion of at least 3 viewpoints. Use as low as 0.0 to accept all the possible observations.

◆ GetAttrDtypeMap()

std::unordered_map<std::string, core::Dtype> open3d::t::geometry::TSDFVoxelGrid::GetAttrDtypeMap ( ) const
inline

◆ GetBlockCount()

int64_t open3d::t::geometry::TSDFVoxelGrid::GetBlockCount ( ) const
inline

◆ GetBlockHashMap() [1/2]

std::shared_ptr<core::HashMap> open3d::t::geometry::TSDFVoxelGrid::GetBlockHashMap ( )
inline

◆ GetBlockHashMap() [2/2]

std::shared_ptr<core::HashMap> open3d::t::geometry::TSDFVoxelGrid::GetBlockHashMap ( ) const
inline

◆ GetBlockResolution()

int64_t open3d::t::geometry::TSDFVoxelGrid::GetBlockResolution ( ) const
inline

◆ GetDevice()

core::Device open3d::t::geometry::TSDFVoxelGrid::GetDevice ( ) const
inline

◆ GetSDFTrunc()

float open3d::t::geometry::TSDFVoxelGrid::GetSDFTrunc ( ) const
inline

◆ GetVoxelSize()

float open3d::t::geometry::TSDFVoxelGrid::GetVoxelSize ( ) const
inline

◆ Integrate() [1/2]

void open3d::t::geometry::TSDFVoxelGrid::Integrate ( const Image depth,
const core::Tensor intrinsics,
const core::Tensor extrinsics,
float  depth_scale = 1000.0f,
float  depth_max = 3.0f 
)

Depth-only integration.

◆ Integrate() [2/2]

void open3d::t::geometry::TSDFVoxelGrid::Integrate ( const Image depth,
const Image color,
const core::Tensor intrinsics,
const core::Tensor extrinsics,
float  depth_scale = 1000.0f,
float  depth_max = 3.0f 
)

RGB-D integration.

◆ RayCast()

std::unordered_map< TSDFVoxelGrid::SurfaceMaskCode, core::Tensor > open3d::t::geometry::TSDFVoxelGrid::RayCast ( const core::Tensor intrinsics,
const core::Tensor extrinsics,
int  width,
int  height,
float  depth_scale = 1000.0f,
float  depth_min = 0.1f,
float  depth_max = 3.0f,
float  weight_threshold = 3.0f,
int  ray_cast_mask = SurfaceMaskCode::DepthMap | SurfaceMaskCode::ColorMap 
)

Use volumetric ray casting to obtain vertex and color maps, mainly for dense visual odometry. intrinsics and extrinsics defines the camera properties for image generation. width and height defines the image size. Note: vertex map is interpolated along the ray, but color map is not trilinearly interpolated due to performance requirements. Colormap is only used for a reference now.

◆ To()

TSDFVoxelGrid open3d::t::geometry::TSDFVoxelGrid::To ( const core::Device device,
bool  copy = false 
) const

Convert TSDFVoxelGrid to the target device.

Parameters
deviceThe targeted device to convert to.
copyIf true, a new TSDFVoxelGrid is always created; if false, the copy is avoided when the original TSDFVoxelGrid is already on the targeted device.

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