ct.camera¶
Functions for creating camera frustums and related visualizations.
- ct.camera.create_camera_frustums(Ks, Ts, image_whs=None, size=0.1, color=(0, 0, 1), highlight_color_map=None, center_line=True, center_line_color=(1, 0, 0), up_triangle=True, center_ray=False)[source]¶
Create Open3D line sets representing camera frustums.
- Parameters:
Ks (List[Float[ndarray, '3 3']] | None) – Optional list of 3x3 intrinsic matrices. If None, uses default intrinsics.
Ts (List[Float[ndarray, '4 4']]) – List of 4x4 extrinsic matrices (world-to-camera).
image_whs (List[List[int]] | None) – Optional list of [width, height] pairs for each image. If None, dimensions are inferred from intrinsics.
size (float) – Distance from camera center to image plane in world coordinates.
color (Tuple[float, float, float]) – RGB color tuple for frustum lines.
highlight_color_map (Dict[int, Tuple[float, float, float]] | None) – Optional dict mapping camera indices to highlight colors. Supports negative indexing (e.g., {0: [0,1,0], -1: [1,0,0]}).
center_line (bool) – If True, draws line connecting camera centers.
center_line_color (Tuple[float, float, float]) – RGB color tuple for center line.
up_triangle (bool) – If True, draws triangle indicating camera up direction.
center_ray (bool) – If True, draws ray from camera center to image center.
- Returns:
Open3D line set containing all frustum geometry.
- Return type:
o3d.geometry.LineSet
- ct.camera.create_camera_frustum_with_Ts(Ts, image_whs=None, size=0.1, color=(0, 0, 1), highlight_color_map=None, center_line=True, center_line_color=(1, 0, 0), up_triangle=True, center_ray=False)[source]¶
Create camera frustums using only extrinsic matrices.
- Parameters:
Ts (List[Float[ndarray, '4 4']]) – List of 4x4 extrinsic matrices (world-to-camera).
image_whs (List[List[int]] | None) – Optional list of [width, height] pairs for each image.
size (float) – Distance from camera center to image plane in world coordinates.
color (Tuple[float, float, float]) – RGB color tuple for frustum lines.
highlight_color_map (Dict[int, Tuple[float, float, float]] | None) – Optional dict mapping camera indices to highlight colors.
center_line (bool) – If True, draws line connecting camera centers.
center_line_color (Tuple[float, float, float]) – RGB color tuple for center line.
up_triangle (bool) – If True, draws triangle indicating camera up direction.
center_ray (bool) – If True, draws ray from camera center to image center.
- Returns:
Open3D line set containing all frustum geometry.
- Return type:
o3d.geometry.LineSet