Rotation#

Class Methods

Rotation.from_opk_degree(omega, phi, kappa)

Create a rotation from omega/phi/kappa angles in degrees.

Rotation.from_opk(omega, phi, kappa)

Create a rotation from omega/phi/kappa angles in radians.

Rotation.from_apk_degree(alpha, zeta, kappa)

Create a rotation from alpha/zeta/kappa angles in degrees.

Rotation.from_apk(alpha, zeta, kappa)

Create a rotation from alpha/zeta/kappa angles in radians.

Methods

Rotation.transform_to_crs()

Transform the rotation into another CRS.

Properties

Rotation.opk

Convert the rotation matrix to omega/phi/kappa angles in radians.

Rotation.opk_degree

Return omega/phi/kappa angles in degrees.

Rotation.apk

Convert the rotation matrix to alpha/zeta/kappa angles in radians.

Rotation.apk_degree

Return alpha/zeta/kappa angles in degrees.

Rotation.matrix

Return the rotation matrix.

class weitsicht.Rotation(rotation_matrix: ndarray)[source]#

Bases: object

Represent a 3×3 rotation matrix and convert to/from common photogrammetry angle notations.

Supported angle sets:

  • OPK: omega/phi/kappa (radians/degrees)

  • APK: alpha/zeta/kappa (radians/degrees)

Axis conventions in weitsicht: - X axis: left → right in the image - Y axis: bottom → top in the image - Z axis: backwards (away from the scene) - Global system: ENU

Parameters:

rotation_matrix (np.ndarray)

__init__(rotation_matrix: ndarray) None[source]#

Create a Rotation from a rotation matrix.

Parameters:

rotation_matrix (numpy.ndarray) – Rotation matrix (3×3).

Return type:

None

classmethod from_opk_degree(omega: float, phi: float, kappa: float) Rotation[source]#

Create a rotation from omega/phi/kappa angles in degrees.

Parameters:
  • omega (float) – Omega angle in degrees.

  • phi (float) – Phi angle in degrees.

  • kappa (float) – Kappa angle in degrees.

Returns:

Rotation instance.

Return type:

Rotation

classmethod from_opk(omega: float, phi: float, kappa: float) Rotation[source]#

Create a rotation from omega/phi/kappa angles in radians.

Parameters:
  • omega (float) – Omega angle in radians.

  • phi (float) – Phi angle in radians.

  • kappa (float) – Kappa angle in radians.

Returns:

Rotation instance.

Return type:

Rotation

classmethod from_apk_degree(alpha: float, zeta: float, kappa: float) Rotation[source]#

Create a rotation from alpha/zeta/kappa angles in degrees.

alpha/zeta/kappa (often also written AZK) is a common photogrammetry notation (also used in monoplotting) where:

  • alpha: azimuth of the camera +Z axis, relative to +X (East) in the ground CRS,

  • zeta: inclination/tilt relative to nadir (0° = nadir),

  • kappa: rotation around the camera +Z axis.

Parameters:
  • alpha (float) – Alpha angle in degrees.

  • zeta (float) – Zeta angle in degrees.

  • kappa (float) – Kappa angle in degrees.

Returns:

Rotation instance.

Return type:

Rotation

classmethod from_apk(alpha: float, zeta: float, kappa: float) Rotation[source]#

Create a rotation from alpha/zeta/kappa angles in radians.

See from_apk_degree() for the meaning of the angles.

Parameters:
  • alpha (float) – Alpha angle in radians.

  • zeta (float) – Zeta angle in radians.

  • kappa (float) – Kappa angle in radians.

Returns:

Rotation instance.

Return type:

Rotation

property matrix: Array3x3#

Return the rotation matrix.

Returns:

Rotation matrix (3×3).

Return type:

Array3x3

property opk: Vector3D#

Convert the rotation matrix to omega/phi/kappa angles in radians.

Returns:

[omega, phi, kappa] in radians.

Return type:

Vector3D

property opk_degree: Vector3D#

Return omega/phi/kappa angles in degrees.

Returns:

[omega, phi, kappa] in degrees.

Return type:

Vector3D

property apk: Vector3D#

Convert the rotation matrix to alpha/zeta/kappa angles in radians.

In weitsicht the camera CRS uses a backwards Z axis. Therefore this property uses a ZYZ Euler decomposition of the camera’s +Z axis:

  • alpha: azimuth of the camera +Z axis (XY plane),

  • zeta: off-nadir angle (0 = nadir, 90° = horizontal),

  • kappa: rotation around the camera +Z axis.

Returns:

[alpha, zeta, kappa] in radians.

Return type:

Vector3D

property apk_degree: Vector3D#

Return alpha/zeta/kappa angles in degrees.

Returns:

[alpha, zeta, kappa] in degrees.

Return type:

Vector3D

transform_to_crs()[source]#

Transform the rotation into another CRS.

This is currently not implemented.