(R, t, translate=np.array([.0, .0, .0]), scale=1.0)
| 19 | T_fixed = np.array([0., 0., 0.]) |
| 20 | |
| 21 | def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0): |
| 22 | Rt = np.zeros((4, 4)) |
| 23 | Rt[:3, :3] = R.transpose() |
| 24 | Rt[:3, 3] = t |
| 25 | Rt[3, 3] = 1.0 |
| 26 | |
| 27 | C2W = np.linalg.inv(Rt) |
| 28 | cam_center = C2W[:3, 3] |
| 29 | cam_center = (cam_center + translate) * scale |
| 30 | C2W[:3, 3] = cam_center |
| 31 | Rt = np.linalg.inv(C2W) |
| 32 | return np.float32(Rt) |
| 33 | |
| 34 | world_view_transform = torch.tensor(getWorld2View2(R_fixed, T_fixed, np.array([0.0, 0.0, 0.0]), 1.0)).transpose(0, 1) |
| 35 |