ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RedwoodIndoorLivingRoom1.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 <FileSystem.h>
9 #include <Logging.h>
10 
11 #include <string>
12 #include <vector>
13 
15 
16 namespace cloudViewer {
17 namespace data {
18 
19 const static std::vector<DataDescriptor> data_descriptors = {
20  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/livingroom.ply.zip",
21  "841f32ff6294bb52d5f9574834e0925e"},
23  "augmented-icl-nuim/livingroom1-color.zip",
24  "c23481094ca3859b204d2fcbb4e435a4", "color"},
26  "augmented-icl-nuim/livingroom1-depth-clean.zip",
27  "6867ddac0e7aafe828a218b385f61985", "depth"},
29  "augmented-icl-nuim/livingroom1-depth-simulated.zip",
30  "2fec03a29258a29b9ffedde88fddd676", "depth_noisy"},
32  "augmented-icl-nuim/livingroom1-traj.txt",
33  "601ac4b51aba2455a90aed8aa1158c6a"},
35  "augmented-icl-nuim/livingroom1.oni.zip",
36  "fb201903f211f31ccd01886457bb004c"},
37  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/dist-model.txt",
38  "d8d7b6d29e754c2993a6eba4fd8d89ea"},
39 };
40 
42  : DownloadDataset("RedwoodIndoorLivingRoom1", data_descriptors, data_root) {
43  const std::string extract_dir = GetExtractDir();
44  std::vector<std::string> all_paths;
45 
46  // point_cloud_path_
47  point_cloud_path_ = extract_dir + "/livingroom.ply";
48  all_paths.push_back(point_cloud_path_);
49 
50  // color_paths_
51  for (int i = 0; i <= 2869; i++) {
52  const std::string path =
53  extract_dir + "/color/" + fmt::format("{:05d}.jpg", i);
54  color_paths_.push_back(path);
55  all_paths.push_back(path);
56  }
57 
58  // depth_paths_
59  for (int i = 0; i <= 2869; i++) {
60  const std::string path =
61  extract_dir + "/depth/" + fmt::format("{:05d}.png", i);
62  depth_paths_.push_back(path);
63  all_paths.push_back(path);
64  }
65 
66  // noisy_depth_paths_
67  for (int i = 0; i <= 2869; i++) {
68  const std::string path =
69  extract_dir + "/depth_noisy/" + fmt::format("{:05d}.png", i);
70  noisy_depth_paths_.push_back(path);
71  all_paths.push_back(path);
72  }
73 
74  // oni_path_
75  oni_path_ = extract_dir + "/livingroom1.oni";
76  all_paths.push_back(oni_path_);
77 
78  // trajectory_path_
79  trajectory_path_ = extract_dir + "/livingroom1-traj.txt";
80  all_paths.push_back(trajectory_path_);
81 
82  // noise_model_path_
83  noise_model_path_ = extract_dir + "/dist-model.txt";
84  all_paths.push_back(noise_model_path_);
85 
86  // Check all files exist.
87  CheckPathsExist(all_paths);
88 }
89 
90 } // namespace data
91 } // 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
RedwoodIndoorLivingRoom1(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.