tsdf_volume.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <kfusion/types.hpp>
4 #include <kfusion/tsdf_buffer.h>
5 #include <cuda_runtime.h>
6 
7 namespace kfusion
8 {
9  namespace cuda
10  {
12  {
13  public:
14  TsdfVolume(const cv::Vec3i& dims);
15  virtual ~TsdfVolume();
16 
17  void create(const Vec3i& dims);
18 
19  Vec3i getDims() const;
20  Vec3f getVoxelSize() const;
21 
22  const CudaData data() const;
23  CudaData data();
24 
25  Vec3f getSize() const;
26  void setSize(const Vec3f& size);
27 
28  float getTruncDist() const;
29  void setTruncDist(float distance);
30 
31  int getMaxWeight() const;
32  void setMaxWeight(int weight);
33 
34  Affine3f getPose() const;
35  void setPose(const Affine3f& pose);
36 
37  float getRaycastStepFactor() const;
38  void setRaycastStepFactor(float factor);
39 
40  ushort2* getCoord(int x, int y, int z, int dim_x, int dim_y);
41 
42 
43  float getGradientDeltaFactor() const;
44  void setGradientDeltaFactor(float factor);
45 
46  Vec3i getGridOrigin() const;
47  void setGridOrigin(const Vec3i& origin);
48 
49  void clearSlice(const kfusion::tsdf_buffer* buffer, const Vec3i offset) const;
50 
51 
52  virtual void clear();
53  virtual void applyAffine(const Affine3f& affine);
54  virtual void integrate(const Dists& dists, tsdf_buffer& buffer, const Affine3f& camera_pose, const Intr& intr);
55  virtual void raycast(const Affine3f& camera_pose, tsdf_buffer& buffer, const Intr& intr, Depth& depth, Normals& normals);
56  virtual void raycast(const Affine3f& camera_pose, tsdf_buffer& buffer, const Intr& intr, Cloud& points, Normals& normals);
57 
68  fetchSliceAsCloud (DeviceArray<Point>& cloud_buffer, const kfusion::tsdf_buffer* buffer, const Vec3i minBounds, const Vec3i maxBounds, const Vec3i globalShift ) const;
69 
70  void swap(CudaData& data);
71 
72  DeviceArray<Point> fetchCloud(DeviceArray<Point>& cloud_buffer, const tsdf_buffer& buffer) const;
73  void fetchNormals(const DeviceArray<Point>& cloud, const tsdf_buffer& buffer, DeviceArray<Normal>& normals) const;
74 
75  struct Entry
76  {
77  typedef unsigned short half;
78 
80  unsigned short weight;
81 
82  static float half2float(half value);
83  static half float2half(float value);
84  };
85  private:
87 
88  float trunc_dist_;
93 
96  };
97  }
98 }
kfusion::cuda::TsdfVolume::dims_
Vec3i dims_
Definition: tsdf_volume.hpp:90
kfusion::cuda::TsdfVolume::data_
CudaData data_
Definition: tsdf_volume.hpp:86
kfusion::cuda::TsdfVolume
Definition: tsdf_volume.hpp:11
kfusion::Vec3f
cv::Vec3f Vec3f
Definition: types.hpp:16
types.hpp
kfusion::cuda::TsdfVolume::Entry::tsdf
half tsdf
Definition: tsdf_volume.hpp:79
kfusion::cuda::TsdfVolume::Entry
Definition: tsdf_volume.hpp:75
kfusion::cuda::DeviceMemory
DeviceMemory class
Definition: device_memory.hpp:21
kfusion::Affine3f
cv::Affine3f Affine3f
Definition: types.hpp:18
kfusion::cuda::TsdfVolume::gradient_delta_factor_
float gradient_delta_factor_
Definition: tsdf_volume.hpp:94
kfusion::Vec3i
cv::Vec3i Vec3i
Definition: types.hpp:17
kfusion::device::Vec3i
int3 Vec3i
Definition: internal.hpp:25
kfusion
Utility.
Definition: capture.hpp:8
kfusion::device::raycast
void raycast(const TsdfVolume &volume, tsdf_buffer &buffer, const Aff3f &aff, const Mat3f &Rinv, const Reprojector &reproj, Depth &depth, Normals &normals, float step_factor, float delta_factor)
kfusion::cuda::DeviceArray< Point >
kfusion::cuda::TsdfVolume::raycast_step_factor_
float raycast_step_factor_
Definition: tsdf_volume.hpp:95
kfusion::cuda::TsdfVolume::max_weight_
int max_weight_
Definition: tsdf_volume.hpp:89
kfusion::cuda::TsdfVolume::pose_
Affine3f pose_
Definition: tsdf_volume.hpp:92
kfusion::cuda::TsdfVolume::Entry::half
unsigned short half
Definition: tsdf_volume.hpp:77
kfusion::tsdf_buffer
Structure to handle buffer addresses.
Definition: tsdf_buffer.h:48
kfusion::device::swap
__kf_hdevice__ void swap(T &a, T &b)
Definition: temp_utils.hpp:10
tsdf_buffer.h
kfusion::device::integrate
void integrate(const Dists &depth, TsdfVolume &volume, tsdf_buffer &buffer, const Aff3f &aff, const Projector &proj)
kfusion::cuda::TsdfVolume::size_
Vec3f size_
Definition: tsdf_volume.hpp:91
kfusion::cuda::TsdfVolume::Entry::weight
unsigned short weight
Definition: tsdf_volume.hpp:80
kfusion::cuda::DeviceArray2D< unsigned short >
kfusion::cuda::TsdfVolume::trunc_dist_
float trunc_dist_
Definition: tsdf_volume.hpp:88
kfusion::Intr
Definition: types.hpp:20
KF_EXPORTS
#define KF_EXPORTS
Definition: exports.hpp:6


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:25