簡體   English   中英

Open3d 可以在 RGB 模式下可視化點雲嗎?

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

我在 Open3D 中找到了幾個關於從 RGB-D 圖像可視化點雲的教程。 但我只在灰度模式下得到結果。 這是我的示例代碼:

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])

結果示例可以在http://www.open3d.org/docs/release/getting_started.html#running-open3d-tutorials找到。 Open3D 是否支持在 RGB 模式下可視化點雲。 如果沒有,您會在 Python 中推薦什么庫?

Open3D 是否支持在 RGB 模式下可視化點雲?

是的,它確實。

Open3D.geometry.create_rgbd_image_from_color_and_depth有一個可選參數convert_rgb_to_intensity ,默認設置為 true。

要在 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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM