从深度图像生成点云

问题描述 投票:1回答:1

我正在尝试将深度图像(RGBD)转换为3d点云。我当前使用的解决方案取自this post,其中:

  • [cx =图像中心高度
  • cy =图像中心宽度
  • [fxfy = 250,通过迭代几个选项选择]

深度测量是从针孔相机进行的,并且点云正从中心凸出(以下示例图像)。谁能帮助我了解为什么以及如何解决这个问题?

enter image description hereenter image description hereenter image description here

python image point-clouds depth projection-matrix
1个回答
3
投票

您可以使用open3d软件包轻松解决此问题。使用sudo pip install -U open3d-python(不仅仅是open3d-这是另一个软件包)安装它。

一旦安装:

from open3d import *

rgbd = create_rgbd_image_from_color_and_depth(color, depth, convert_rgb_to_intensity = False)
pcd = create_point_cloud_from_rgbd_image(rgbd, pinhole_camera_intrinsic)

# flip the orientation, so it looks upright, not upside-down
pcd.transform([[1,0,0,0],[0,-1,0,0],[0,0,-1,0],[0,0,0,1]])

draw_geometries([pcd])    # visualize the point cloud

上面的代码假设您在color中有彩色图像,在depth中有深度图像,请检查open3d附带的样本以了解更多信息。

如果您有自己的相机固有功能,则可以用那些相机取代pinhole_camera_intrinsic,但对于试运行,针孔相机或多或少都可以正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.