CameraExtrinsics
CameraExtrinsics defines the 6-DoF position and orientation of a camera in the 3D padel court coordinate system.
Properties
- Name
position- Type
- tuple[float, float, float]
- Description
3D world coordinates
(X, Y, Z)of the camera optical center in meters.
- Name
rotation_matrix- Type
- tuple[tuple[float, float, float], ...]
- Description
3x3orthogonal world-to-camera rotation matrixRin OpenCV convention.
- Name
R- Type
- np.ndarray
- Description
3x3world-to-camera rotation matrix as a NumPyfloat64array.
- Name
t- Type
- np.ndarray
- Description
3Dworld-to-camera translation vectort = -R @ center.
- Name
forward- Type
- tuple[float, float, float]
- Description
Unit optical axis vector (
+Z_cam) in world coordinates.
- Name
up- Type
- tuple[float, float, float]
- Description
Unit vector pointing upwards in the image (
-Y_cam) in world coordinates.
- Name
right- Type
- tuple[float, float, float]
- Description
Unit vector pointing right (
+X_cam) in world coordinates.
- Name
world_to_camera_matrix- Type
- np.ndarray
- Description
4x4homogeneous world-to-camera transformation matrix (OpenCV convention).
- Name
opengl_camera_to_world_matrix- Type
- np.ndarray
- Description
4x4camera-to-world transformation matrix in OpenGL / Three.js / Blender convention (+Xright,+Yup,-Zforward).
Look-At Initialization
Creates a CameraExtrinsics instance placed at position and oriented directly towards target. Automatically resolves zenith singularities when looking straight down (-Z).
Arguments
- Name
position- Type
- tuple[float, float, float] | Sequence[float]
- Description
Camera position
(X, Y, Z)in meters.
- Name
target- Type
- tuple[float, float, float] | Sequence[float]
- Description
3D target point
(X, Y, Z)the optical axis points at.
- Name
roll_deg- Type
- float
- Description
Optional camera roll angle around the optical axis in degrees.
Usage
from padelkit import CameraExtrinsics
extr = CameraExtrinsics.from_look_at(
position=(0.0, -13.8, 5.8),
target=(0.0, 0.0, 0.5),
)
Euler Angles Initialization
Creates a CameraExtrinsics instance from pan (yaw_deg), tilt (pitch_deg), and roll (roll_deg) angles.
yaw_deg = 0points along+Y(from near to far side).- Negative
pitch_degtilts the camera downwards towards the floor.
Usage
from padelkit import CameraExtrinsics
extr = CameraExtrinsics.from_euler(
position=(0.0, -13.5, 5.5),
yaw_deg=0.0,
pitch_deg=-22.0,
roll_deg=0.0,
)