Llo*_*ner 3 python image depth point-clouds projection-matrix
我正在尝试将深度图像 (RGBD) 转换为 3d 点云。我目前使用的解决方案来自这篇文章,其中:
cx
= 图像中心高度cy
= 图像中心宽度fx
和fy
= 250
,通过迭代几个选项来选择深度测量是从针孔相机拍摄的,点云从中心向外投射(下面的示例图像)。谁能帮助我理解为什么以及如何解决这个问题?
您可以使用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
Run Code Online (Sandbox Code Playgroud)
上面的代码假设你有你的彩色图像color
和深度图像depth
,检查随附的样本以open3d
获取更多信息。
如果你有自己的相机,你可以pinhole_camera_intrinsic
用它们替换,但对于测试运行,针孔相机或多或少都可以正常工作。
归档时间: |
|
查看次数: |
10379 次 |
最近记录: |