py123d_detection.core.visibility

Which ground-truth boxes a rig’s cameras can actually see.

A camera-only detector is scored on every annotated object, including the ones behind it. On a 360-degree rig like nuScenes’ that is harmless. On Waymo’s five forward-facing cameras, which between them cover about 230 degrees, roughly a third of the annotations are objects no camera observed. Counting those makes recall look worse than the model is, for reasons that have nothing to do with the model.

RigVisibility reads the rig geometry once and then answers, per box, whether any camera could have seen it. Two tests, in increasing cost:

  • center compares the box centre’s bearing against each camera’s horizontal field of view. It ignores elevation and image bounds, and is a good default.

  • corners projects all eight corners and asks whether any lands inside an image, so it accounts for both.

Neither test contains the other, so changing mode can drop boxes as well as add them. corners is stricter about elevation and image bounds: a box directly overhead is within bearing but projects off the top of the image. center is stricter at the horizontal edge, where a box whose centre has left the field of view can still have corners imaged. Prefer corners when the vertical field of view is narrow enough that bearing alone overcounts.

A rig covering the full circle short-circuits: every box is visible, and the filter costs nothing.

Module Attributes

FULL_COVERAGE_DEG

Coverage at or above this counts as the full circle, in degrees.

MIN_DEPTH_M

Minimum depth for a corner to be in front of a camera, in metres.

Functions

coverage_degrees(views)

Total angle the cameras cover between them, counting overlap once.

rig_visibility(scene, cameras[, margin_deg, ...])

Read a rig's geometry from one frame.

Classes

CameraView(name, bearing, half_fov, ...)

One camera's placement and optics, in the ego frame.

RigVisibility(views, coverage_deg)

Where a rig's cameras point, and whether they leave any gap.

py123d_detection.core.visibility.FULL_COVERAGE_DEG = 355.0

Coverage at or above this counts as the full circle, in degrees. Slightly under 360 because rigs are built to overlap, not to tile exactly.

py123d_detection.core.visibility.MIN_DEPTH_M = 0.1

Minimum depth for a corner to be in front of a camera, in metres.

class py123d_detection.core.visibility.CameraView(name, bearing, half_fov, ego_to_camera, intrinsics, width, height)[source]

Bases: object

One camera’s placement and optics, in the ego frame.

name: str
bearing: float

Direction the camera looks, as an angle in the ego frame’s xy plane.

half_fov: float

Half the horizontal field of view, including any configured margin.

ego_to_camera: ndarray
intrinsics: ndarray
width: int
height: int
class py123d_detection.core.visibility.RigVisibility(views, coverage_deg)[source]

Bases: object

Where a rig’s cameras point, and whether they leave any gap.

views: Tuple[CameraView, ...]
coverage_deg: float
property covers_full_circle: bool
sees_center(center_ego)[source]

Whether the box centre’s bearing falls in some camera’s field of view.

Return type:

bool

sees_corners(corners_ego)[source]

Whether any of the eight corners projects inside some camera’s image.

Return type:

bool

sees(mode, center_ego, corners_ego)[source]
Return type:

bool

py123d_detection.core.visibility.coverage_degrees(views)[source]

Total angle the cameras cover between them, counting overlap once.

Return type:

float

py123d_detection.core.visibility.rig_visibility(scene, cameras, margin_deg=0.0, iteration=0)[source]

Read a rig’s geometry from one frame.

Extrinsics and intrinsics are rig-static in 123D, so a single frame describes the whole log.

Parameters:

margin_deg (float) – Widen each camera’s field of view by this much, so a box just past the edge is not dropped over a fraction of a degree.

Return type:

RigVisibility