s6.app.pipeline.render_helpersΒΆ

Reusable rendering and projection helpers for pipeline image overlays.

s6.app.pipeline.render_helpers.colorize_mask(mask: ndarray) ndarray

Map a mask to a colorized BGR image.

s6.app.pipeline.render_helpers.render_prediction_overlay(image: ndarray, mask: ndarray | None, output_size: tuple[int, int]) ndarray

Blend a prediction mask over an image and resize the result.

s6.app.pipeline.render_helpers.project_world_line_polyline(camera: Camera, line_world: LineSegment3D, subdivision: int = 64) List[ndarray]

Project a world-space line segment into image-space polyline runs.

s6.app.pipeline.render_helpers.draw_frame_status_panel(image: ndarray, camera_key: str, timestamp_ms: float, displacement: Vector3D, velocity: Vector3D, acceleration: Vector3D) None

Draw the T1 diagnostic status panel on one image.

s6.app.pipeline.render_helpers.draw_output_pose_gate_panel(image: ndarray, *, gate: OutputPoseGate, raw_position_mm: Vector3D | None) None

Draw the T1 output-pose gate state panel on one image.

s6.app.pipeline.render_helpers.draw_projected_tip_velocity(image: ndarray, camera: Camera, tip_point: Vector3D, tip_trajectory: TrajectoryV2, arrow_scale: float, *, color: Tuple[int, int, int] = (0, 200, 255), thickness: int = 2) None

Draw a projected tip-velocity arrow on one image.

s6.app.pipeline.render_helpers.draw_segment_endpoint_markers(image: ndarray, mask_line_segment: MaskLineSegment2D, endpoint_colors: Sequence[Tuple[int, int, int]]) None

Draw endpoint markers for a fitted 2D line segment.

s6.app.pipeline.render_helpers.draw_epipolar_lines_for_segment(source_camera: Camera, target_camera: Camera, target_image: ndarray, mask_line_segment: MaskLineSegment2D, endpoint_colors: Sequence[Tuple[int, int, int]], *, thickness: int = 2) None

Draw epipolar lines for each segment endpoint onto a target image.

s6.app.pipeline.render_helpers.draw_epipolar_line_for_point(source_camera: Camera, target_camera: Camera, target_image: ndarray, point: Vector2D | None, color: Tuple[int, int, int], *, thickness: int = 2) None

Draw a single point’s epipolar line onto a target image.

s6.app.pipeline.render_helpers.draw_world_line_overlay(image: ndarray, camera: Camera, line_world: LineSegment3D, subdivision: int, color: Tuple[int, int, int], *, thickness: int = 2) None

Project and draw a world-space line segment on one image.

s6.app.pipeline.render_helpers.draw_world_point_overlay(image: ndarray, camera: Camera, point_world: Vector3D | None, *, radius: int = 8, color: Tuple[int, int, int] = (128, 255, 128)) None

Project and draw a world-space point on one image.

s6.app.pipeline.render_helpers.draw_projected_world_segment(image: ndarray, camera: Camera, start_world: Vector3D | None, end_world: Vector3D | None, *, color: Tuple[int, int, int], thickness: int) None

Project and draw a world-space segment on one image.

s6.app.pipeline.render_helpers.recover_pose_and_draw_axis_indicator(camera_images: Mapping[str, ndarray], cameras: Mapping[str, Camera], model_points: Mapping[str, Vector3D], observed_points: Mapping[str, Vector3D | None], *, axis_lengths: Vector3D | None = None, axis_colors: Sequence[Tuple[int, int, int]] = ((0, 0, 255), (0, 255, 0), (255, 0, 0)), model_point_color: Tuple[int, int, int] = (255, 255, 255), thickness: int = 2) Pose3DRecoveryResult | None

Recover a rigid pose and draw a small projected axis triad.

s6.app.pipeline.render_helpers.recover_pose3d(model_points: Mapping[str, Vector3D], observed_points: Mapping[str, Vector3D | None]) Pose3DRecoveryResult | None

Recover a rigid pose without drawing overlays.

s6.app.pipeline.render_helpers.draw_recovered_pose_axis_indicator(camera_images: Mapping[str, ndarray], cameras: Mapping[str, Camera], model_points: Mapping[str, Vector3D], pose: Pose3DRecoveryResult, *, axis_lengths: Vector3D | None = None, axis_colors: Sequence[Tuple[int, int, int]] = ((0, 0, 255), (0, 255, 0), (255, 0, 0)), model_point_color: Tuple[int, int, int] = (255, 255, 255), thickness: int = 2) None

Draw a recovered rigid pose as a projected axis triad.

Parameters:
  • camera_images (mapping[str, np.ndarray]) – Per-camera render buffers keyed by camera name.

  • cameras (mapping[str, Camera]) – Matching calibrated cameras used for projection.

  • model_points (mapping[str, Vector3D]) – Model-space correspondence points, typically loaded from the instrument model-points JSON file.

  • pose (Pose3DRecoveryResult) – Recovered pose to render.

  • axis_lengths (Vector3D | None, optional) – Local axis lengths in world units. Defaults to a 1 mm triad.

  • axis_colors (sequence[tuple[int, int, int]], optional) – BGR colors for the projected x/y/z axes.

  • model_point_color (tuple[int, int, int], optional) – BGR color used for projected transformed model-point markers.

  • thickness (int, optional) – Overlay line thickness in pixels.