ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
BedroomRGBDImages.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <Logging.h>
9 
10 #include <string>
11 #include <vector>
12 
14 
15 namespace cloudViewer {
16 namespace data {
17 
18 const static std::vector<DataDescriptor> data_descriptors = {
19  {CloudViewerDownloadsPrefix() + "20220301-data/bedroom01.zip",
20  "2d1018ceeb72680f5d16b2f419da9bb1"},
21  {CloudViewerDownloadsPrefix() + "20220301-data/bedroom02.zip",
22  "5e6ffbccc0907dc5acc374aa76a79081"},
23  {CloudViewerDownloadsPrefix() + "20220301-data/bedroom03.zip",
24  "ebf13b89ec364b1788dd492c27b9b800"},
25  {CloudViewerDownloadsPrefix() + "20220301-data/bedroom04.zip",
26  "94c0e6c862a54588582b06520946fb15"},
27  {CloudViewerDownloadsPrefix() + "20220301-data/bedroom05.zip",
28  "54b927edb6fd61838025bc66ed767408"},
29 };
30 
31 BedroomRGBDImages::BedroomRGBDImages(const std::string& data_root)
32  : DownloadDataset("BedroomRGBDImages", data_descriptors, data_root) {
33  color_paths_.reserve(21931);
34  depth_paths_.reserve(21931);
35  const std::string extract_dir = GetExtractDir();
36  const size_t n_zero = 6;
37  for (int i = 1; i < 21931; ++i) {
38  std::string idx = std::to_string(i);
39  idx = std::string(n_zero - std::min(n_zero, idx.length()), '0') + idx;
40  color_paths_.push_back(extract_dir + "/image/" + idx + ".jpg");
41  depth_paths_.push_back(extract_dir + "/depth/" + idx + ".png");
42  }
43 
44  trajectory_log_path_ = extract_dir + "/bedroom.log";
45  reconstruction_path_ = extract_dir + "/bedroom.ply";
46 }
47 
48 } // namespace data
49 } // namespace cloudViewer
BedroomRGBDImages(const std::string &data_root="")
const std::string GetExtractDir() const
Get absolute path to extract directory. i.e. ${data_root}/extract/${prefix}.
Definition: Dataset.h:94
Dataset class with one or more downloaded file.
Definition: Dataset.h:152
int min(int a, int b)
Definition: cutil_math.h:53
std::string CloudViewerDownloadsPrefix()
Definition: Dataset.cpp:49
static const std::vector< DataDescriptor > data_descriptors
Generic file read and write utility for python interface.
std::string to_string(const T &n)
Definition: Common.h:20