Skip to content

Frame Overlay

app.shared.frame_overlay

View source code

Module for frame overlay; provides reusable helpers across application layers.

See Also
  • UIHandler — supplies live-preview annotations to the Qt overlay
  • BBoxViewModel — provides annotation geometry and styling

Layer: Shared utilities. Context: Provides reusable helpers across application layers at this architectural boundary.

draw_frame_overlays(frame: RGBFrame, boxes: ListOfBoxes | None, border_width: int = 2) -> RGBFrame

Draw raster box borders and labels onto a copy of an RGB frame.

PARAMETER DESCRIPTION
frame

RGB frame to annotate.

TYPE: RGBFrame

boxes

Boxes displayed in the current editor tab, or None for none.

TYPE: ListOfBoxes | None

border_width

Border width in pixels from 1 to 10.

TYPE: int DEFAULT: 2

RETURNS DESCRIPTION
RGBFrame

A frame with overlays, or the original frame if there are no boxes.

RAISES DESCRIPTION
ValueError

If border_width is outside the inclusive range 1..10.

Note

This is a standalone raster helper. The live editor paints annotations in its Qt overlay so their size is independent of source resolution. Exported video rendering never calls this helper.

Example

preview = draw_frame_overlays(frame, tracked_boxes, border_width=3)