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

Function _static_camera

demo_render/rgbd_render/camera.py:461–475  ·  view source on GitHub ↗

Compute a static camera. Defaults from start frame pose if not given.

(c2w_poses: np.ndarray, start_frame: int,
                   eye: Optional[List[float]] = None,
                   lookat_pt: Optional[List[float]] = None,
                   fov_deg: float = 60.0)

Source from the content-addressed store, hash-verified

459# ---------------------------------------------------------------------------
460
461def _static_camera(c2w_poses: np.ndarray, start_frame: int,
462 eye: Optional[List[float]] = None,
463 lookat_pt: Optional[List[float]] = None,
464 fov_deg: float = 60.0) -> Camera:
465 """Compute a static camera. Defaults from start frame pose if not given."""
466 c2w = c2w_poses[start_frame]
467 cam_pos = c2w[:3, 3].astype(np.float32)
468 cam_fwd = c2w[:3, 2].astype(np.float32)
469 cam_fwd = cam_fwd / max(np.linalg.norm(cam_fwd), 1e-6)
470 cam_up = (-c2w[:3, 1]).astype(np.float32)
471 cam_up = cam_up / max(np.linalg.norm(cam_up), 1e-6)
472
473 eye_pt = np.array(eye, dtype=np.float32) if eye else cam_pos
474 center_pt = np.array(lookat_pt, dtype=np.float32) if lookat_pt else cam_pos + cam_fwd
475 return Camera(eye_pt, center_pt, cam_up, fov_deg)
476
477
478def make_static_path(c2w_poses: np.ndarray, start_frame: int, end_frame: int,

Callers 1

make_static_pathFunction · 0.85

Calls 1

CameraClass · 0.85

Tested by

no test coverage detected