-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrgbd_frame_3d.hpp
More file actions
50 lines (40 loc) · 1.5 KB
/
rgbd_frame_3d.hpp
File metadata and controls
50 lines (40 loc) · 1.5 KB
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
#pragma once
#include "depth_frame_3d.hpp"
namespace erl::geometry {
template<typename Dtype>
class RgbdFrame3D : public DepthFrame3D<Dtype> {
protected:
cv::Mat m_rgb_;
public:
using Super = DepthFrame3D<Dtype>;
using Setting = typename Super::Setting;
using MatrixX = typename Super::MatrixX;
using Matrix3 = typename Super::Matrix3;
using Vector3 = typename Super::Vector3;
explicit RgbdFrame3D(std::shared_ptr<Setting> setting);
/**
*
* @param rotation orientation of the optical frame.
* @param translation translation of the optical frame.
* @param depth depth image.
* @param rgb color image in BGR format if is_rgb is false, otherwise in RGB format.
* @param is_rgb if true, the input color image is in RGB format; if false, in BGR format.
*/
void
UpdateRgbd(
const Eigen::Ref<const Matrix3> &rotation,
const Eigen::Ref<const Vector3> &translation,
const MatrixX &depth,
const cv::Mat &rgb,
bool is_rgb = true);
void
ConvertToPointCloud(
bool in_world_frame,
std::vector<Vector3> &points,
std::vector<Vector3> &colors) const;
};
using RgbdFrame3Dd = RgbdFrame3D<double>;
using RgbdFrame3Df = RgbdFrame3D<float>;
extern template class RgbdFrame3D<double>;
extern template class RgbdFrame3D<float>;
} // namespace erl::geometry