ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RedwoodIndoorOffice2.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/office.ply.zip",
20  "ba3640bba38f19c8f2d5e86e045eeae5"},
21  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/office2-color.zip",
22  "487cdfacffc8fc8247a5b21e860a3794", "color"},
24  "augmented-icl-nuim/office2-depth-clean.zip",
25  "386203a7a5dae21db6d8430ae36dcc8b", "depth"},
27  "augmented-icl-nuim/office2-depth-simulated.zip",
28  "13f1c5b7c4f44524fa91f7ba87e44bb5", "depth_noisy"},
29  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/office2-traj.txt",
30  "698f2f09da7d2ed3fcb604889e6f8479"},
31  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/office2.oni.zip",
32  "dcbd567442f29bd6080d74b5a384cd0d"},
33  {CloudViewerDownloadsPrefix() + "augmented-icl-nuim/dist-model.txt",
34  "d8d7b6d29e754c2993a6eba4fd8d89ea"},
35 };
36 
37 RedwoodIndoorOffice2::RedwoodIndoorOffice2(const std::string& data_root)
38  : DownloadDataset("RedwoodIndoorOffice2", data_descriptors, data_root) {
39  const std::string extract_dir = GetExtractDir();
40  std::vector<std::string> all_paths;
41 
42  // point_cloud_path_
43  point_cloud_path_ = extract_dir + "/office.ply";
44  all_paths.push_back(point_cloud_path_);
45 
46  // color_paths_
47  for (int i = 0; i <= 2537; i++) {
48  const std::string path =
49  extract_dir + "/color/" + fmt::format("{:05d}.jpg", i);
50  color_paths_.push_back(path);
51  all_paths.push_back(path);
52  }
53 
54  // depth_paths_
55  for (int i = 0; i <= 2537; i++) {
56  const std::string path =
57  extract_dir + "/depth/" + fmt::format("{:05d}.png", i);
58  depth_paths_.push_back(path);
59  all_paths.push_back(path);
60  }
61 
62  // noisy_depth_paths_
63  for (int i = 0; i <= 2537; i++) {
64  const std::string path =
65  extract_dir + "/depth_noisy/" + fmt::format("{:05d}.png", i);
66  noisy_depth_paths_.push_back(path);
67  all_paths.push_back(path);
68  }
69 
70  // oni_path_
71  oni_path_ = extract_dir + "/office2.oni";
72  all_paths.push_back(oni_path_);
73 
74  // trajectory_path_
75  trajectory_path_ = extract_dir + "/office2-traj.txt";
76  all_paths.push_back(trajectory_path_);
77 
78  // noise_model_path_
79  noise_model_path_ = extract_dir + "/dist-model.txt";
80  all_paths.push_back(noise_model_path_);
81 
82  // Check all files exist.
83  CheckPathsExist(all_paths);
84 }
85 
86 } // namespace data
87 } // 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
RedwoodIndoorOffice2(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.