Pinhole Camera¶
Pinhole Camera Data¶
- class py123d.datatypes.sensors.PinholeCamera[source]¶
Represents the recording of a pinhole camera including its metadata, image, and extrinsic pose.
Public Data Attributes:
metadataThe static
PinholeCameraMetadataassociated with the pinhole camera.imageThe image captured by the pinhole camera, as a numpy array.
extrinsicThe extrinsic
PoseSE3of the pinhole camera, relative to the ego vehicle frame.
- property metadata: PinholeCameraMetadata¶
The static
PinholeCameraMetadataassociated with the pinhole camera.
Pinhole Metadata¶
- class py123d.datatypes.sensors.PinholeCameraMetadata[source]¶
Static metadata for a pinhole camera, stored in a log.
Public Data Attributes:
camera_typeThe
PinholeCameraTypeof the pinhole camera.intrinsicsThe
PinholeIntrinsicsof the pinhole camera.distortionThe
PinholeDistortionof the pinhole camera.widthThe image width in pixels.
heightThe image height in pixels.
aspect_ratioThe aspect ratio (width / height) of the pinhole camera.
fov_xThe horizontal field of view (FOV) of the pinhole camera in radians.
fov_yThe vertical field of view (FOV) of the pinhole camera in radians.
Public Methods:
from_dict(data_dict)Create a
PinholeCameraMetadatafrom a dictionary.to_dict()Converts the
PinholeCameraMetadatato a dictionary.
- classmethod from_dict(data_dict)[source]¶
Create a
PinholeCameraMetadatafrom a dictionary.
- to_dict()[source]¶
Converts the
PinholeCameraMetadatato a dictionary.
- property camera_type: PinholeCameraType¶
The
PinholeCameraTypeof the pinhole camera.
- property intrinsics: PinholeIntrinsics | None¶
The
PinholeIntrinsicsof the pinhole camera.
- property distortion: PinholeDistortion | None¶
The
PinholeDistortionof the pinhole camera.
Pinhole Intrinsics¶
- class py123d.datatypes.sensors.PinholeIntrinsics[source]¶
Pinhole camera intrinsics representation.
Public Data Attributes:
arrayA numpy array representation of the pinhole intrinsics, indexed by
PinholeIntrinsicsIndex.fxFocal length in x direction.
fyFocal length in y direction.
cxOptical center x coordinate.
cyOptical center y coordinate.
skewSkew coefficient.
camera_matrixThe 3x3 camera intrinsic matrix K.
Inherited from
ArrayMixinarrayThe array representation of the geometric entity.
shapeReturn the shape of the array.
Public Methods:
from_array(array[, copy])Creates a PinholeIntrinsics from a numpy array, indexed by
PinholeIntrinsicsIndex.from_camera_matrix(intrinsic)Create a PinholeIntrinsics from a 3x3 intrinsic matrix.
Inherited from
ArrayMixinfrom_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 PinholeIntrinsics from a numpy array, indexed by
PinholeIntrinsicsIndex.- Parameters:
- Return type:
- Returns:
A
PinholeIntrinsicsinstance.
- classmethod from_camera_matrix(intrinsic)[source]¶
Create a PinholeIntrinsics from a 3x3 intrinsic matrix.
Pinhole Distortion¶
- class py123d.datatypes.sensors.PinholeDistortion[source]¶
Pinhole camera distortion representation.
Public Data Attributes:
arrayA numpy array representation of the pinhole distortion, indexed by
PinholeDistortionIndex.k1Radial distortion coefficient k1.
k2Radial distortion coefficient k2.
p1Tangential distortion coefficient p1.
p2Tangential distortion coefficient p2.
k3Radial distortion coefficient k3.
Inherited from
ArrayMixinarrayThe array representation of the geometric entity.
shapeReturn the shape of the array.
Public Methods:
from_array(array[, copy])Creates a PinholeDistortion from a numpy array, indexed by
PinholeDistortionIndex.Inherited from
ArrayMixinfrom_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 PinholeDistortion from a numpy array, indexed by
PinholeDistortionIndex.- Parameters:
- Return type:
- Returns:
A
PinholeDistortioninstance.
Pinhole Camera Types¶
- class py123d.datatypes.sensors.PinholeCameraType[source]¶
Enumeration of pinhole camera types.
- PCAM_F0 = 0¶
Front camera.
- PCAM_B0 = 1¶
Back camera.
- PCAM_L0 = 2¶
Left camera, first from front to back.
- PCAM_L1 = 3¶
Left camera, second from front to back.
- PCAM_L2 = 4¶
Left camera, third from front to back.
- PCAM_R0 = 5¶
Right camera, first from front to back.
- PCAM_R1 = 6¶
Right camera, second from front to back.
- PCAM_R2 = 7¶
Right camera, third from front to back.
- PCAM_STEREO_L = 8¶
Left stereo camera.
- PCAM_STEREO_R = 9¶
Right stereo camera.