vis4d.op.geometry.transform

Vis4D geometric transformation functions.

Functions

get_transform_matrix(rotation, translation)

Assembles 4x4 transformation from rotation / translation pair(s).

inverse_pinhole(intrinsic_matrix)

Calculate inverse of pinhole projection matrix.

inverse_rigid_transform(transformation)

Calculate inverse of rigid body transformation(s).

transform_points(points, transform)

Applies transform to points.

get_transform_matrix(rotation, translation)[source]

Assembles 4x4 transformation from rotation / translation pair(s).

Parameters:
  • rotation (Tensor) – [N, 3, 3] or [3, 3] rotation(s).

  • translation (Tensor) – [N, 3] or [3,] translation(s).

Returns:

[N, 4, 4] or [4, 4] transformation.

Return type:

Tensor

inverse_pinhole(intrinsic_matrix)[source]

Calculate inverse of pinhole projection matrix.

Parameters:

intrinsic_matrix (Tensor) – […, 3, 3] intrinsics or single [3, 3] intrinsics.

Returns:

Inverse of input intrinisics.

Return type:

Tensor

inverse_rigid_transform(transformation)[source]

Calculate inverse of rigid body transformation(s).

Parameters:

transformation (Tensor) – [N, 4, 4] transformations or single [4, 4] transformation.

Returns:

Inverse of input transformation(s).

Return type:

Tensor

transform_points(points, transform)[source]

Applies transform to points.

Parameters:
  • points (Tensor) – points of shape (N, D) or (B, N, D).

  • transform (Tensor) – transforms of shape (D+1, D+1) or (B, D+1, D+1).

Returns:

(N, D) / (B, N, D) transformed points.

Return type:

Tensor

Raises:

ValueError – Either points or transform have incorrect shape