Pad [..., 3, 4] pose matrices with a homogeneous bottom row [0,0,0,1].
(p)
| 246 | |
| 247 | |
| 248 | def pad_poses(p): |
| 249 | """Pad [..., 3, 4] pose matrices with a homogeneous bottom row [0,0,0,1].""" |
| 250 | bottom = np.broadcast_to([0, 0, 0, 1.], p[..., :1, :4].shape) |
| 251 | return np.concatenate([p[..., :3, :4], bottom], axis=-2) |
| 252 | |
| 253 | def unpad_poses(p): |
| 254 | """Remove the homogeneous bottom row from [..., 4, 4] pose matrices.""" |
no outgoing calls
no test coverage detected