Fisheye MEI Camera

Fisheye MEI Metadata

class py123d.datatypes.FisheyeMEICameraMetadata[source]

Metadata for a fisheye MEI camera.

Public Data Attributes:

camera_model

The projection model of this camera.

camera_name

The name of the fisheye MEI camera, according to the dataset naming convention.

camera_id

The ID of the fisheye MEI camera.

mirror_parameter

The mirror parameter of the fisheye MEI camera.

distortion

The distortion parameters of the fisheye MEI camera, if available.

projection

The projection parameters of the fisheye MEI camera, if available.

width

The width of the fisheye MEI camera image in pixels.

height

The height of the fisheye MEI camera image in pixels.

camera_to_imu_se3

The static extrinsic pose of the fisheye MEI camera.

Inherited from BaseCameraMetadata

camera_model

The projection model of the camera.

camera_id

The camera ID, unique within a sensor rig.

camera_name

The camera name, according to the dataset naming convention.

camera_to_imu_se3

The static extrinsic pose of the camera relative to the IMU frame.

width

The width of the camera image in pixels.

height

The height of the camera image in pixels.

channel_type

The channel type of the camera image.

modality_type

Returns the type of the modality that this metadata describes.

modality_id

Returns the camera ID as the modality ID.

aspect_ratio

The aspect ratio (width / height) of the camera.

Inherited from BaseModalityMetadata

modality_type

Returns the type of the modality that this metadata describes.

modality_id

Optional identifier for the modality, e.g. sensor ID for sensor modalities.

modality_key

Returns a unique key for this modality, combining type and id if applicable.

Public Methods:

from_dict(data_dict)

Create a FisheyeMEICameraMetadata instance from a dictionary.

to_dict()

Converts the FisheyeMEICameraMetadata instance to a Python dictionary.

project_to_image(points_cam)

Project 3D points in camera frame to image pixel coordinates using the fisheye MEI model.

cam2image(points_3d)

camera coordinate to image plane

Inherited from BaseCameraMetadata

project_to_image(points_cam)

Project 3D points in camera frame to image pixel coordinates.

Inherited from BaseMetadata

to_dict()

Serialize the metadata instance to a plain Python dictionary.

from_dict(data_dict)

Construct a metadata instance from a plain Python dictionary.

Private Methods:

Inherited from BaseCameraMetadata

_compute_in_fov_mask(pixel_coords, depth[, eps])

Compute a boolean mask for points in front of the camera and within image bounds.


classmethod from_dict(data_dict)[source]

Create a FisheyeMEICameraMetadata instance from a dictionary.

Parameters:

data_dict (Dict[str, Any]) – Dictionary containing camera metadata.

Return type:

FisheyeMEICameraMetadata

Returns:

A new instance of FisheyeMEICameraMetadata.

property camera_model: CameraModel

The projection model of this camera.

property camera_name: str

The name of the fisheye MEI camera, according to the dataset naming convention.

property camera_id: CameraID

The ID of the fisheye MEI camera.

property mirror_parameter: float | None

The mirror parameter of the fisheye MEI camera.

property aspect_ratio: float

The aspect ratio (width / height) of the camera.

property channel_type: CameraChannelType

The channel type of the camera image. Defaults to RGB.

property distortion: FisheyeMEIDistortion | None

The distortion parameters of the fisheye MEI camera, if available.

property modality_id: str | SerialIntEnum | None

Returns the camera ID as the modality ID.

property modality_key: str

Returns a unique key for this modality, combining type and id if applicable.

property modality_type: ModalityType

Returns the type of the modality that this metadata describes.

The channel type drives the modality: a CameraChannelType.SEMANTIC camera is a per-pixel semantic segmentation stream (ModalityType.CAMERA_SEMANTIC), a CameraChannelType.INSTANCE camera a per-pixel panoptic/instance stream (ModalityType.CAMERA_INSTANCE), and a CameraChannelType.DEPTH camera a per-pixel metric depth stream (ModalityType.CAMERA_DEPTH), each written to its own Arrow file so it sits alongside — and never collides with — the RGB camera that shares its camera_id. All other channel types are regular ModalityType.CAMERA.

property projection: FisheyeMEIProjection | None

The projection parameters of the fisheye MEI camera, if available.

property width: int

The width of the fisheye MEI camera image in pixels.

property height: int

The height of the fisheye MEI camera image in pixels.

property camera_to_imu_se3: PoseSE3

The static extrinsic pose of the fisheye MEI camera.

to_dict()[source]

Converts the FisheyeMEICameraMetadata instance to a Python dictionary.

Return type:

Dict[str, Any]

Returns:

A dictionary representation of the camera metadata.

project_to_image(points_cam)[source]

Project 3D points in camera frame to image pixel coordinates using the fisheye MEI model.

Delegates to cam2image() and wraps the result in the unified interface.

Parameters:

points_cam (ndarray[tuple[Any, ...], dtype[float64]]) – (N, 3) array of 3D points in the camera coordinate frame.

Return type:

Tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[bool]], ndarray[tuple[Any, ...], dtype[float64]]]

Returns:

A tuple of (pixel_coords (N,2), in_fov_mask (N,), depth (N,)).

Raises:

ValueError – If mirror_parameter is not set.

cam2image(points_3d)[source]

camera coordinate to image plane

Return type:

Tuple[ndarray, ndarray, ndarray]

Parameters:

points_3d (ndarray[tuple[Any, ...], dtype[float64]])

Fisheye MEI Distortion

class py123d.datatypes.FisheyeMEIDistortion[source]

Public Data Attributes:

array

Underlying NumPy array of distortion parameters, indexed by FisheyeMEIDistortionIndex.

k1

Radial distortion coefficient k1.

k2

Radial distortion coefficient k2.

p1

Tangential distortion coefficient p1.

p2

Tangential distortion coefficient p2.

Inherited from ArrayMixin

array

The array representation of the geometric entity.

shape

Return the shape of the array.

Public Methods:

from_array(array[, copy])

Creates a FisheyeMEIDistortion instance from a NumPy array,

Inherited from ArrayMixin

from_array(array[, copy])

Create an instance from a NumPy array.

from_list(values)

Create an instance from a list of values.

tolist()

Convert the array to a Python list.

to_list()

Convert the array to a Python list.

copy()

Return a copy of the object with a copied array.


classmethod from_array(array, copy=True)[source]
Creates a FisheyeMEIDistortion instance from a NumPy array,

indexing according to FisheyeMEIDistortionIndex.

Parameters:
  • array (ndarray[tuple[Any, ...], dtype[float64]]) – Input array containing distortion parameters.

  • copy (bool) – Whether to copy the array data, defaults to True.

Return type:

FisheyeMEIDistortion

Returns:

A new instance of FisheyeMEIDistortion.

property array: ndarray[tuple[Any, ...], dtype[float64]]

Underlying NumPy array of distortion parameters, indexed by FisheyeMEIDistortionIndex.

property k1: float

Radial distortion coefficient k1.

property k2: float

Radial distortion coefficient k2.

property p1: float

Tangential distortion coefficient p1.

property p2: float

Tangential distortion coefficient p2.

Fisheye MEI Projection

class py123d.datatypes.FisheyeMEIProjection[source]

Fisheye MEI projection parameters.

Public Data Attributes:

array

Underlying NumPy array of projection parameters, indexed by FisheyeMEIProjectionIndex.

gamma1

Generalized focal length gamma1.

gamma2

Generalized focal length gamma2.

u0

Principal point x-coordinate.

v0

Principal point y-coordinate.

Inherited from ArrayMixin

array

The array representation of the geometric entity.

shape

Return the shape of the array.

Public Methods:

from_array(array[, copy])

Intializes a FisheyeMEIProjection from a NumPy array,

Inherited from ArrayMixin

from_array(array[, copy])

Create an instance from a NumPy array.

from_list(values)

Create an instance from a list of values.

tolist()

Convert the array to a Python list.

to_list()

Convert the array to a Python list.

copy()

Return a copy of the object with a copied array.


classmethod from_array(array, copy=True)[source]
Intializes a FisheyeMEIProjection from a NumPy array,

indexing according to FisheyeMEIProjectionIndex.

Parameters:
  • array (ndarray[tuple[Any, ...], dtype[float64]]) – Input array containing projection parameters.

  • copy (bool) – Whether to copy the array data, defaults to True.

Return type:

FisheyeMEIProjection

Returns:

A new instance of FisheyeMEIProjection.

property array: ndarray[tuple[Any, ...], dtype[float64]]

Underlying NumPy array of projection parameters, indexed by FisheyeMEIProjectionIndex.

property gamma1: float

Generalized focal length gamma1.

property gamma2: float

Generalized focal length gamma2.

property u0: float

Principal point x-coordinate.

property v0: float

Principal point y-coordinate.