MCPcopy Create free account
hub / github.com/Atrovast/THGS / average_pose

Function average_pose

utils/render_utils.py:51–57  ·  view source on GitHub ↗

New pose using average position, z-axis, and up vector of input poses.

(poses: np.ndarray)

Source from the content-addressed store, hash-verified

49
50
51def 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
59def viewmatrix(lookdir: np.ndarray, up: np.ndarray,
60 position: np.ndarray) -> np.ndarray:

Callers 1

recenter_posesFunction · 0.85

Calls 1

viewmatrixFunction · 0.85

Tested by

no test coverage detected