单目深度估计与伪雷达点云、可视化
生活随笔
收集整理的這篇文章主要介紹了
单目深度估计与伪雷达点云、可视化
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
單目深度估計(jì)
項(xiàng)目代碼下載地址:下載地址
深度圖轉(zhuǎn)點(diǎn)云:
def depth2ptc_universal(depth, intrinsics):"""depth: depth img ie. [384, 640]intrinsics: []"""vu = np.indices(depth.shape).reshape(2, -1).Tvu[:, 0], vu[:, 1] = vu[:, 1], vu[:, 0].copy()uv = vuuv_depth = np.column_stack((uv.astype(float), depth.reshape(-1)))cx, cy, fx, fy = intrinsicsn = uv_depth.shape[0]x = ((uv_depth[:, 0]-cx)*uv_depth[:, 2])/fx + 0y = ((uv_depth[:, 1]-cy)*uv_depth[:, 2])/fy + 0pts_3d_rect = np.zeros((n, 3))pts_3d_rect[:, 0] = xpts_3d_rect[:, 1] = ypts_3d_rect[:, 2] = uv_depth[:, 2]return pts_3d_rect
點(diǎn)云可視化:
ptc = np.array(ptc).astype(np.float32)
point_cloud = o3d.geometry.PointCloud()
point_cloud.points = o3d.utility.Vector3dVector(ptc)
# point_cloud.colors = o3d.utility.Vector3dVector(img.reshape(-1, 3)[indices][:, ::-1]/255)
point_cloud.transform(
[[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])
o3d.visualization.draw_geometries([point_cloud])
總結(jié)
以上是生活随笔為你收集整理的单目深度估计与伪雷达点云、可视化的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ~~~端午安康~~~
- 下一篇: 【camera】自动泊车-基于深度学习的