TSDF代码解析

初步了解

1、代码地址

tsdf

2、运行结果

mesh

point cloud

3、GPU运行可能的BUG

远程连接服务器没有运行功,但是在服务器上运行成功。

Issue with pycuda- error invoking 'nvcc --version' · Issue #8 · andyzeng/tsdf-fusion-python · GitHubHello, Script works absolutely fine in CPU mode but its very slow. I was trying to debug the code and got stuck on this issue. I have installed all the required packages and also added below 2 lines to my .bashrc file export PATH=/usr/lo...https://github.com/andyzeng/tsdf-fusion-python/issues/8nvcc的路径强行添加到Pycuda的compiler.py文件中的compile_plain()中,成功解决了这一错误

代码详解

1、数据的读取

        主要目的:读取内参,pose(camera->world), 深度图,根据深度图确定体素的范围,X,Y,Z 三个轴的最小值和最大值。也就是 vol_bnds。 具体怎么得到的如下部分代码:

        就是在图像X轴方向的最大最小(0, w),图像Y轴方向的最大最小(0,h),图像Z轴方向最大最小(0, max_depth),然后将其转换到相机坐标系(K),然后再变换到世界坐标系(pose),就得到在这个相机位姿下,三个坐标轴得最大值和最小值。

def get_view_frustum(depth_im, cam_intr, cam_pose):
  """Get corners of 3D camera view frustum of depth image
  """
  im_h = depth_im.shape[0]
  im_w = depth_im.shape[1]
  max_depth = np.max(depth_im)
  view_frust_pts = np.array([
    (np.array([0,0,0,im_w,im_w])-cam_intr[0,2])*np.array([0,max_depth,max_depth,max_depth,max_depth])/cam_intr[0,0],
    (np.array([0,0,im_h,0,im_h])-cam_intr[1,2])*np.array([0,max_depth,max_depth,max_depth,max_depth])/cam_intr[1,1],
    np.array([0,max_depth,max_depth,max_depth,max_depth])
  ]) #
  view_frust_pts = rigid_transform(view_frust_pts.T, cam_pose).T
  return view_frust_pts

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值