supereight
reader_interiornet.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020-2022 Smart Robotics Lab, Imperial College London, Technical University of Munich
3  * SPDX-FileCopyrightText: 2020-2022 Nils Funk
4  * SPDX-FileCopyrightText: 2020-2022 Sotiris Papatheodorou
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef SE_READER_INTERIORNET_HPP
9 #define SE_READER_INTERIORNET_HPP
10 
11 
12 
13 #include <Eigen/Dense>
14 #include <cstdint>
15 #include <fstream>
16 #include <opencv2/core/core.hpp>
17 #include <opencv2/imgproc/imgproc.hpp>
18 #include <opencv2/opencv.hpp>
19 #include <string>
20 
21 #include "reader_base.hpp"
22 #include "se/image/image.hpp"
23 
24 
25 
26 namespace se {
27 
28 
29 
33 class InteriorNetReader : public Reader {
34  public:
40 
42  void restart();
43 
44 
49  std::string name() const;
50 
51  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
52 
53  private:
54  static constexpr float interiornet_inverse_scale_ = 1.0f / 1000.0f;
55  float inverse_scale_;
56 
57  // TODO Allow setting the max_match_timestamp_dist_ and
58  // max_interp_timestamp_dist_ at runtime from the YAML file. Not sure how
59  // to handle this yet since they only apply to the TUM dataset reader.
60  static constexpr double max_match_timestamp_dist_ = 0.02;
61 
62  static constexpr double max_interp_timestamp_dist_ = 10.0 * max_match_timestamp_dist_;
63 
64  cv::Mat projection_inv_;
65 
66  std::vector<std::string> depth_filenames_;
67 
68  std::vector<std::string> rgb_filenames_;
69 
70  ReaderStatus nextDepth(Image<float>& depth_image);
71 
72  ReaderStatus nextRGBA(Image<uint32_t>& rgba_image);
73 };
74 
75 
76 
77 } // namespace se
78 
79 
80 
81 #endif //SE_READER_INTERIORNET_HPP
Definition: reader_base.hpp:46
InteriorNetReader(const ReaderConfig &c)
Construct a InteriorNetReader from a ReaderConfig.
Base abstract class for dataset readers.
Definition: reader_base.hpp:139
std::string name() const
The name of the reader.
ReaderStatus
The result of trying to read a depth/RGB image or a pose.
Definition: reader_base.hpp:105
Reader for the InteriorNet dataset.
Definition: reader_interiornet.hpp:33
void restart()
Restart reading from the beginning.
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17