Open3D (C++ API)  0.15.1
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
33namespace open3d {
34namespace data {
35
40std::string LocateDataRoot();
41
69class Dataset {
70public:
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
104protected:
106 std::string data_root_;
108 std::string prefix_;
109};
110
115public:
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
130public:
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
139private:
140 // List of path to PCD point-cloud fragments.
141 std::vector<std::string> paths_;
142};
143
150public:
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
159private:
160 // List of path to PCD point-cloud fragments.
161 std::vector<std::string> paths_;
162};
163
170public:
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
178private:
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
191public:
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
209private:
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
225public:
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
237private:
239 std::string pose_graph_fragment_path_;
241 std::string pose_graph_global_path_;
242};
243
248public:
249 PCDPointCloud(const std::string& data_root = "");
250
252 std::string GetPath() const { return path_; };
253
254private:
256 std::string path_;
257};
258
263public:
264 PLYPointCloud(const std::string& data_root = "");
265
267 std::string GetPath() const { return path_; };
268
269private:
271 std::string path_;
272};
273
279public:
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
287private:
289 std::string color_path_;
291 std::string depth_path_;
292};
293
299public:
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
307private:
309 std::string color_path_;
311 std::string depth_path_;
312};
313
319public:
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
327private:
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.
340public:
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
357private:
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
377public:
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
391private:
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
402public:
403 EaglePointCloud(const std::string& data_root = "");
404
406 std::string GetPath() const { return path_; };
407
408private:
410 std::string path_;
411};
412
417public:
418 ArmadilloMesh(const std::string& data_root = "");
419
421 std::string GetPath() const { return path_; };
422
423private:
425 std::string path_;
426};
427
432public:
433 BunnyMesh(const std::string& data_root = "");
434
436 std::string GetPath() const { return path_; };
437
438private:
440 std::string path_;
441};
442
446public:
447 KnotMesh(const std::string& data_root = "");
448
450 std::string GetPath() const { return path_; };
451
452private:
454 std::string path_;
455};
456
460public:
461 JuneauImage(const std::string& data_root = "");
462
464 std::string GetPath() const { return path_; };
465
466private:
468 std::string path_;
469};
470
476public:
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
486private:
488 std::vector<std::string> paths_;
489};
490
496public:
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
506private:
508 std::vector<std::string> paths_;
509};
510
511} // namespace data
512} // namespace open3d
Data class for ArmadilloMesh contains the ArmadilloMesh.ply from the Stanford 3D Scanning Repository.
Definition: Dataset.h:416
ArmadilloMesh(const std::string &data_root="")
Definition: Dataset.cpp:360
std::string GetPath() const
Returns path to the ArmadilloMesh.ply file.
Definition: Dataset.h:421
Data class for BunnyMesh contains the BunnyMesh.ply from the Stanford 3D Scanning Repository.
Definition: Dataset.h:431
std::string GetPath() const
Returns path to the BunnyMesh.ply file.
Definition: Dataset.h:436
BunnyMesh(const std::string &data_root="")
Definition: Dataset.cpp:371
Base Open3D dataset class.
Definition: Dataset.h:69
std::string prefix_
Dataset prefix.
Definition: Dataset.h:108
virtual ~Dataset()
Definition: Dataset.h:85
const std::string GetExtractDir() const
Get absolute path to extract directory. i.e. ${data_root}/${extract_prefix}/${prefix}.
Definition: Dataset.h:100
Dataset(const std::string &prefix, const std::string &data_root="")
Parameterized Constructor.
Definition: Dataset.cpp:50
std::string data_root_
Open3D data root.
Definition: Dataset.h:106
const std::string GetPrefix() const
Get prefix for the dataset.
Definition: Dataset.h:91
const std::string GetDownloadDir() const
Get absolute path to download directory. i.e. ${data_root}/${download_prefix}/${prefix}.
Definition: Dataset.h:95
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 DemoColoredICPPointClouds contains 2 point clouds of PLY format. This data is used in ...
Definition: Dataset.h:149
DemoColoredICPPointClouds(const std::string &data_root="")
Definition: Dataset.cpp:116
std::vector< std::string > GetPaths() const
Returns list of list of 2 point cloud paths.
Definition: Dataset.h:154
Data class for DemoCropPointCloud contains a point cloud, and cropped.json (a saved selected polygon ...
Definition: Dataset.h:169
DemoCropPointCloud(const std::string &data_root="")
Definition: Dataset.cpp:138
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
Data class for DemoFeatureMatchingPointClouds contains 2 pointcloud fragments and their respective FP...
Definition: Dataset.h:190
DemoFeatureMatchingPointClouds(const std::string &data_root="")
Definition: Dataset.cpp:151
std::vector< std::string > GetFPFHFeaturePaths() const
Returns list of paths to saved FPFH features binary for point clouds, respectively,...
Definition: Dataset.h:200
std::vector< std::string > GetL32DFeaturePaths() const
Returns list of paths to saved L32D features binary for point clouds, respectively,...
Definition: Dataset.h:205
std::vector< std::string > GetPointCloudPaths() const
Returns list of paths to point clouds, of size 2.
Definition: Dataset.h:195
Data class for DemoICPPointClouds contains 3 point clouds of binary PCD format. This data is used in ...
Definition: Dataset.h:129
std::vector< std::string > GetPaths() const
Returns list of 3 point cloud paths.
Definition: Dataset.h:134
DemoICPPointClouds(const std::string &data_root="")
Definition: Dataset.cpp:93
Data class for DemoPoseGraphOptimization contains an example fragment pose graph, and global pose gra...
Definition: Dataset.h:224
std::string GetPoseGraphFragmentPath() const
Returns path to example global pose graph (json).
Definition: Dataset.h:229
std::string GetPoseGraphGlobalPath() const
Returns path to example fragment pose graph (json).
Definition: Dataset.h:233
DemoPoseGraphOptimization(const std::string &data_root="")
Definition: Dataset.cpp:169
Data class for EaglePointCloud contains the EaglePointCloud.ply file.
Definition: Dataset.h:401
std::string GetPath() const
Returns path to the EaglePointCloud.ply file.
Definition: Dataset.h:406
EaglePointCloud(const std::string &data_root="")
Definition: Dataset.cpp:349
Data class for JuneauImage contains the JuneauImage.jpg file.
Definition: Dataset.h:459
std::string GetPath() const
Returns path to the JuneauImage.jgp file.
Definition: Dataset.h:464
JuneauImage(const std::string &data_root="")
Definition: Dataset.cpp:393
Data class for KnotMesh contains the KnotMesh.ply file.
Definition: Dataset.h:445
KnotMesh(const std::string &data_root="")
Definition: Dataset.cpp:382
std::string GetPath() const
Returns path to the KnotMesh.ply file.
Definition: Dataset.h:450
Dataset class for LivingRoomPointClouds contains 57 point clouds of binary PLY format.
Definition: Dataset.h:475
std::vector< std::string > GetPaths() const
Returns list of paths to ply point-cloud fragments of size 57.
Definition: Dataset.h:480
LivingRoomPointClouds(const std::string &data_root="")
Definition: Dataset.cpp:404
Dataset class for OfficePointClouds contains 53 point clouds of binary PLY format.
Definition: Dataset.h:495
OfficePointClouds(const std::string &data_root="")
Definition: Dataset.cpp:430
std::vector< std::string > GetPaths() const
Returns list of paths to ply point-cloud fragments of size 52.
Definition: Dataset.h:500
Data class for PCDPointCloud contains the fragment.pcd point cloud mesh from the Redwood Living Room ...
Definition: Dataset.h:247
PCDPointCloud(const std::string &data_root="")
Definition: Dataset.cpp:184
std::string GetPath() const
Returns path to the pcd format point cloud.
Definition: Dataset.h:252
Data class for PLYPointCloud contains the fragment.ply point cloud mesh from the Redwood Living Room ...
Definition: Dataset.h:262
PLYPointCloud(const std::string &data_root="")
Definition: Dataset.cpp:195
std::string GetPath() const
Returns path to the PLY format point cloud.
Definition: Dataset.h:267
Data class for SampleFountainRGBDImages contains a sample set of 33 color and depth images from the F...
Definition: Dataset.h:376
std::string GetKeyframePosesLogPath() const
Returns path to camera poses at keyfragmes log file key.log.
Definition: Dataset.h:385
std::vector< std::string > GetDepthPaths() const
Returns List of paths to depth image samples of size 5.
Definition: Dataset.h:383
std::vector< std::string > GetColorPaths() const
Returns List of paths to color image samples of size 33.
Definition: Dataset.h:381
SampleFountainRGBDImages(const std::string &data_root="")
Definition: Dataset.cpp:268
std::string GetReconstructionPath() const
Returns path to mesh reconstruction.
Definition: Dataset.h:389
Data class for SampleNYURGBDImage contains a color image NYU_color.ppm and a depth image NYU_depth....
Definition: Dataset.h:278
std::string GetDepthPath() const
Returns path to depth image sample.
Definition: Dataset.h:285
SampleNYURGBDImage(const std::string &data_root="")
Definition: Dataset.cpp:206
std::string GetColorPath() const
Returns path to color image sample.
Definition: Dataset.h:283
Data class for SampleRedwoodRGBDImages contains a sample set of 5 color and depth images from Redwood...
Definition: Dataset.h:339
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::vector< std::string > GetDepthPaths() const
Returns List of paths to depth image samples of size 5.
Definition: Dataset.h:346
std::string GetTrajectoryLogPath() const
Returns path to camera trajectory log file trajectory.log.
Definition: Dataset.h:349
SampleRedwoodRGBDImages(const std::string &data_root="")
Definition: Dataset.cpp:242
std::string GetReconstructionPath() const
Returns path to pointcloud reconstruction from TSDF.
Definition: Dataset.h:355
std::string GetRGBDMatchPath() const
Returns path to color and depth image match file rgbd.match.
Definition: Dataset.h:353
Data class for SampleSUNRGBDImage contains a color image SUN_color.jpg and a depth image SUN_depth....
Definition: Dataset.h:298
std::string GetDepthPath() const
Returns path to depth image sample.
Definition: Dataset.h:305
SampleSUNRGBDImage(const std::string &data_root="")
Definition: Dataset.cpp:218
std::string GetColorPath() const
Returns path to color image sample.
Definition: Dataset.h:303
Data class for SampleTUMRGBDImage contains a color image TUM_color.png and a depth image TUM_depth....
Definition: Dataset.h:318
std::string GetDepthPath() const
Returns path to depth image sample.
Definition: Dataset.h:325
std::string GetColorPath() const
Returns path to color image sample.
Definition: Dataset.h:323
SampleTUMRGBDImage(const std::string &data_root="")
Definition: Dataset.cpp:230
This class allows user to create simple dataset which includes single file downloading and extracting...
Definition: Dataset.h:114
SingleDownloadDataset(const std::string &prefix, const std::vector< std::string > &urls, const std::string &md5, const bool no_extract=false, const std::string &data_root="")
Definition: Dataset.cpp:62
virtual ~SingleDownloadDataset()
Definition: Dataset.h:122
std::string LocateDataRoot()
Definition: Dataset.cpp:39
const char const char value recording_handle imu_sample recording_handle uint8_t data
Definition: K4aPlugin.cpp:288
Definition: PinholeCameraIntrinsic.cpp:35