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
cloudViewer::pipelines::integration::TSDFVolume::Integrate
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.
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::pipelines::integration::TSDFVolume::TSDFVolume
TSDFVolume(double voxel_length, double sdf_trunc, TSDFVolumeColorType color_type)
Default Constructor.
Definition: TSDFVolume.h:50
cloudViewer::pipelines::integration::TSDFVolume
Base class of the Truncated Signed Distance Function (TSDF) volume.
Definition: TSDFVolume.h:43
cloudViewer::pipelines::integration::TSDFVolume::ExtractTriangleMesh
virtual std::shared_ptr< ccMesh > ExtractTriangleMesh()=0
Function to extract a triangle mesh, using the marching cubes algorithm. (https://en....
cloudViewer::pipelines::integration::TSDFVolumeColorType::RGB8
@ RGB8
8 bit RGB.
cloudViewer::pipelines::integration::TSDFVolume::color_type_
TSDFVolumeColorType color_type_
Color type of the TSDF volume.
Definition: TSDFVolume.h:80
cloudViewer::pipelines::integration::TSDFVolume::ExtractPointCloud
virtual std::shared_ptr< ccPointCloud > ExtractPointCloud()=0
Function to extract a point cloud with normals.
ecvMesh.h
cloudViewer::camera::PinholeCameraIntrinsic
Contains the pinhole camera intrinsic parameters.
Definition: PinholeCameraIntrinsic.h:34
image
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:184
cloudViewer::pipelines::integration::TSDFVolumeColorType
TSDFVolumeColorType
Definition: TSDFVolume.h:23
cloudViewer::pipelines::integration::TSDFVolume::~TSDFVolume
virtual ~TSDFVolume()
Definition: TSDFVolume.h:56
cloudViewer::pipelines::integration::TSDFVolume::Reset
virtual void Reset()=0
Function to reset the TSDFVolume.
cloudViewer::geometry::RGBDImage
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:27
cloudViewer::pipelines::integration::TSDFVolumeColorType::Gray32
@ Gray32
32 bit GrayScale.
cloudViewer::pipelines::integration::TSDFVolume::sdf_trunc_
double sdf_trunc_
Truncation value for signed distance function (SDF).
Definition: TSDFVolume.h:78
ecvPointCloud.h
PinholeCameraIntrinsic.h
cloudViewer::pipelines::integration::TSDFVolume::voxel_length_
double voxel_length_
Length of the voxel in meters.
Definition: TSDFVolume.h:76
cloudViewer::pipelines::integration::TSDFVolumeColorType::NoColor
@ NoColor
No color.