raillabel_providerkit.validation.validate_horizon package

Submodules

raillabel_providerkit.validation.validate_horizon.validate_horizon module

Validate that track/transition annotations are below the horizon line.

raillabel_providerkit.validation.validate_horizon.validate_horizon.validate_horizon(scene: Scene, horizon_tolerance_percent: float = 10.0) list[Issue]

Validate whether all track/transition annotations are below the horizon.

This validation only applies to track and transition object types. Other object types are not checked against the horizon line.

The horizon is calculated based on each camera’s pitch angle (tilt), derived from the extrinsics rotation matrix. This approach is robust across different calibration conventions (OSDAR23, OSDAR26, etc.).

Parameters:
  • scene (raillabel.Scene) – Scene that should be validated.

  • horizon_tolerance_percent (float, optional) – Tolerance buffer as percentage of the horizon position from the top of the image. Higher values move the horizon line up (smaller Y), making the validation more permissive. For example, 10.0 means the horizon is moved up by 10% of its distance from the top. Default is 10.0.

Returns:

List of all horizon crossing errors in the scene (only for track/transition annotations). If an empty list is returned, then there are no errors present.

Return type:

list[Issue]

Module contents

Package for validating a scene for annotations crossing the horizon.