raillabel.format.intrinsics_pinhole module

class raillabel.format.intrinsics_pinhole.IntrinsicsPinhole(camera_matrix: tuple[float, float, float, float, float, float, float, float, float, float, float, float], distortion: tuple[float, float, float, float, float], width_px: int, height_px: int)

Bases: object

Intrinsic calibration for a camera sensor.

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: tuple[float, float, float, float, float]

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

classmethod from_json(json: JSONIntrinsicsPinhole) IntrinsicsPinhole

Construct an instant of this class from RailLabel JSON data.

height_px: int

Height of the image frame in pixel.

to_json() JSONIntrinsicsPinhole

Export this object into the RailLabel JSON format.

width_px: int

Width of the image frame in pixel.