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 }
kfusion::KinFu::icp_
cv::Ptr< cuda::ProjectiveICP > icp_
Definition: kinfu.hpp:97
kfusion::cuda::setDevice
KF_EXPORTS void setDevice(int device)
kfusion::cuda::checkIfPreFermiGPU
KF_EXPORTS bool checkIfPreFermiGPU(int device)
kfusion::KinFu::prev_
cuda::Frame prev_
Definition: kinfu.hpp:83
kfusion::KinFu::triggerCheckForShift
void triggerCheckForShift()
Definition: kinfu.hpp:46
kfusion::KinFu::volume_
cv::Ptr< cuda::TsdfVolume > volume_
Definition: kinfu.hpp:94
kfusion::cuda::TsdfVolume
Definition: tsdf_volume.hpp:11
cyclical_buffer.h
kfusion::KinFu::performShift
void performShift()
Definition: kinfu.hpp:41
kfusion::KinFu::isLastScan
bool isLastScan()
Definition: kinfu.hpp:52
kfusion::cuda::ProjectiveICP
Definition: projective_icp.hpp:9
kfusion::KinFu::params_
KinFuParams params_
Definition: kinfu.hpp:78
kfusion::KinFu::has_shifted_
bool has_shifted_
Definition: kinfu.hpp:89
types.hpp
kfusion::KinFu::perform_shift_
bool perform_shift_
Definition: kinfu.hpp:91
tsdf_volume.hpp
kfusion::cuda::getDeviceName
KF_EXPORTS std::string getDeviceName(int device)
kfusion::KinFu::triggerRecord
void triggerRecord()
Definition: kinfu.hpp:49
kfusion::Affine3f
cv::Affine3f Affine3f
Definition: types.hpp:18
kfusion::cuda::CyclicalBuffer
CyclicalBuffer implements a cyclical TSDF buffer. The class offers a simple interface,...
Definition: cyclical_buffer.h:64
kfusion::KinFu::perform_last_scan_
bool perform_last_scan_
Definition: kinfu.hpp:90
kfusion
Utility.
Definition: capture.hpp:8
kfusion::KinFu::dists_
cuda::Dists dists_
Definition: kinfu.hpp:82
projective_icp.hpp
kfusion::KinFu::RenderMode
RenderMode
Definition: kinfu.hpp:27
kfusion::cuda::printCudaDeviceInfo
KF_EXPORTS void printCudaDeviceInfo(int device)
kfusion::device::Normals
DeviceArray2D< Normal > Normals
Definition: internal.hpp:21
kfusion::cuda::Frame
Definition: types.hpp:91
kfusion::KinFu
Definition: kinfu.hpp:22
kfusion::cuda::printShortCudaDeviceInfo
KF_EXPORTS void printShortCudaDeviceInfo(int device)
kfusion::KinFuParams
Definition: types.hpp:127
kfusion::KinFu::record_mode_
bool record_mode_
Definition: kinfu.hpp:92
kfusion::KinFu::checkForShift_
bool checkForShift_
Definition: kinfu.hpp:93
kfusion::KinFu::frame_counter_
int frame_counter_
Definition: kinfu.hpp:77
kfusion::KinFu::points_
cuda::Cloud points_
Definition: kinfu.hpp:85
kfusion::KinFu::getCameraPoses
std::vector< Affine3f > & getCameraPoses()
Definition: kinfu.hpp:73
kfusion::KinFu::cyclical_
cuda::CyclicalBuffer cyclical_
Cyclical buffer object.
Definition: kinfu.hpp:96
kfusion::KinFu::Ptr
cv::Ptr< KinFu > Ptr
Definition: kinfu.hpp:25
kfusion::KinFu::hasShifted
bool hasShifted()
Definition: kinfu.hpp:43
kfusion::KinFu::depths_
cuda::Depth depths_
Definition: kinfu.hpp:87
kfusion::KinFu::poses_
std::vector< Affine3f > poses_
Definition: kinfu.hpp:80
kfusion::cuda::DeviceArray2D< unsigned short >
kfusion::cuda::getCudaEnabledDeviceCount
KF_EXPORTS int getCudaEnabledDeviceCount()
kfusion::cuda::renderImage
KF_EXPORTS void renderImage(const Depth &depth, const Normals &normals, const Intr &intr, const Vec3f &light_pose, Image &image)
Definition: imgproc.cpp:76
kfusion::Intr
Definition: types.hpp:20
KF_EXPORTS
#define KF_EXPORTS
Definition: exports.hpp:6
kfusion::KinFu::normals_
cuda::Normals normals_
Definition: kinfu.hpp:86


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:23