Implemented Extrinsic Transformations#
The package pysdic provides a set of implemented extrinsic transformation models
that can be used to transform world points to 2D normalized points:
world_points → normalized_points → distorted_points → image_points
The world points can be 3D points \((X_w, Y_w, Z_w)\) or 2D points \((x_w, y_w)\), depending on the extrinsic model.
Extrinsics with 3D world points#
These models map 3D world points to 2D normalized points. Since the depth is lost
by the projection, the inverse transformation needs the depth \(Z_c\) of the points in the
camera coordinate system, given with the depth argument of invert.
The rays of the camera passing through the normalized points can be computed with the method compute_rays.
NoExtrinsic: Identity pose without rotation nor translation (default
input_dim=3): the normalized points are the “x,y” coordinates of the world points (orthographic projection, the coordinate \(z\) is dropped).PerspectiveExtrinsic: Like OpenCV’s, apply a rigid transformation \([R|T]\) to the world points and normalize by the depth \(Z_c\) (perspective division).
OrthographicExtrinsic: Apply a rigid transformation \([R|T]\) to the world points without normalizing by the depth (orthographic projection).
RigidExtrinsic: Common base class of
pysdic.PerspectiveExtrinsicandpysdic.OrthographicExtrinsic(rigid transformation \([R|T]\) followed by a projection).
Extrinsics with 2D world points#
These models map 2D world points to 2D normalized points. No depth is lost:
the transformations are left and right invertible and the invert method does not need any depth.
Planar world observed by a 3D camera#
The world points are the points \((x_w, y_w)\) of the plane \(Z_w = 0\), observed by a camera
with any 3D pose \([R|T]\) (6 parameters). This allows to work with planar displacement fields
while the camera is free to observe the plane. The rays computed with compute_rays are expressed in
the 3D world coordinate system.
WorldPlanePerspectiveExtrinsic: Perspective camera observing the plane \(Z_w = 0\) (plane-induced homography \(H = [\vec{r}_1, \vec{r}_2, T]\)).
WorldPlaneOrthographicExtrinsic: Orthographic camera observing the plane \(Z_w = 0\) (affine map of the plane).
Transformations of the plane#
The world points and the normalized points are linked by a 2D transformation of the plane, used to run the camera algorithms on purely planar problems.
NoExtrinsic with
input_dim=2: Identity of the plane (the normalized points are equal to the world points).PlanarRigidExtrinsic: Apply a 2D rigid transformation composed of a rotation \(\theta\) and a translation \(\vec{t}\) to the world points (3 parameters).
PlanarHomographicExtrinsic: Apply a 2D projective homography \(H\) to the world points (8 parameters, \(H_{22} = 1\)).
Rays#
The method compute_rays of the extrinsics observing a 3D world (all the models above except
pysdic.PlanarRigidExtrinsic, pysdic.PlanarHomographicExtrinsic and pysdic.NoExtrinsic
with input_dim=2) returns the rays of the camera passing through the given normalized points:
Rays: Collection of rays in 3D world coordinates, stored with their origin and their unit direction in an array with shape \((\dots, 6)\).