API Reference
SyncedFrame & CameraIntrinsics
The frame container yielded by MCAPReader.frames() and the camera-calibration dataclass.
SyncedFrame
@dataclass
class SyncedFrame:
index: int
timestamp: float
rgb: np.ndarray
depth: np.ndarray | None = None
camera_pose: Pose6D | None = None
imu: dict | None = None
depth_K: np.ndarray | None = None
rgb_K: np.ndarray | None = NoneA single synchronised frame yielded by MCAPReader.frames().
| Field | Type | Notes |
|---|---|---|
index | int | 0-based RGB frame index. |
timestamp | float | RGB-message timestamp, seconds. |
rgb | (H, W, 3) uint8 | RGB image, optical frame. |
depth | (H, W) uint16 | None | Depth in millimetres, optical frame. None if no depth match. |
camera_pose | Pose6D | None | Pose in world frame. None if no pose match. |
imu | dict | None | {"linear_acceleration": (3,), "angular_velocity": (3,), "orientation": (4,)}. |
depth_K | (3, 3) | None | Depth-camera intrinsics. |
rgb_K | (3, 3) | None | RGB-camera intrinsics. |
The intrinsics are populated by MCAPReader on yield so downstream code (HandTracker.detect_hands, Visualizer.log_frame) doesn't have to thread them through manually.
CameraIntrinsics
@dataclass
class CameraIntrinsics:
width: int
height: int
K: np.ndarray # (3, 3) camera matrix
D: np.ndarray # distortion coefficients
distortion_model: str = "plumb_bob"Returned by session.rgb_intrinsics / session.depth_intrinsics.
intr = session.rgb_intrinsics
print(intr.K) # (3, 3)
print(intr.D) # 1D array, length depends on model
print(intr.distortion_model)