-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathutils.h
91 lines (80 loc) · 2.01 KB
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef KINUTILS_H
#define KINUTILS_H
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
#include <iostream>
#include <k4a/k4a.h>
class BufferDepth {
public:
BufferDepth();
BufferDepth(uint16_t* data, size_t rows, size_t cols, size_t stride);
~BufferDepth();
uint16_t *data();
size_t rows() const;
size_t cols() const;
size_t stride() const;
private:
std::shared_ptr<uint16_t> m_data;
size_t m_rows, m_cols, m_stride;
};
class BufferColor {
public:
BufferColor();
BufferColor(uint8_t* data, size_t rows, size_t cols, size_t stride);
~BufferColor();
uint8_t *data();
size_t rows() const;
size_t cols() const;
size_t stride() const;
private:
std::shared_ptr<uint8_t> m_data;
size_t m_rows, m_cols, m_stride;
};
class BufferBodyIndex {
public:
BufferBodyIndex();
BufferBodyIndex(uint8_t* data, size_t rows, size_t cols, size_t stride);
~BufferBodyIndex();
uint8_t *data();
size_t rows() const;
size_t cols() const;
size_t stride() const;
private:
std::shared_ptr<uint8_t> m_data;
size_t m_rows, m_cols, m_stride;
};
class BufferPointCloud {
public:
BufferPointCloud(int16_t* data, size_t rows, size_t cols, size_t stride);
~BufferPointCloud();
int16_t *data();
size_t rows() const;
size_t cols() const;
size_t stride() const;
private:
std::shared_ptr<int16_t> m_data;
size_t m_rows, m_cols, m_stride;
};
struct ColorData {
BufferColor buffer;
uint64_t timestamp_nsec;
};
struct DepthData {
BufferDepth buffer;
uint64_t timestamp_nsec;
};
struct BodyIndexData {
BufferBodyIndex buffer;
uint64_t timestamp_nsec;
};
struct Imu_sample {
float temperature;
float acc_x, acc_y, acc_z;
uint64_t acc_timestamp_usec;
float gyro_x, gyro_y, gyro_z;
uint64_t gyro_timestamp_usec;
};
void write_point_cloud(const k4a_image_t point_cloud_image,
const k4a_image_t color_image,
const char *file_name);
#endif