Loading [MathJax]/extensions/TeX/AMSsymbols.js
Open3D (C++ API)  0.15.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Dataset.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018-2021 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <string>
30 #include <unordered_map>
31 #include <vector>
32 
33 namespace open3d {
34 namespace data {
35 
40 std::string LocateDataRoot();
41 
69 class Dataset {
70 public:
83  Dataset(const std::string& prefix, const std::string& data_root = "");
84 
85  virtual ~Dataset() {}
86 
89  const std::string GetDataRoot() const { return data_root_; }
91  const std::string GetPrefix() const { return prefix_; }
92 
95  const std::string GetDownloadDir() const {
96  return GetDataRoot() + "/download/" + GetPrefix();
97  }
100  const std::string GetExtractDir() const {
101  return GetDataRoot() + "/extract/" + GetPrefix();
102  }
103 
104 protected:
106  std::string data_root_;
108  std::string prefix_;
109 };
110 
115 public:
116  SingleDownloadDataset(const std::string& prefix,
117  const std::vector<std::string>& urls,
118  const std::string& md5,
119  const bool no_extract = false,
120  const std::string& data_root = "");
121 
123 };
124 
130 public:
131  DemoICPPointClouds(const std::string& data_root = "");
132 
134  std::vector<std::string> GetPaths() const { return paths_; }
137  std::string GetPaths(size_t index) const;
138 
139 private:
140  // List of path to PCD point-cloud fragments.
141  std::vector<std::string> paths_;
142 };
143 
150 public:
151  DemoColoredICPPointClouds(const std::string& data_root = "");
152 
154  std::vector<std::string> GetPaths() const { return paths_; }
157  std::string GetPaths(size_t index) const;
158 
159 private:
160  // List of path to PCD point-cloud fragments.
161  std::vector<std::string> paths_;
162 };
163 
170 public:
171  DemoCropPointCloud(const std::string& data_root = "");
172 
174  std::string GetPointCloudPath() const { return point_cloud_path_; }
176  std::string GetCroppedJSONPath() const { return cropped_json_path_; }
177 
178 private:
179  // Path to example point cloud.
180  std::string point_cloud_path_;
181  // Path to saved selected polygon volume file.
182  std::string cropped_json_path_;
183 };
184 
191 public:
192  DemoFeatureMatchingPointClouds(const std::string& data_root = "");
193 
195  std::vector<std::string> GetPointCloudPaths() const {
196  return point_cloud_paths_;
197  }
200  std::vector<std::string> GetFPFHFeaturePaths() const {
201  return fpfh_feature_paths_;
202  }
205  std::vector<std::string> GetL32DFeaturePaths() const {
206  return l32d_feature_paths_;
207  }
208 
209 private:
211  std::vector<std::string> point_cloud_paths_;
214  std::vector<std::string> fpfh_feature_paths_;
217  std::vector<std::string> l32d_feature_paths_;
218 };
219 
225 public:
226  DemoPoseGraphOptimization(const std::string& data_root = "");
227 
229  std::string GetPoseGraphFragmentPath() const {
230  return pose_graph_fragment_path_;
231  }
233  std::string GetPoseGraphGlobalPath() const {
234  return pose_graph_global_path_;
235  }
236 
237 private:
239  std::string pose_graph_fragment_path_;
241  std::string pose_graph_global_path_;
242 };
243 
248 public:
249  PCDPointCloud(const std::string& data_root = "");
250 
252  std::string GetPath() const { return path_; };
253 
254 private:
256  std::string path_;
257 };
258 
263 public:
264  PLYPointCloud(const std::string& data_root = "");
265 
267  std::string GetPath() const { return path_; };
268 
269 private:
271  std::string path_;
272 };
273 
279 public:
280  SampleNYURGBDImage(const std::string& data_root = "");
281 
283  std::string GetColorPath() const { return color_path_; };
285  std::string GetDepthPath() const { return depth_path_; };
286 
287 private:
289  std::string color_path_;
291  std::string depth_path_;
292 };
293 
299 public:
300  SampleSUNRGBDImage(const std::string& data_root = "");
301 
303  std::string GetColorPath() const { return color_path_; };
305  std::string GetDepthPath() const { return depth_path_; };
306 
307 private:
309  std::string color_path_;
311  std::string depth_path_;
312 };
313 
319 public:
320  SampleTUMRGBDImage(const std::string& data_root = "");
321 
323  std::string GetColorPath() const { return color_path_; };
325  std::string GetDepthPath() const { return depth_path_; };
326 
327 private:
329  std::string color_path_;
331  std::string depth_path_;
332 };
333 
337 // Additionally it also contains camera trajectory log, camera odometry log,
338 // rgbd match, and point cloud reconstruction obtained using TSDF.
340 public:
341  SampleRedwoodRGBDImages(const std::string& data_root = "");
342 
344  std::vector<std::string> GetColorPaths() const { return color_paths_; };
346  std::vector<std::string> GetDepthPaths() const { return depth_paths_; };
347 
349  std::string GetTrajectoryLogPath() const { return trajectory_log_path_; };
351  std::string GetOdometryLogPath() const { return odometry_log_path_; };
353  std::string GetRGBDMatchPath() const { return rgbd_match_path_; };
355  std::string GetReconstructionPath() const { return reconstruction_path_; };
356 
357 private:
359  std::vector<std::string> color_paths_;
361  std::vector<std::string> depth_paths_;
362 
364  std::string trajectory_log_path_;
366  std::string odometry_log_path_;
368  std::string rgbd_match_path_;
370  std::string reconstruction_path_;
371 };
372 
377 public:
378  SampleFountainRGBDImages(const std::string& data_root = "");
379 
381  std::vector<std::string> GetColorPaths() const { return color_paths_; };
383  std::vector<std::string> GetDepthPaths() const { return depth_paths_; };
385  std::string GetKeyframePosesLogPath() const {
386  return keyframe_poses_log_path_;
387  };
389  std::string GetReconstructionPath() const { return reconstruction_path_; };
390 
391 private:
392  std::vector<std::string> color_paths_;
393  std::vector<std::string> depth_paths_;
394  std::string keyframe_poses_log_path_;
395  std::string reconstruction_path_;
396 };
397 
402 public:
403  EaglePointCloud(const std::string& data_root = "");
404 
406  std::string GetPath() const { return path_; };
407 
408 private:
410  std::string path_;
411 };
412 
417 public:
418  ArmadilloMesh(const std::string& data_root = "");
419 
421  std::string GetPath() const { return path_; };
422 
423 private:
425  std::string path_;
426 };
427 
432 public:
433  BunnyMesh(const std::string& data_root = "");
434 
436  std::string GetPath() const { return path_; };
437 
438 private:
440  std::string path_;
441 };
442 
446 public:
447  KnotMesh(const std::string& data_root = "");
448 
450  std::string GetPath() const { return path_; };
451 
452 private:
454  std::string path_;
455 };
456 
460 public:
461  JuneauImage(const std::string& data_root = "");
462 
464  std::string GetPath() const { return path_; };
465 
466 private:
468  std::string path_;
469 };
470 
476 public:
477  LivingRoomPointClouds(const std::string& data_root = "");
478 
480  std::vector<std::string> GetPaths() const { return paths_; }
484  std::string GetPaths(size_t index) const;
485 
486 private:
488  std::vector<std::string> paths_;
489 };
490 
496 public:
497  OfficePointClouds(const std::string& data_root = "");
498 
500  std::vector<std::string> GetPaths() const { return paths_; }
504  std::string GetPaths(size_t index) const;
505 
506 private:
508  std::vector<std::string> paths_;
509 };
510 
511 } // namespace data
512 } // namespace open3d
Data class for JuneauImage contains the JuneauImage.jpg file.
Definition: Dataset.h:459
std::string GetTrajectoryLogPath() const
Returns path to camera trajectory log file trajectory.log.
Definition: Dataset.h:349
const std::string GetPrefix() const
Get prefix for the dataset.
Definition: Dataset.h:91
std::vector< std::string > GetDepthPaths() const
Returns List of paths to depth image samples of size 5.
Definition: Dataset.h:346
const std::string GetDownloadDir() const
Get absolute path to download directory. i.e. ${data_root}/${download_prefix}/${prefix}.
Definition: Dataset.h:95
std::string GetKeyframePosesLogPath() const
Returns path to camera poses at keyfragmes log file key.log.
Definition: Dataset.h:385
Dataset class for LivingRoomPointClouds contains 57 point clouds of binary PLY format.
Definition: Dataset.h:475
std::string GetColorPath() const
Returns path to color image sample.
Definition: Dataset.h:303
std::string GetPath() const
Returns path to the KnotMesh.ply file.
Definition: Dataset.h:450
Data class for EaglePointCloud contains the EaglePointCloud.ply file.
Definition: Dataset.h:401
Data class for PLYPointCloud contains the fragment.ply point cloud mesh from the Redwood Living Room ...
Definition: Dataset.h:262
const std::string GetExtractDir() const
Get absolute path to extract directory. i.e. ${data_root}/${extract_prefix}/${prefix}.
Definition: Dataset.h:100
Data class for SampleFountainRGBDImages contains a sample set of 33 color and depth images from the F...
Definition: Dataset.h:376
Data class for KnotMesh contains the KnotMesh.ply file.
Definition: Dataset.h:445
Data class for DemoFeatureMatchingPointClouds contains 2 pointcloud fragments and their respective FP...
Definition: Dataset.h:190
std::string GetReconstructionPath() const
Returns path to mesh reconstruction.
Definition: Dataset.h:389
Data class for SampleTUMRGBDImage contains a color image TUM_color.png and a depth image TUM_depth...
Definition: Dataset.h:318
std::vector< std::string > GetFPFHFeaturePaths() const
Returns list of paths to saved FPFH features binary for point clouds, respectively, of size 2.
Definition: Dataset.h:200
std::string GetPointCloudPath() const
Returns path to example point cloud.
Definition: Dataset.h:174
std::string GetCroppedJSONPath() const
Returns path to saved selected polygon volume file.
Definition: Dataset.h:176
std::string GetPath() const
Returns path to the EaglePointCloud.ply file.
Definition: Dataset.h:406
std::string GetReconstructionPath() const
Returns path to pointcloud reconstruction from TSDF.
Definition: Dataset.h:355
Data class for DemoPoseGraphOptimization contains an example fragment pose graph, and global pose gra...
Definition: Dataset.h:224
std::string GetPath() const
Returns path to the PLY format point cloud.
Definition: Dataset.h:267
std::string GetDepthPath() const
Returns path to depth image sample.
Definition: Dataset.h:305
std::vector< std::string > GetPointCloudPaths() const
Returns list of paths to point clouds, of size 2.
Definition: Dataset.h:195
std::string GetDepthPath() const
Returns path to depth image sample.
Definition: Dataset.h:325
virtual ~SingleDownloadDataset()
Definition: Dataset.h:122
Data class for BunnyMesh contains the BunnyMesh.ply from the Stanford 3D Scanning Repository...
Definition: Dataset.h:431
std::string GetPoseGraphFragmentPath() const
Returns path to example global pose graph (json).
Definition: Dataset.h:229
Base Open3D dataset class.
Definition: Dataset.h:69
std::string GetColorPath() const
Returns path to color image sample.
Definition: Dataset.h:323
std::string GetDepthPath() const
Returns path to depth image sample.
Definition: Dataset.h:285
Dataset class for OfficePointClouds contains 53 point clouds of binary PLY format.
Definition: Dataset.h:495
std::vector< std::string > GetPaths() const
Returns list of paths to ply point-cloud fragments of size 57.
Definition: Dataset.h:480
std::vector< std::string > GetPaths() const
Returns list of 3 point cloud paths.
Definition: Dataset.h:134
Data class for SampleNYURGBDImage contains a color image NYU_color.ppm and a depth image NYU_depth...
Definition: Dataset.h:278
std::vector< std::string > GetL32DFeaturePaths() const
Returns list of paths to saved L32D features binary for point clouds, respectively, of size 2.
Definition: Dataset.h:205
std::string GetPath() const
Returns path to the JuneauImage.jgp file.
Definition: Dataset.h:464
Definition: PinholeCameraIntrinsic.cpp:35
std::string LocateDataRoot()
Definition: Dataset.cpp:39
Data class for DemoColoredICPPointClouds contains 2 point clouds of PLY format. This data is used in ...
Definition: Dataset.h:149
std::vector< std::string > GetPaths() const
Returns list of paths to ply point-cloud fragments of size 52.
Definition: Dataset.h:500
std::string GetPath() const
Returns path to the BunnyMesh.ply file.
Definition: Dataset.h:436
Dataset(const std::string &prefix, const std::string &data_root="")
Parameterized Constructor.
Definition: Dataset.cpp:50
const std::string GetDataRoot() const
Get data root directory. The data root is set at construction time or automatically determined...
Definition: Dataset.h:89
Data class for SampleRedwoodRGBDImages contains a sample set of 5 color and depth images from Redwood...
Definition: Dataset.h:339
std::string GetPoseGraphGlobalPath() const
Returns path to example fragment pose graph (json).
Definition: Dataset.h:233
Data class for PCDPointCloud contains the fragment.pcd point cloud mesh from the Redwood Living Room ...
Definition: Dataset.h:247
Data class for SampleSUNRGBDImage contains a color image SUN_color.jpg and a depth image SUN_depth...
Definition: Dataset.h:298
std::string GetPath() const
Returns path to the ArmadilloMesh.ply file.
Definition: Dataset.h:421
Data class for DemoCropPointCloud contains a point cloud, and cropped.json (a saved selected polygon ...
Definition: Dataset.h:169
std::string GetRGBDMatchPath() const
Returns path to color and depth image match file rgbd.match.
Definition: Dataset.h:353
std::string GetColorPath() const
Returns path to color image sample.
Definition: Dataset.h:283
std::string GetPath() const
Returns path to the pcd format point cloud.
Definition: Dataset.h:252
std::vector< std::string > GetPaths() const
Returns list of list of 2 point cloud paths.
Definition: Dataset.h:154
std::vector< std::string > GetColorPaths() const
Returns List of paths to color image samples of size 33.
Definition: Dataset.h:381
std::vector< std::string > GetDepthPaths() const
Returns List of paths to depth image samples of size 5.
Definition: Dataset.h:383
This class allows user to create simple dataset which includes single file downloading and extracting...
Definition: Dataset.h:114
std::string data_root_
Open3D data root.
Definition: Dataset.h:106
Data class for ArmadilloMesh contains the ArmadilloMesh.ply from the Stanford 3D Scanning Repository...
Definition: Dataset.h:416
virtual ~Dataset()
Definition: Dataset.h:85
std::string GetOdometryLogPath() const
Returns path to camera trajectory log file odometry.log.
Definition: Dataset.h:351
std::vector< std::string > GetColorPaths() const
Returns List of paths to color image samples of size 5.
Definition: Dataset.h:344
std::string prefix_
Dataset prefix.
Definition: Dataset.h:108
Data class for DemoICPPointClouds contains 3 point clouds of binary PCD format. This data is used in ...
Definition: Dataset.h:129
const char const char value recording_handle imu_sample recording_handle uint8_t data
Definition: K4aPlugin.cpp:284