raillabel.json_format.stream_camera module

class raillabel.json_format.stream_camera.JSONIntrinsicsPinhole(*, camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float], distortion_coeffs: tuple[float, float, float, float, float], height_px: int, width_px: int)

Bases: _JSONFormatBase

JSON object defining an instance of the intrinsic parameters of a pinhole camera.

_abc_impl = <_abc._abc_data object>
camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float]

This is a 3x4 camera matrix which projects 3D homogeneous points (4x1) from a camera coordinate system into the image plane (3x1). This is the usual K matrix for camera projection as in OpenCV. It is extended from 3x3 to 3x4 to enable its direct utilisation to project 4x1 homogeneous 3D points. The matrix is defined to follow the camera model: x-to-right, y-down, z-forward. The following equation applies: x_img = camera_matrix * X_ccs.

distortion_coeffs: tuple[float, float, float, float, float]

This is the array 1x5 radial and tangential distortion coefficients.

height_px: int

Height of the camera output in pixel.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

width_px: int

Width of the camera output in pixel.

class raillabel.json_format.stream_camera.JSONStreamCamera(*, type: Literal['camera'], stream_properties: JSONStreamCameraProperties, uri: str | None = None, description: str | None = None)

Bases: _JSONFormatBase

A stream describes the source of a data sequence, usually a sensor.

This specific object contains the intrinsics of a camera sensor.

_abc_impl = <_abc._abc_data object>
description: str | None

Description of the stream.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

stream_properties: JSONStreamCameraProperties

Intrinsic calibration of the stream.

type: Literal['camera']

A string encoding the type of the stream.

uri: str | None

A string encoding the subdirectory containing the sensor files.

class raillabel.json_format.stream_camera.JSONStreamCameraProperties(*, intrinsics_pinhole: JSONIntrinsicsPinhole)

Bases: _JSONFormatBase

Intrinsic calibration of the stream.

_abc_impl = <_abc._abc_data object>
intrinsics_pinhole: JSONIntrinsicsPinhole
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].