MCPcopy Create free account
hub / github.com/Robbyant/lingbot-map / compute_local_scale

Function compute_local_scale

demo_render/rgbd_render/camera.py:117–121  ·  view source on GitHub ↗

Diagonal of the first-N-frames trajectory bounding box.

(c2w_poses: np.ndarray, n_frames: int = 100)

Source from the content-addressed store, hash-verified

115
116
117def compute_local_scale(c2w_poses: np.ndarray, n_frames: int = 100) -> float:
118 """Diagonal of the first-N-frames trajectory bounding box."""
119 n = min(n_frames, len(c2w_poses))
120 cam_pos = c2w_poses[:n, :3, 3]
121 return max(float(np.linalg.norm(cam_pos.max(0) - cam_pos.min(0))), 1e-3)
122
123
124# ---------------------------------------------------------------------------

Callers 1

build_camera_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected