Open3D (C++ API)
0.14.1+b449b58
|
#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::Tensor > | 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) |
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::Dtype > | GetAttrDtypeMap () const |
core::Device | GetDevice () const |
std::shared_ptr< core::HashMap > | GetBlockHashMap () |
std::shared_ptr< core::HashMap > | GetBlockHashMap () const |
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.
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.
|
inline |
|
inline |
Clone TSDFVoxelGrid on the same device.
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.
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
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.
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.
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.
TSDFVoxelGrid open3d::t::geometry::TSDFVoxelGrid::To | ( | const core::Device & | device, |
bool | copy = false |
||
) | const |
Convert TSDFVoxelGrid to the target device.
device | The targeted device to convert to. |
copy | If true, a new TSDFVoxelGrid is always created; if false, the copy is avoided when the original TSDFVoxelGrid is already on the targeted device. |