简体   繁体   English

Open3d 可以在 RGB 模式下可视化点云吗?

[英]Can Open3d visualize a point cloud in RGB mode?

I found several tutorials about visualization of point cloud from RGB-D image in Open3D.我在 Open3D 中找到了几个关于从 RGB-D 图像可视化点云的教程。 But I only got the result in gray-scale mode.但我只在灰度模式下得到结果。 Here is my example code:这是我的示例代码:

import open3d as o3d # installed by running: <pip install open3d-python> 
def img_to_pointcloud(img, depth, K, Rt):
    rgb = o3d.geometry.Image(img)
    depth = o3d.geometry.Image(depth)
    rgbd = o3d.geometry.create_rgbd_image_from_color_and_depth(rgb, depth, depth_scale=1.0, depth_trunc=50.0)
    fx, fy, cx, cy = K[0, 0], K[1, 1], K[0, 2], K[1, 2]
    intrinsic = o3d.camera.PinholeCameraIntrinsic(int(cx*2), int(cy*2), fx, fy, cx, cy)
    pc = o3d.create_point_cloud_from_rgbd_image(rgbd, intrinsic, Rt)
    o3d.visualization.draw_geometries([pc])

The example of result can be found at http://www.open3d.org/docs/release/getting_started.html#running-open3d-tutorials .结果示例可以在http://www.open3d.org/docs/release/getting_started.html#running-open3d-tutorials找到。 Does Open3D support visualize point cloud in RGB mode. Open3D 是否支持在 RGB 模式下可视化点云。 If it doesn't, what the library would you recommend in Python?如果没有,您会在 Python 中推荐什么库?

Does Open3D support visualize point cloud in RGB mode? Open3D 是否支持在 RGB 模式下可视化点云?

Yes, it does.是的,它确实。

Open3D.geometry.create_rgbd_image_from_color_and_depth has an optional parameter convert_rgb_to_intensity which is set to be true by default. Open3D.geometry.create_rgbd_image_from_color_and_depth有一个可选参数convert_rgb_to_intensity ,默认设置为 true。

To visualize in RGB mode, just change your fifth line to要在 RGB 模式下可视化,只需将第五行更改为
rgbd = o3d.geometry.create_rgbd_image_from_color_and_depth(rgb, depth, depth_scale=1.0, depth_trunc=50.0, convert_rgb_to_intensity=False) . rgbd = o3d.geometry.create_rgbd_image_from_color_and_depth(rgb, depth, depth_scale=1.0, depth_trunc=50.0, convert_rgb_to_intensity=False)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM