ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RedwoodIndoorLivingRoom2.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() + "augmented-icl-nuim/livingroom.ply.zip",
20  "841f32ff6294bb52d5f9574834e0925e"},
22  "augmented-icl-nuim/livingroom2-color.zip",
23  "34792f7aa35b6c8b62e394e9372b95d7", "color"},
25  "augmented-icl-nuim/livingroom2-depth-clean.zip",
26  "569c7ba065c3a84de32b0d0844699f43", "depth"},
28  "augmented-icl-nuim/livingroom2-depth-simulated.zip",
29  "cbb4a36b8488448d79ec93c202c0c90e", "depth_noisy"},
31  "augmented-icl-nuim/livingroom2-traj.txt",
32  "193961c018f4c2a753458d5231544036"},
34  "augmented-icl-nuim/livingroom2.oni.zip",
35  "b827aa33cddffc8131d9b25007930137"},
36  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/dist-model.txt",
37  "d8d7b6d29e754c2993a6eba4fd8d89ea"},
38 };
39 
41  : DownloadDataset("RedwoodIndoorLivingRoom2", data_descriptors, data_root) {
42  const std::string extract_dir = GetExtractDir();
43  std::vector<std::string> all_paths;
44 
45  // point_cloud_path_
46  point_cloud_path_ = extract_dir + "/livingroom.ply";
47  all_paths.push_back(point_cloud_path_);
48 
49  // color_paths_
50  for (int i = 0; i <= 2349; i++) {
51  const std::string path =
52  extract_dir + "/color/" + fmt::format("{:05d}.jpg", i);
53  color_paths_.push_back(path);
54  all_paths.push_back(path);
55  }
56 
57  // depth_paths_
58  for (int i = 0; i <= 2349; i++) {
59  const std::string path =
60  extract_dir + "/depth/" + fmt::format("{:05d}.png", i);
61  depth_paths_.push_back(path);
62  all_paths.push_back(path);
63  }
64 
65  // noisy_depth_paths_
66  for (int i = 0; i <= 2349; i++) {
67  const std::string path =
68  extract_dir + "/depth_noisy/" + fmt::format("{:05d}.png", i);
69  noisy_depth_paths_.push_back(path);
70  all_paths.push_back(path);
71  }
72 
73  // oni_path_
74  oni_path_ = extract_dir + "/livingroom2.oni";
75  all_paths.push_back(oni_path_);
76 
77  // trajectory_path_
78  trajectory_path_ = extract_dir + "/livingroom2-traj.txt";
79  all_paths.push_back(trajectory_path_);
80 
81  // noise_model_path_
82  noise_model_path_ = extract_dir + "/dist-model.txt";
83  all_paths.push_back(noise_model_path_);
84 
85  // Check all files exist.
86  CheckPathsExist(all_paths);
87 }
88 
89 } // namespace data
90 } // namespace cloudViewer
filament::Texture::InternalFormat format
const std::string GetExtractDir() const
Get absolute path to extract directory. i.e. ${data_root}/extract/${prefix}.
Definition: Dataset.h:94
void CheckPathsExist(const std::vector< std::string > &paths) const
Check if the paths exists after extraction.
Definition: Dataset.cpp:65
Dataset class with one or more downloaded file.
Definition: Dataset.h:152
RedwoodIndoorLivingRoom2(const std::string &data_root="")
std::string CloudViewerDownloadsPrefix()
Definition: Dataset.cpp:49
static const std::vector< DataDescriptor > data_descriptors
static const std::string path
Definition: PointCloud.cpp:59
Generic file read and write utility for python interface.