New pose using average position, z-axis, and up vector of input poses.
(poses: np.ndarray)
| 49 | |
| 50 | |
| 51 | def average_pose(poses: np.ndarray) -> np.ndarray: |
| 52 | """New pose using average position, z-axis, and up vector of input poses.""" |
| 53 | position = poses[:, :3, 3].mean(0) |
| 54 | z_axis = poses[:, :3, 2].mean(0) |
| 55 | up = poses[:, :3, 1].mean(0) |
| 56 | cam2world = viewmatrix(z_axis, up, position) |
| 57 | return cam2world |
| 58 | |
| 59 | def viewmatrix(lookdir: np.ndarray, up: np.ndarray, |
| 60 | position: np.ndarray) -> np.ndarray: |
no test coverage detected