Skip to content

angle

angle #

The device-orientation JSON scalar.

Angle #

Bases: JSONScalar

A device orientation as a unit quaternion, with optional FOV and intrinsics.

The intrinsics (focal length, principal point, and the reference dimensions they are expressed in, all in the upright frame the quaternion places) let a consumer turn any pixel into a camera ray — and, with the quaternion, a world direction — rather than assuming a centered principal point. They are absent when the capturing device delivered no calibration.

Attributes:

Name Type Description
quaternion_w float

Quaternion scalar part.

quaternion_x float

Quaternion x component.

quaternion_y float

Quaternion y component.

quaternion_z float

Quaternion z component.

horizontal_field_of_view float | None

Horizontal field of view in degrees, if known.

vertical_field_of_view float | None

Vertical field of view in degrees, if known.

focal_x float | None

Horizontal focal length in pixels, at reference_width/reference_height.

focal_y float | None

Vertical focal length in pixels.

center_x float | None

Principal point x in pixels.

center_y float | None

Principal point y in pixels.

reference_width float | None

Pixel width the intrinsics are expressed in.

reference_height float | None

Pixel height the intrinsics are expressed in.

Source code in capturegraph-lib/capturegraph/types/scalars/position/angle.py
class Angle(JSONScalar, name="edu.cornell.angle"):
    """A device orientation as a unit quaternion, with optional FOV and intrinsics.

    The intrinsics (focal length, principal point, and the reference dimensions
    they are expressed in, all in the upright frame the quaternion places) let a
    consumer turn any pixel into a camera ray — and, with the quaternion, a world
    direction — rather than assuming a centered principal point. They are absent
    when the capturing device delivered no calibration.

    Attributes:
        quaternion_w: Quaternion scalar part.
        quaternion_x: Quaternion x component.
        quaternion_y: Quaternion y component.
        quaternion_z: Quaternion z component.
        horizontal_field_of_view: Horizontal field of view in degrees, if known.
        vertical_field_of_view: Vertical field of view in degrees, if known.
        focal_x: Horizontal focal length in pixels, at
            ``reference_width``/``reference_height``.
        focal_y: Vertical focal length in pixels.
        center_x: Principal point x in pixels.
        center_y: Principal point y in pixels.
        reference_width: Pixel width the intrinsics are expressed in.
        reference_height: Pixel height the intrinsics are expressed in.
    """

    quaternion_w: float
    quaternion_x: float
    quaternion_y: float
    quaternion_z: float
    horizontal_field_of_view: float | None = None
    vertical_field_of_view: float | None = None
    focal_x: float | None = None
    focal_y: float | None = None
    center_x: float | None = None
    center_y: float | None = None
    reference_width: float | None = None
    reference_height: float | None = None