import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
# monkey patches visualization and provides helpers to load geometries
sys.path.append('..')
# import open3d_tutorial as o3dtut
# change to True if you want to interact with the visualization windows
# o3dtut.interactive = not "CI" in os.environ
print("Read SUN dataset")
color_raw = o3d.io.read_image(
r"D:\sunrgbd\sunrgbd_trainval\image\000001.jpg")
depth_raw = o3d.io.read_image(
r"D:sunrgbd\sunrgbd_trainval\depth_png\000001.png")
rgbd_image = o3d.geometry.RGBDImage.create_from_sun_format(color_raw, depth_raw)
print(rgbd_image)
# attention, the depth is nonzero, the point will be constructed
rows, columns = np.nonzero(np.asarray(rgbd_image.depth))
plt.subplot(1, 2, 1)
plt.title('SUN grayscale image')
plt.imshow(rgbd_image.color)
plt.subplot(1, 2, 2)
plt.title('SUN depth image')
plt.imshow(rgbd_image.depth)
plt.show()
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(
rg
Open3D Python加载点云RGBD生成彩色点云
最新推荐文章于 2024-03-26 08:30:00 发布
本文介绍了如何使用Open3D库读取SUNrgbd数据集中的图像和深度信息,将其转换为RGBDImage,然后创建并显示一个点云,展示了从原始数据到三维可视化的过程。

最低0.47元/天 解锁文章
2535

被折叠的 条评论
为什么被折叠?



