python 读写 txt 的 4*4 pose(c2w)导出

# 读取 txt
 with open(path_pose,'r') as f:
     lines = f.readlines()
 c2w = np.array(
     list(map(float, (''.join(
         lines[0:4])).strip().split()))).reshape((4, 4))

 # 对 pose 进行处理
 c2w = torch.from_numpy(c2w).float()
 c2w = c2w@c2w
# 重新导出 txt
 c2w = c2w.numpy()
 np.savetxt(path_out_pose, c2w,'%9.8f')

你可能感兴趣的:(编程语言,python,numpy,深度学习)