ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
TSDFVolume.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <RGBDImage.h>
11 #include <ecvMesh.h>
12 #include <ecvPointCloud.h>
13 
15 
16 namespace cloudViewer {
17 namespace pipelines {
18 namespace integration {
19 
23 enum class TSDFVolumeColorType {
25  NoColor = 0,
27  RGB8 = 1,
29  Gray32 = 2,
30 };
31 
43 class TSDFVolume {
44 public:
50  TSDFVolume(double voxel_length,
51  double sdf_trunc,
52  TSDFVolumeColorType color_type)
53  : voxel_length_(voxel_length),
54  sdf_trunc_(sdf_trunc),
55  color_type_(color_type) {}
56  virtual ~TSDFVolume() {}
57 
58 public:
60  virtual void Reset() = 0;
61 
63  virtual void Integrate(const geometry::RGBDImage &image,
64  const camera::PinholeCameraIntrinsic &intrinsic,
65  const Eigen::Matrix4d &extrinsic) = 0;
66 
68  virtual std::shared_ptr<ccPointCloud> ExtractPointCloud() = 0;
69 
72  virtual std::shared_ptr<ccMesh> ExtractTriangleMesh() = 0;
73 
74 public:
76  double voxel_length_;
78  double sdf_trunc_;
81 };
82 
83 } // namespace integration
84 } // namespace pipelines
85 } // namespace cloudViewer
std::shared_ptr< core::Tensor > image
Contains the pinhole camera intrinsic parameters.
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:27
Base class of the Truncated Signed Distance Function (TSDF) volume.
Definition: TSDFVolume.h:43
double sdf_trunc_
Truncation value for signed distance function (SDF).
Definition: TSDFVolume.h:78
virtual std::shared_ptr< ccMesh > ExtractTriangleMesh()=0
Function to extract a triangle mesh, using the marching cubes algorithm. (https://en....
virtual void Reset()=0
Function to reset the TSDFVolume.
virtual void Integrate(const geometry::RGBDImage &image, const camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic)=0
Function to integrate an RGB-D image into the volume.
double voxel_length_
Length of the voxel in meters.
Definition: TSDFVolume.h:76
virtual std::shared_ptr< ccPointCloud > ExtractPointCloud()=0
Function to extract a point cloud with normals.
TSDFVolumeColorType color_type_
Color type of the TSDF volume.
Definition: TSDFVolume.h:80
TSDFVolume(double voxel_length, double sdf_trunc, TSDFVolumeColorType color_type)
Default Constructor.
Definition: TSDFVolume.h:50
Generic file read and write utility for python interface.