ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::t::pipelines::slam::Model Class Reference

#include <Model.h>

Collaboration diagram for cloudViewer::t::pipelines::slam::Model:

Public Member Functions

 Model ()
 
 Model (float voxel_size, int block_resolution=16, int block_count=1000, const core::Tensor &T_init=core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), const core::Device &device=core::Device("CUDA:0"))
 
core::Tensor GetCurrentFramePose () const
 
void UpdateFramePose (int frame_id, const core::Tensor &T_frame_to_world)
 
void SynthesizeModelFrame (Frame &raycast_frame, float depth_scale=1000.0, float depth_min=0.1, float depth_max=3.0, float trunc_voxel_multiplier=8.0, bool enable_color=true, float weight_threshold=-1.0)
 
odometry::OdometryResult TrackFrameToModel (const Frame &input_frame, const Frame &raycast_frame, float depth_scale=1000.0, float depth_max=3.0, float depth_diff=0.07, odometry::Method method=odometry::Method::PointToPlane, const std::vector< odometry::OdometryConvergenceCriteria > &criteria={6, 3, 1})
 
void Integrate (const Frame &input_frame, float depth_scale=1000.0, float depth_max=3.0, float trunc_voxel_multiplier=8.0f)
 
t::geometry::PointCloud ExtractPointCloud (float weight_threshold=3.0f, int estimated_number=-1)
 
t::geometry::TriangleMesh ExtractTriangleMesh (float weight_threshold=3.0f, int estimated_number=-1)
 
core::HashMap GetHashMap ()
 Get block hashmap int the VoxelBlockGrid. More...
 

Public Attributes

t::geometry::VoxelBlockGrid voxel_grid_
 Maintained volumetric map. More...
 
core::Tensor frustum_block_coords_
 Active block coordinates from prior integration. More...
 
core::Tensor T_frame_to_world_
 
int frame_id_ = -1
 

Detailed Description

Model class maintaining a volumetric grid and the current active frame's pose. Wraps functionalities including integration, ray casting, and surface reconstruction.

Definition at line 25 of file Model.h.

Constructor & Destructor Documentation

◆ Model() [1/2]

cloudViewer::t::pipelines::slam::Model::Model ( )
inline

Definition at line 27 of file Model.h.

◆ Model() [2/2]

cloudViewer::t::pipelines::slam::Model::Model ( float  voxel_size,
int  block_resolution = 16,
int  block_count = 1000,
const core::Tensor T_init = core::Tensor::Eye(4,                                                         core::Float64,                                                         core::Device("CPU:0")),
const core::Device device = core::Device("CUDA:0") 
)

Definition at line 23 of file Model.cpp.

Member Function Documentation

◆ ExtractPointCloud()

t::geometry::PointCloud cloudViewer::t::pipelines::slam::Model::ExtractPointCloud ( float  weight_threshold = 3.0f,
int  estimated_number = -1 
)

Extract surface point cloud for visualization / model saving.

Parameters
weight_thresholdWeight threshold of the TSDF voxels to prune noise.
estimated_numberEstimation of the point cloud size, helpful for real-time visualization.
Returns
Extracted point cloud.

Definition at line 108 of file Model.cpp.

References cloudViewer::t::geometry::VoxelBlockGrid::ExtractPointCloud(), and voxel_grid_.

Referenced by cloudViewer::t::pipelines::slam::pybind_slam().

◆ ExtractTriangleMesh()

t::geometry::TriangleMesh cloudViewer::t::pipelines::slam::Model::ExtractTriangleMesh ( float  weight_threshold = 3.0f,
int  estimated_number = -1 
)

Extract surface triangle mesh for visualization / model saving.

Parameters
weight_thresholdWeight threshold of the TSDF voxels to prune noise.
estimated_numberEstimation of the point cloud size, helpful for real-time visualization.
Returns
Extracted point cloud.

Definition at line 113 of file Model.cpp.

References cloudViewer::t::geometry::VoxelBlockGrid::ExtractTriangleMesh(), and voxel_grid_.

Referenced by cloudViewer::t::pipelines::slam::pybind_slam().

◆ GetCurrentFramePose()

core::Tensor cloudViewer::t::pipelines::slam::Model::GetCurrentFramePose ( ) const
inline

◆ GetHashMap()

core::HashMap cloudViewer::t::pipelines::slam::Model::GetHashMap ( )

Get block hashmap int the VoxelBlockGrid.

Definition at line 118 of file Model.cpp.

References cloudViewer::t::geometry::VoxelBlockGrid::GetHashMap(), and voxel_grid_.

Referenced by cloudViewer::t::pipelines::slam::pybind_slam().

◆ Integrate()

void cloudViewer::t::pipelines::slam::Model::Integrate ( const Frame input_frame,
float  depth_scale = 1000.0,
float  depth_max = 3.0,
float  trunc_voxel_multiplier = 8.0f 
)

Integrate RGBD frame into the volumetric voxel grid.

Parameters
input_frameInput RGBD frame.
depth_scaleScale factor to convert raw data into meter metric.
depth_maxDepth truncation to discard points far away from the camera.
trunc_voxel_multiplierTruncation distance multiplier in voxel size for signed distance. For instance, –trunc_voxel_multiplier=8 with –voxel_size=0.006(m) creates a truncation distance of 0.048(m).

Definition at line 91 of file Model.cpp.

References color, frustum_block_coords_, GetCurrentFramePose(), cloudViewer::t::pipelines::slam::Frame::GetDataAsImage(), cloudViewer::t::pipelines::slam::Frame::GetIntrinsics(), cloudViewer::t::geometry::VoxelBlockGrid::GetUniqueBlockCoordinates(), cloudViewer::t::geometry::VoxelBlockGrid::Integrate(), cloudViewer::t::geometry::InverseTransformation(), and voxel_grid_.

Referenced by cloudViewer::t::pipelines::slam::pybind_slam().

◆ SynthesizeModelFrame()

void cloudViewer::t::pipelines::slam::Model::SynthesizeModelFrame ( Frame raycast_frame,
float  depth_scale = 1000.0,
float  depth_min = 0.1,
float  depth_max = 3.0,
float  trunc_voxel_multiplier = 8.0,
bool  enable_color = true,
float  weight_threshold = -1.0 
)

Apply ray casting to obtain a synthesized model frame at the down sampled resolution.

Parameters
raycast_frameRGBD frame to fill the raycasting results.
depth_scaleScale factor to convert raw data into meter metric.
depth_minDepth where ray casting starts from.
depth_maxDepth where ray casting stops at.
trunc_voxel_multiplierTruncation distance multiplier in voxel size for signed distance. For instance, –trunc_voxel_multiplier=8 with –voxel_size=0.006(m) creates a truncation distance of 0.048(m).
enable_colorEnable color in the raycasting results.
weight_thresholdWeight threshold of the TSDF voxels to prune noise. Use -1 to apply default logic: min(frame_id_ * 1.0f, 3.0f).

Definition at line 38 of file Model.cpp.

References cloudViewer::core::Float32, frame_id_, frustum_block_coords_, GetCurrentFramePose(), cloudViewer::t::pipelines::slam::Frame::GetData(), cloudViewer::t::pipelines::slam::Frame::GetHeight(), cloudViewer::t::pipelines::slam::Frame::GetIntrinsics(), cloudViewer::t::pipelines::slam::Frame::GetWidth(), cloudViewer::t::geometry::InverseTransformation(), min(), cloudViewer::core::Tensor::NumElements(), cloudViewer::t::geometry::VoxelBlockGrid::RayCast(), result, cloudViewer::t::pipelines::slam::Frame::SetData(), and voxel_grid_.

Referenced by cloudViewer::t::pipelines::slam::pybind_slam().

◆ TrackFrameToModel()

odometry::OdometryResult cloudViewer::t::pipelines::slam::Model::TrackFrameToModel ( const Frame input_frame,
const Frame raycast_frame,
float  depth_scale = 1000.0,
float  depth_max = 3.0,
float  depth_diff = 0.07,
odometry::Method  method = odometry::Method::PointToPlane,
const std::vector< odometry::OdometryConvergenceCriteria > &  criteria = {6, 3, 1} 
)

Track using depth odometry.

Parameters
input_frameInput RGBD frame.
raycast_frameRGBD frame generated by raycasting.
depth_scaleScale factor to convert raw data into meter metric.
depth_maxDepth truncation to discard points far away from the camera
methodMethod used to apply RGBD odometry.
criteriaCriteria used to define and terminate iterations. In multiscale odometry the order is from coarse to fine. Inputting a vector of iterations by default triggers the implicit conversion.

Definition at line 68 of file Model.cpp.

References cloudViewer::core::Tensor::Eye(), cloudViewer::core::Float64, cloudViewer::t::pipelines::slam::Frame::GetDataAsImage(), cloudViewer::t::pipelines::slam::Frame::GetIntrinsics(), and cloudViewer::t::pipelines::odometry::RGBDOdometryMultiScale().

Referenced by cloudViewer::t::pipelines::slam::pybind_slam().

◆ UpdateFramePose()

void cloudViewer::t::pipelines::slam::Model::UpdateFramePose ( int  frame_id,
const core::Tensor T_frame_to_world 
)
inline

Member Data Documentation

◆ frame_id_

int cloudViewer::t::pipelines::slam::Model::frame_id_ = -1

◆ frustum_block_coords_

core::Tensor cloudViewer::t::pipelines::slam::Model::frustum_block_coords_

Active block coordinates from prior integration.

Definition at line 125 of file Model.h.

Referenced by Integrate(), cloudViewer::t::pipelines::slam::pybind_slam(), and SynthesizeModelFrame().

◆ T_frame_to_world_

core::Tensor cloudViewer::t::pipelines::slam::Model::T_frame_to_world_

T_frame_to_model, maintained tracking state in a (4, 4), Float64 Tensor on CPU.

Definition at line 129 of file Model.h.

Referenced by GetCurrentFramePose(), cloudViewer::t::pipelines::slam::pybind_slam(), and UpdateFramePose().

◆ voxel_grid_

t::geometry::VoxelBlockGrid cloudViewer::t::pipelines::slam::Model::voxel_grid_

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