kinfu.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <kfusion/types.hpp>
7 #include <vector>
8 #include <string>
9 
10 namespace kfusion
11 {
12  namespace cuda
13  {
15  KF_EXPORTS void setDevice(int device);
16  KF_EXPORTS std::string getDeviceName(int device);
17  KF_EXPORTS bool checkIfPreFermiGPU(int device);
18  KF_EXPORTS void printCudaDeviceInfo(int device);
19  KF_EXPORTS void printShortCudaDeviceInfo(int device);
20  }
21 
23  {
24  public:
25  typedef cv::Ptr<KinFu> Ptr;
26 
28  {
29  Scene = 0,
30  Normals = 2,
31  SceneAndNormals = 3
32  };
33 
34  KinFu(const KinFuParams& params);
35 
36  const KinFuParams& params() const;
37  KinFuParams& params();
38 
39  void performLastScan();
40 
41  void performShift() { perform_shift_ = true;}
42 
43  bool hasShifted()
44  {return has_shifted_;}
45 
47  {checkForShift_ = !checkForShift_;}
48 
50  {record_mode_ = !record_mode_;}
51 
52  bool isLastScan()
53  {return perform_last_scan_;};
54 
55  const cuda::TsdfVolume& tsdf() const;
56  cuda::TsdfVolume& tsdf();
57 
58  const cuda::CyclicalBuffer& cyclical() const;
59  cuda::CyclicalBuffer& cyclical();
60 
61  const cuda::ProjectiveICP& icp() const;
62  cuda::ProjectiveICP& icp();
63 
64  void reset(Affine3f initialPose = Affine3f::Identity());
65 
66  bool operator()(const cuda::Depth& dpeth, const cuda::Image& image = cuda::Image());
67 
68  void renderImage(cuda::Image& image, int flags = 0);
69  void renderImage(cuda::Image& image, const Affine3f& pose, int flags = 0);
70  void renderImage(cuda::Image& image, const Affine3f& pose, Intr cameraIntrinsics, cv::Size size, int flags = 0);
71 
72  Affine3f getCameraPose (int time = -1) const;
73  std::vector<Affine3f>& getCameraPoses() {return poses_;}
74  private:
75  void allocate_buffers();
76 
79 
80  std::vector<Affine3f> poses_;
81 
84 
88 
94  cv::Ptr<cuda::TsdfVolume> volume_;
97  cv::Ptr<cuda::ProjectiveICP> icp_;
98  };
99 }
cuda::DeviceArray2D< Normal > Normals
Definition: types.hpp:88
cuda::Dists dists_
Definition: kinfu.hpp:82
cuda::CyclicalBuffer cyclical_
Cyclical buffer object.
Definition: kinfu.hpp:96
bool perform_last_scan_
Definition: kinfu.hpp:90
cv::Affine3f Affine3f
Definition: types.hpp:18
bool record_mode_
Definition: kinfu.hpp:92
std::vector< Affine3f > & getCameraPoses()
Definition: kinfu.hpp:73
int frame_counter_
Definition: kinfu.hpp:77
cv::Ptr< KinFu > Ptr
Definition: kinfu.hpp:25
cuda::Cloud points_
Definition: kinfu.hpp:85
KF_EXPORTS bool checkIfPreFermiGPU(int device)
std::vector< Affine3f > poses_
Definition: kinfu.hpp:80
cuda::Depth depths_
Definition: kinfu.hpp:87
KF_EXPORTS int getCudaEnabledDeviceCount()
bool hasShifted()
Definition: kinfu.hpp:43
CyclicalBuffer implements a cyclical TSDF buffer. The class offers a simple interface, by handling shifts and maintaining the world autonomously.
cuda::Normals normals_
Definition: kinfu.hpp:86
cv::Ptr< cuda::ProjectiveICP > icp_
Definition: kinfu.hpp:97
KF_EXPORTS void printShortCudaDeviceInfo(int device)
KF_EXPORTS std::string getDeviceName(int device)
void triggerCheckForShift()
Definition: kinfu.hpp:46
cuda::Frame prev_
Definition: kinfu.hpp:83
#define KF_EXPORTS
Definition: exports.hpp:6
cv::Ptr< cuda::TsdfVolume > volume_
Definition: kinfu.hpp:94
bool has_shifted_
Definition: kinfu.hpp:89
bool isLastScan()
Definition: kinfu.hpp:52
void performShift()
Definition: kinfu.hpp:41
bool perform_shift_
Definition: kinfu.hpp:91
KinFuParams params_
Definition: kinfu.hpp:78
KF_EXPORTS void printCudaDeviceInfo(int device)
Utility.
Definition: capture.hpp:8
void triggerRecord()
Definition: kinfu.hpp:49
KF_EXPORTS void renderImage(const Depth &depth, const Normals &normals, const Intr &intr, const Vec3f &light_pose, Image &image)
Definition: imgproc.cpp:76
KF_EXPORTS void setDevice(int device)
bool checkForShift_
Definition: kinfu.hpp:93


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 Mon Feb 28 2022 22:46:06