1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038
|
.. _dataset:
Dataset
=======
Open3D comes with a built-in dataset module for convenient access to commonly
used example datasets. These datasets will be downloaded automatically from the
internet.
.. code-block:: python
import open3d as o3d
if __name__ == "__main__":
dataset = o3d.data.EaglePointCloud()
pcd = o3d.io.read_point_cloud(dataset.path)
o3d.visualization.draw(pcd)
.. code-block:: cpp
#include <string>
#include <memory>
#include "open3d/Open3D.h"
int main() {
using namespace open3d;
data::EaglePointCloud dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPath());
visualization::Draw({pcd});
return 0;
}
- Datasets are downloaded can cached automatically. The default data root is
``~/open3d_data``. Data will be downloaded to ``~/open3d_data/download``
and extracted to ``~/open3d_data/extract``.
- Optionally, you can change the default data root. This can be done by setting
the environment variable ``OPEN3D_DATA_ROOT`` or passing the ``data_root``
argument when constructing a dataset object.
PointCloud
~~~~~~~~~~
PCDPointCloud
-------------
Colored point cloud of a living room from the Redwood dataset in PCD format.
.. code-block:: python
dataset = o3d.data.PCDPointCloud()
pcd = o3d.io.read_point_cloud(dataset.path)
.. code-block:: cpp
data::PCDPointCloud dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPath());
PLYPointCloud
-------------
Colored point cloud of a living room from the Redwood dataset in PLY format.
.. code-block:: python
dataset = o3d.data.PLYPointCloud()
pcd = o3d.io.read_point_cloud(dataset.path)
.. code-block:: cpp
data::PLYPointCloud dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPath());
EaglePointCloud
---------------
Eagle colored point cloud.
.. code-block:: python
dataset = o3d.data.EaglePointCloud()
pcd = o3d.io.read_point_cloud(dataset.path)
.. code-block:: cpp
data::EaglePointCloud dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPath());
LivingRoomPointClouds
---------------------
57 point clouds of binary PLY format from the Redwood RGB-D Dataset.
.. code-block:: python
dataset = o3d.data.LivingRoomPointClouds()
pcds = []
for pcd_path in dataset.paths:
pcds.append(o3d.io.read_point_cloud(pcd_path))
.. code-block:: cpp
data::LivingRoomPointClouds dataset;
std::vector<std::shared_ptr<geometry::PointCloud>> pcds;
for (const std::string& pcd_path: dataset.GetPaths()) {
pcds.push_back(io::CreatePointCloudFromFile(pcd_path));
}
OfficePointClouds
-----------------
53 point clouds of binary PLY format from Redwood RGB-D Dataset.
.. code-block:: python
dataset = o3d.data.OfficePointClouds()
pcds = []
for pcd_path in dataset.paths:
pcds.append(o3d.io.read_point_cloud(pcd_path))
.. code-block:: cpp
data::OfficePointClouds dataset;
std::vector<std::shared_ptr<geometry::PointCloud>> pcds;
for (const std::string& pcd_path: dataset.GetPaths()) {
pcds.push_back(io::CreatePointCloudFromFile(pcd_path));
}
TriangleMesh
~~~~~~~~~~~~
BunnyMesh
---------
The bunny triangle mesh from Stanford in PLY format.
.. code-block:: python
dataset = o3d.data.BunnyMesh()
mesh = o3d.io.read_triangle_mesh(dataset.path)
.. code-block:: cpp
data::BunnyMesh dataset;
auto mesh = io::CreateMeshFromFile(dataset.GetPath());
ArmadilloMesh
-------------
The armadillo mesh from Stanford in PLY format.
.. code-block:: python
dataset = o3d.data.ArmadilloMesh()
mesh = o3d.io.read_triangle_mesh(dataset.path)
.. code-block:: cpp
data::ArmadilloMesh dataset;
auto mesh = io::CreateMeshFromFile(dataset.GetPath());
KnotMesh
--------
A 3D Mobius knot mesh in PLY format.
.. code-block:: python
dataset = o3d.data.KnotMesh()
mesh = o3d.io.read_triangle_mesh(dataset.path)
.. code-block:: cpp
data::KnotMesh dataset;
auto mesh = io::CreateMeshFromFile(dataset.GetPath());
TriangleModel with PRB texture
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MonkeyModel
-----------
The monkey model with PRB texture.
.. code-block:: python
dataset = o3d.data.MonkeyModel()
model = o3d.io.read_triangle_model(dataset.path)
.. code-block:: cpp
data::BunnyMesh dataset;
visualization::rendering::TriangleMeshModel model;
auto model = io::ReadTriangleModel(dataset.GetPath(), model);
SwordModel
----------
The sword model with PRB texture.
.. code-block:: python
dataset = o3d.data.SwordModel()
model = o3d.io.read_triangle_model(dataset.path)
.. code-block:: cpp
data::SwordModel dataset;
visualization::rendering::TriangleMeshModel model;
io::ReadTriangleModel(dataset.GetPath(), model);
CrateModel
----------
The crate model with PRB texture.
.. code-block:: python
dataset = o3d.data.CrateModel()
model = o3d.io.read_triangle_model(dataset.path)
.. code-block:: cpp
data::CrateModel dataset;
visualization::rendering::TriangleMeshModel model;
io::ReadTriangleModel(dataset.GetPath(), model);
FlightHelmetModel
-----------------
The flight helmet gltf model with PRB texture.
.. code-block:: python
dataset = o3d.data.FlightHelmetModel()
model = o3d.io.read_triangle_model(dataset.path)
.. code-block:: cpp
data::FlightHelmetModel dataset;
visualization::rendering::TriangleMeshModel model;
io::ReadTriangleModel(dataset.GetPath(), model);
AvocadoModel
------------
The Avocado glb model with PNG format embedded textures.
.. code-block:: python
dataset = o3d.data.AvocadoModel()
model = o3d.io.read_triangle_model(dataset.path)
.. code-block:: cpp
data::AvocadoModel dataset;
visualization::rendering::TriangleMeshModel model;
io::ReadTriangleModel(dataset.GetPath(), model);
DamagedHelmetModel
------------------
The damaged helmet glb model with JPG format embedded textures.
.. code-block:: python
dataset = o3d.data.DamagedHelmetModel()
model = o3d.io.read_triangle_model(dataset.path)
.. code-block:: cpp
data::DamagedHelmetModel dataset;
visualization::rendering::TriangleMeshModel model;
io::ReadTriangleModel(dataset.GetPath(), model);
Texture material images
~~~~~~~~~~~~~~~~~~~~~~~
MetalTexture
------------
Albedo, normal, roughness and metallic texture files for metal based material.
.. code-block:: python
mat_data = o3d.data.MetalTexture()
mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultLit"
mat.albedo_img = o3d.io.read_image(mat_data.albedo_texture_path)
mat.normal_img = o3d.io.read_image(mat_data.normal_texture_path)
mat.roughness_img = o3d.io.read_image(mat_data.roughness_texture_path)
mat.metallic_img = o3d.io.read_image(mat_data.metallic_texture_path)
.. code-block:: cpp
data::MetalTexture mat_data;
auto mat = visualization::rendering::MaterialRecord();
mat.shader = "defaultUnlit";
mat.albedo_img = io::CreateImageFromFile(mat_data.albedo_texture_path);
mat.normal_img = io::CreateImageFromFile(mat_data.normal_texture_path);
mat.roughness_img = io::CreateImageFromFile(mat_data.roughness_texture_path);
mat.metallic_img = io::CreateImageFromFile(mat_data.metallic_texture_path);
PaintedPlasterTexture
---------------------
Albedo, normal and roughness texture files for painted plaster based material.
.. code-block:: python
mat_data = o3d.data.PaintedPlasterTexture()
mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultLit"
mat.albedo_img = o3d.io.read_image(mat_data.albedo_texture_path)
mat.normal_img = o3d.io.read_image(mat_data.normal_texture_path)
mat.roughness_img = o3d.io.read_image(mat_data.roughness_texture_path)
.. code-block:: cpp
data::PaintedPlasterTexture mat_data;
auto mat = visualization::rendering::MaterialRecord();
mat.shader = "defaultUnlit";
mat.albedo_img = io::CreateImageFromFile(mat_data.albedo_texture_path);
mat.normal_img = io::CreateImageFromFile(mat_data.normal_texture_path);
mat.roughness_img = io::CreateImageFromFile(mat_data.roughness_texture_path);
TilesTexture
------------
Albedo, normal and roughness texture files for tiles based material.
.. code-block:: python
mat_data = o3d.data.TilesTexture()
mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultLit"
mat.albedo_img = o3d.io.read_image(mat_data.albedo_texture_path)
mat.normal_img = o3d.io.read_image(mat_data.normal_texture_path)
mat.roughness_img = o3d.io.read_image(mat_data.roughness_texture_path)
.. code-block:: cpp
data::TilesTexture mat_data;
auto mat = visualization::rendering::MaterialRecord();
mat.shader = "defaultUnlit";
mat.albedo_img = io::CreateImageFromFile(mat_data.albedo_texture_path);
mat.normal_img = io::CreateImageFromFile(mat_data.normal_texture_path);
mat.roughness_img = io::CreateImageFromFile(mat_data.roughness_texture_path);
TerrazzoTexture
---------------
Albedo, normal and roughness texture files for terrazzo based material.
.. code-block:: python
mat_data = o3d.data.TerrazzoTexture()
mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultLit"
mat.albedo_img = o3d.io.read_image(mat_data.albedo_texture_path)
mat.normal_img = o3d.io.read_image(mat_data.normal_texture_path)
mat.roughness_img = o3d.io.read_image(mat_data.roughness_texture_path)
.. code-block:: cpp
data::TerrazzoTexture mat_data;
auto mat = visualization::rendering::MaterialRecord();
mat.shader = "defaultUnlit";
mat.albedo_img = io::CreateImageFromFile(mat_data.albedo_texture_path);
mat.normal_img = io::CreateImageFromFile(mat_data.normal_texture_path);
mat.roughness_img = io::CreateImageFromFile(mat_data.roughness_texture_path);
WoodTexture
-----------
Albedo, normal and roughness texture files for wood based material.
.. code-block:: python
mat_data = o3d.data.WoodTexture()
mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultLit"
mat.albedo_img = o3d.io.read_image(mat_data.albedo_texture_path)
mat.normal_img = o3d.io.read_image(mat_data.normal_texture_path)
mat.roughness_img = o3d.io.read_image(mat_data.roughness_texture_path)
.. code-block:: cpp
data::WoodTexture mat_data;
auto mat = visualization::rendering::MaterialRecord();
mat.shader = "defaultUnlit";
mat.albedo_img = io::CreateImageFromFile(mat_data.albedo_texture_path);
mat.normal_img = io::CreateImageFromFile(mat_data.normal_texture_path);
mat.roughness_img = io::CreateImageFromFile(mat_data.roughness_texture_path);
WoodFloorTexture
----------------
Albedo, normal and roughness texture files for wooden floor based material.
.. code-block:: python
mat_data = o3d.data.WoodFloorTexture()
mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultLit"
mat.albedo_img = o3d.io.read_image(mat_data.albedo_texture_path)
mat.normal_img = o3d.io.read_image(mat_data.normal_texture_path)
mat.roughness_img = o3d.io.read_image(mat_data.roughness_texture_path)
.. code-block:: cpp
data::WoodFloorTexture mat_data;
auto mat = visualization::rendering::MaterialRecord();
mat.shader = "defaultUnlit";
mat.albedo_img = io::CreateImageFromFile(mat_data.albedo_texture_path);
mat.normal_img = io::CreateImageFromFile(mat_data.normal_texture_path);
mat.roughness_img = io::CreateImageFromFile(mat_data.roughness_texture_path);
Image
~~~~~
JuneauImage
-----------
The RGB image ``JuneauImage.jpg`` file.
.. code-block:: python
img_data = o3d.data.JuneauImage()
img = o3d.io.read_image(img_data.path)
.. code-block:: cpp
data::JuneauImage img_data;
auto img = io::CreateImageFromFile(img_data.path);
RGBDImage
~~~~~~~~~
SampleRedwoodRGBDImages
-----------------------
Sample set of 5 color images, 5 depth images from the Redwood RGBD
living-room1 dataset. It also contains a camera trajectory log, a camera
odometry log, an rgbd match file, and a point cloud reconstruction obtained from
TSDF.
.. code-block:: python
dataset = o3d.data.SampleRedwoodRGBDImages()
rgbd_images = []
for i in range(len(dataset.depth_paths)):
color_raw = o3d.io.read_image(dataset.color_paths[i])
depth_raw = o3d.io.read_image(dataset.depth_paths[i])
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
color_raw, depth_raw)
rgbd_images.append(rgbd_image)
pcd = o3d.io.read_point_cloud(dataset.reconstruction_path)
.. code-block:: cpp
data::SampleRedwoodRGBDImages dataset;
std::vector<std::shared_ptr<geometry::RGBDImage>> rgbd_images;
for(size_t i = 0; i < dataset.GetDepthPaths().size(); ++i) {
auto color_raw = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto depth_raw = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto rgbd_image = geometry::RGBDImage::CreateFromColorAndDepth(
*color_raw, *depth_raw,
/*depth_scale =*/1000.0,
/*depth_trunc =*/3.0,
/*convert_rgb_to_intensity =*/false);
rgbd_images.push_back(rgbd_image);
}
auto pcd = io::CreatePointCloudFromFile(dataset.GetReconstructionPath());
SampleFountainRGBDImages
------------------------
Sample set of 33 color and depth images from the Fountain RGBD dataset.
It also contains camera poses at key frames log and mesh reconstruction.
.. code-block:: python
dataset = o3d.data.SampleFountainRGBDImages()
rgbd_images = []
for i in range(len(dataset.depth_paths)):
depth = o3d.io.read_image(dataset.depth_paths[i])
color = o3d.io.read_image(dataset.color_paths[i])
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
color, depth, convert_rgb_to_intensity=False)
rgbd_images.append(rgbd_image)
camera_trajectory = o3d.io.read_pinhole_camera_trajectory(
dataset.keyframe_poses_log_path)
mesh = o3d.io.read_triangle_mesh(dataset.reconstruction_path)
.. code-block:: cpp
data::SampleFountainRGBDImages dataset;
std::vector<std::shared_ptr<geometry::RGBDImage>> rgbd_images;
for(size_t i = 0; i < dataset.GetDepthPaths().size(); ++i) {
auto color_raw = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto depth_raw = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto rgbd_image = geometry::RGBDImage::CreateFromColorAndDepth(
*color_raw, *depth_raw,
/*depth_scale =*/1000.0,
/*depth_trunc =*/3.0,
/*convert_rgb_to_intensity =*/false);
rgbd_images.push_back(rgbd_image);
}
camera::PinholeCameraTrajectory camera_trajectory;
io::ReadPinholeCameraTrajectory(dataset.GetKeyframePosesLogPath(),
camera_trajectory);
auto mesh = io::CreateMeshFromFile(dataset.GetReconstructionPath());
SampleNYURGBDImage
------------------
Color image ``NYU_color.ppm`` and depth image ``NYU_depth.pgm`` sample from NYU
RGBD dataset.
.. code-block:: python
import matplotlib.image as mpimg
def read_nyu_pgm(filename, byteorder='>'):
with open(filename, 'rb') as f:
buffer = f.read()
try:
header, width, height, maxval = re.search(
b"(^P5\s(?:\s*#.*[\r\n])*"
b"(\d+)\s(?:\s*#.*[\r\n])*"
b"(\d+)\s(?:\s*#.*[\r\n])*"
b"(\d+)\s(?:\s*#.*[\r\n]\s)*)", buffer).groups()
except AttributeError:
raise ValueError("Not a raw PGM file: '%s'" % filename)
img = np.frombuffer(buffer,
dtype=byteorder + 'u2',
count=int(width) * int(height),
offset=len(header)).reshape((int(height), int(width)))
img_out = img.astype('u2')
return img_out
dataset = o3d.data.SampleNYURGBDImage()
color_raw = mpimg.imread(dataset.color_path)
depth_raw = read_nyu_pgm(dataset.depth_path)
color = o3d.geometry.Image(color_raw)
depth = o3d.geometry.Image(depth_raw)
rgbd_image = o3d.geometry.RGBDImage.create_from_nyu_format(
color, depth, convert_rgb_to_intensity=False)
SampleSUNRGBDImage
------------------
Color image ``SUN_color.jpg`` and depth image ``SUN_depth.png`` sample from SUN
RGBD dataset.
.. code-block:: python
dataset = o3d.data.SampleSUNRGBDImage()
color_raw = o3d.io.read_image(dataset.color_path)
depth_raw = o3d.io.read_image(dataset.depth_path)
rgbd_image = o3d.geometry.RGBDImage.create_from_sun_format(
color_raw, depth_raw, convert_rgb_to_intensity=False)
.. code-block:: cpp
data::SampleSUNRGBDImage dataset;
auto color_raw = io::CreateImageFromFile(dataset.GetColorPath());
auto depth_raw = io::CreateImageFromFile(dataset.GetDepthPath());
auto rgbd_image = geometry::RGBDImage::CreateFromSUNFormat(
*color_raw, *depth_raw, /*convert_rgb_to_intensity =*/ false);
SampleTUMRGBDImage
------------------
Color image ``TUM_color.png`` and depth image ``TUM_depth.png`` sample from TUM
RGBD dataset.
.. code-block:: python
dataset = o3d.data.SampleTUMRGBDImage()
color_raw = o3d.io.read_image(dataset.color_path)
depth_raw = o3d.io.read_image(dataset.depth_path)
rgbd_image = o3d.geometry.RGBDImage.create_from_tum_format(
color_raw, depth_raw, convert_rgb_to_intensity=False)
.. code-block:: cpp
data::SampleTUMRGBDImage dataset;
auto color_raw = io::CreateImageFromFile(dataset.GetColorPath());
auto depth_raw = io::CreateImageFromFile(dataset.GetDepthPath());
auto rgbd_image = geometry::RGBDImage::CreateFromTUMFormat(
*color_raw, *depth_raw, /*convert_rgb_to_intensity =*/ false);
LoungeRGBDImages
------------------
Lounge RGBD dataset from Stanford containing ``color`` and ``depth``
sequence of 3000 images, along with ``camera trajectory`` and ``reconstruction``.
.. code-block:: python
dataset = o3d.data.LoungeRGBDImages()
rgbd_images = []
for i in range(len(dataset.depth_paths)):
color_raw = o3d.io.read_image(dataset.color_paths[i])
depth_raw = o3d.io.read_image(dataset.depth_paths[i])
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
color_raw, depth_raw)
rgbd_images.append(rgbd_image)
mesh = o3d.io.read_triangle_mesh(dataset.reconstruction_path)
.. code-block:: cpp
data::LoungeRGBDImages dataset;
std::vector<std::shared_ptr<geometry::RGBDImage>> rgbd_images;
for(size_t i = 0; i < dataset.GetDepthPaths().size(); ++i) {
auto color_raw = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto depth_raw = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto rgbd_image = geometry::RGBDImage::CreateFromColorAndDepth(
*color_raw, *depth_raw,
/*depth_scale =*/1000.0,
/*depth_trunc =*/3.0,
/*convert_rgb_to_intensity =*/false);
rgbd_images.push_back(rgbd_image);
}
auto mesh = io::CreateTriangleMeshFromFile(dataset.GetReconstructionPath());
BedroomRGBDImages
------------------
Bedroom RGBD dataset from Redwood containing ``color`` and ``depth``
sequence of 21931 images, along with ``camera trajectory`` and ``reconstruction``.
.. code-block:: python
dataset = o3d.data.BedroomRGBDImages()
rgbd_images = []
for i in range(len(dataset.depth_paths)):
color_raw = o3d.io.read_image(dataset.color_paths[i])
depth_raw = o3d.io.read_image(dataset.depth_paths[i])
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
color_raw, depth_raw)
rgbd_images.append(rgbd_image)
mesh = o3d.io.read_triangle_mesh(dataset.reconstruction_path)
.. code-block:: cpp
data::BedroomRGBDImages dataset;
std::vector<std::shared_ptr<geometry::RGBDImage>> rgbd_images;
for(size_t i = 0; i < dataset.GetDepthPaths().size(); ++i) {
auto color_raw = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto depth_raw = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto rgbd_image = geometry::RGBDImage::CreateFromColorAndDepth(
*color_raw, *depth_raw,
/*depth_scale =*/1000.0,
/*depth_trunc =*/3.0,
/*convert_rgb_to_intensity =*/false);
rgbd_images.push_back(rgbd_image);
}
auto mesh = io::CreateTriangleMeshFromFile(dataset.GetReconstructionPath());
Demo
~~~~
DemoICPPointClouds
------------------
3 point cloud fragments of binary PCD format, from living-room1 scene of Redwood
RGB-D dataset. This data is used for ICP demo.
.. code-block:: python
dataset = o3d.data.DemoICPPointClouds()
pcd0 = o3d.io.read_point_cloud(dataset.paths[0])
pcd1 = o3d.io.read_point_cloud(dataset.paths[1])
pcd2 = o3d.io.read_point_cloud(dataset.paths[2])
.. code-block:: cpp
data::DemoICPPointClouds dataset;
auto pcd0 = io::CreatePointCloudFromFile(dataset.GetPaths()[0]);
auto pcd1 = io::CreatePointCloudFromFile(dataset.GetPaths()[1]);
auto pcd2 = io::CreatePointCloudFromFile(dataset.GetPaths()[2]);
DemoColoredICPPointClouds
-------------------------
2 point cloud fragments of binary PCD format, from apartment scene of Redwood
RGB-D dataset. This data is used for Colored-ICP demo.
.. code-block:: python
dataset = o3d.data.DemoColoredICPPointClouds()
pcd0 = o3d.io.read_point_cloud(dataset.paths[0])
pcd1 = o3d.io.read_point_cloud(dataset.paths[1])
.. code-block:: cpp
data::DemoColoredICPPointClouds dataset;
auto pcd0 = io::CreatePointCloudFromFile(dataset.GetPaths()[0]);
auto pcd1 = io::CreatePointCloudFromFile(dataset.GetPaths()[1]);
DemoCropPointCloud
------------------
Point cloud and ``cropped.json`` (a saved selected polygon volume file).
This data is used for point cloud crop demo.
.. code-block:: python
dataset = o3d.data.DemoCropPointCloud()
pcd = o3d.io.read_point_cloud(dataset.point_cloud_path)
vol = o3d.visualization.read_selection_polygon_volume(dataset.cropped_json_path)
chair = vol.crop_point_cloud(pcd)
.. code-block:: cpp
data::DemoCropPointCloud dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPointCloudPath());
visualization::SelectionPolygonVolume vol;
io::ReadIJsonConvertible(dataset.GetCroppedJSONPath(), vol);
auto chair = vol.CropPointCloud(*pcd);
DemoFeatureMatchingPointClouds
------------------------------
Sample set of 2 point cloud fragments and their respective FPFH features and
L32D features. This data is used for point cloud feature matching demo.
.. code-block:: python
dataset = o3d.data.DemoFeatureMatchingPointClouds()
pcd0 = o3d.io.read_point_cloud(dataset.point_cloud_paths[0])
pcd1 = o3d.io.read_point_cloud(dataset.point_cloud_paths[1])
fpfh_feature0 = o3d.io.read_feature(dataset.fpfh_feature_paths[0])
fpfh_feature1 = o3d.io.read_feature(dataset.fpfh_feature_paths[1])
l32d_feature0 = o3d.io.read_feature(dataset.l32d_feature_paths[0])
l32d_feature1 = o3d.io.read_feature(dataset.l32d_feature_paths[1])
.. code-block:: cpp
data::DemoFeatureMatchingPointClouds dataset;
auto pcd0 = io::CreatePointCloudFromFile(dataset.GetPointCloudPaths()[0]);
auto pcd1 = io::CreatePointCloudFromFile(dataset.GetPointCloudPaths()[1]);
pipelines::registration::Feature fpfh_feature0, fpfh_feature1;
io::ReadFeature(dataset.GetFPFHFeaturePaths()[0], fpfh_feature0);
io::ReadFeature(dataset.GetFPFHFeaturePaths()[1], fpfh_feature1);
pipelines::registration::Feature l32d_feature0, l32d_feature1;
io::ReadFeature(dataset.GetL32DFeaturePaths()[0], l32d_feature0);
io::ReadFeature(dataset.GetL32DFeaturePaths()[1], l32d_feature1);
DemoPoseGraphOptimization
-------------------------
Sample fragment pose graph, and global pose graph. This data is used for pose
graph optimization demo.
.. code-block:: python
dataset = o3d.data.DemoPoseGraphOptimization()
pose_graph_fragment = o3d.io.read_pose_graph(dataset.pose_graph_fragment_path)
pose_graph_global = o3d.io.read_pose_graph(dataset.pose_graph_global_path)
.. code-block:: cpp
data::DemoPoseGraphOptimization dataset;
auto pose_graph_fragment = io::CreatePoseGraphFromFile(
dataset.GetPoseGraphFragmentPath());
auto pose_graph_global = io::CreatePoseGraphFromFile(
dataset.GetPoseGraphGlobalPath());
RedwoodIndoorLivingRoom1
------------------------
The living room 1 scene of the Redwood indoor dataset (Augmented ICL-NUIM
Dataset). The dataset contains a dense point cloud, a rgb sequence, a clean
depth sequence, a noisy depth sequence, an oni file, and camera trajectory.
.. code-block:: python
dataset = o3d.data.RedwoodIndoorLivingRoom1()
assert Path(gt_download_dir).is_dir()
pcd = o3d.io.read_point_cloud(dataset.point_cloud_path)
im_rgbds = []
for color_path, depth_path in zip(dataset.color_paths, dataset.depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_rgbds.append(im_rgbd)
im_noisy_rgbds = []
for color_path, depth_path in zip(dataset.color_paths,
dataset.noisy_depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_noisy_rgbds.append(im_rgbd)
.. code-block:: cpp
data::RedwoodIndoorLivingRoom1 dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPointCloudPath());
std::vector<std::shared_ptr<geometry::RGBDImage>> im_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_rgbds.push_back(im_rgbd);
}
std::vector<std::shared_ptr<geometry::RGBDImage>> im_noisy_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth =
io::CreateImageFromFile(dataset.GetNoisyDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_noisy_rgbds.push_back(im_rgbd);
}
RedwoodIndoorLivingRoom2
------------------------
The living room 2 scene of the Redwood indoor dataset (Augmented ICL-NUIM
Dataset). The dataset contains a dense point cloud, a rgb sequence, a clean
depth sequence, a noisy depth sequence, an oni file, and camera trajectory.
.. code-block:: python
dataset = o3d.data.RedwoodIndoorLivingRoom2()
assert Path(gt_download_dir).is_dir()
pcd = o3d.io.read_point_cloud(dataset.point_cloud_path)
im_rgbds = []
for color_path, depth_path in zip(dataset.color_paths, dataset.depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_rgbds.append(im_rgbd)
im_noisy_rgbds = []
for color_path, depth_path in zip(dataset.color_paths,
dataset.noisy_depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_noisy_rgbds.append(im_rgbd)
.. code-block:: cpp
data::RedwoodIndoorLivingRoom2 dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPointCloudPath());
std::vector<std::shared_ptr<geometry::RGBDImage>> im_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_rgbds.push_back(im_rgbd);
}
std::vector<std::shared_ptr<geometry::RGBDImage>> im_noisy_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth =
io::CreateImageFromFile(dataset.GetNoisyDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_noisy_rgbds.push_back(im_rgbd);
}
RedwoodIndoorOffice1
--------------------
The office 1 scene of the Redwood indoor dataset (Augmented ICL-NUIM
Dataset). The dataset contains a dense point cloud, a rgb sequence, a clean
depth sequence, a noisy depth sequence, an oni file, and camera trajectory.
.. code-block:: python
dataset = o3d.data.RedwoodIndoorOffice1()
assert Path(gt_download_dir).is_dir()
pcd = o3d.io.read_point_cloud(dataset.point_cloud_path)
im_rgbds = []
for color_path, depth_path in zip(dataset.color_paths, dataset.depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_rgbds.append(im_rgbd)
im_noisy_rgbds = []
for color_path, depth_path in zip(dataset.color_paths,
dataset.noisy_depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_noisy_rgbds.append(im_rgbd)
.. code-block:: cpp
data::RedwoodIndoorOffice1 dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPointCloudPath());
std::vector<std::shared_ptr<geometry::RGBDImage>> im_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_rgbds.push_back(im_rgbd);
}
std::vector<std::shared_ptr<geometry::RGBDImage>> im_noisy_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth =
io::CreateImageFromFile(dataset.GetNoisyDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_noisy_rgbds.push_back(im_rgbd);
}
RedwoodIndoorOffice2
--------------------
The office 2 scene of the Redwood indoor dataset (Augmented ICL-NUIM
Dataset). The dataset contains a dense point cloud, a rgb sequence, a clean
depth sequence, a noisy depth sequence, an oni file, and camera trajectory.
.. code-block:: python
dataset = o3d.data.RedwoodIndoorOffice2()
assert Path(gt_download_dir).is_dir()
pcd = o3d.io.read_point_cloud(dataset.point_cloud_path)
im_rgbds = []
for color_path, depth_path in zip(dataset.color_paths, dataset.depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_rgbds.append(im_rgbd)
im_noisy_rgbds = []
for color_path, depth_path in zip(dataset.color_paths,
dataset.noisy_depth_paths):
im_color = o3d.io.read_image(color_path)
im_depth = o3d.io.read_image(depth_path)
im_rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(
im_color, im_depth)
im_noisy_rgbds.append(im_rgbd)
.. code-block:: cpp
data::RedwoodIndoorOffice2 dataset;
auto pcd = io::CreatePointCloudFromFile(dataset.GetPointCloudPath());
std::vector<std::shared_ptr<geometry::RGBDImage>> im_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth = io::CreateImageFromFile(dataset.GetDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_rgbds.push_back(im_rgbd);
}
std::vector<std::shared_ptr<geometry::RGBDImage>> im_noisy_rgbds;
for (size_t i = 0; i < dataset.GetColorPaths().size(); ++i) {
auto im_color = io::CreateImageFromFile(dataset.GetColorPaths()[i]);
auto im_depth =
io::CreateImageFromFile(dataset.GetNoisyDepthPaths()[i]);
auto im_rgbd = geometry::RGBDImage::CreateFromColorAndDepth(*im_color,
*im_depth);
im_noisy_rgbds.push_back(im_rgbd);
}
|