bbi.camera

The camera module provides classes for camera control and post processing effects.

class Camera(transform: Transform, fov: float, resolution: tuple[int, int], sensor_preset: CameraProfile)

Bases: BasePerspectiveCamera, Animatable[CameraUpdateParam]

A Camera that is used to view the 3D world.

Parameters:
  • transform (Transform) – The transform of the camera.

  • fov (float) – The field of view in degrees.

  • resolution (tuple[int, int]) – The resolution of the capture output.

attach_to(parent: Node, rule: TransformAttachmentRule = TransformAttachmentRule.KEEP_WORLD) None

Attach the asset to another node inheriting its transform operations.

Parameters:
  • parent (Node) – The parent node to attach the asset to.

  • rule (TransformAttachmentRule, optional) – How to handle transforms and welding when attaching, defaults to TransformAttachmentRule.KEEP_WORLD.

attach_to_root() None

Attach the asset to its root node .

execute(frame_id: int | None = None, frame_max: int | None = None, delta_seconds: float | None = None) None

Updates the Camera state to the specified frame.

Parameters:
  • frame_id (int | None, optional) – The frame ID. Defaults to None.

  • frame_max (int | None, optional) – Max frame count in the current loop. Defaults to None.

  • delta_seconds (float | None, optional) – The target real-time in seconds between frames. This is used to calculate physical displacement for certain assets. Defaults to None.

class BaseCamera(transform: Transform, resolution: tuple[int, int], sensor_preset: CameraProfile)

Bases: Node

property resolution: tuple[int, int]

The resolution of the capture output.

property thermal: Thermal

Thermal camera properties and settings.

property post_processing: SensorPostProcessing

The post processing settings for the camera.

set_transform(transform: Transform) None

Set the transform of the instance. For efficiency, this method is preferred over setting individual transform components.

Parameters:

transform (Transform) – The transform.

set_resolution(resolution: tuple[int, int]) None

Sets the resolution of the capture output.

Parameters:

resolution (tuple[int, int]) – The resolution of the capture output.

apply_preset(preset_id: str) None

Applies a preset to the camera.

Parameters:

preset_id (str) – The ID of the preset to apply.

set_thermal_mode(enabled: bool) None

Enables or disables thermal mode for the camera.

Parameters:

enabled (bool) – Whether to enable or disable thermal mode.

class BaseOrthographicCamera(transform: Transform, ortho_width_m: float, resolution: tuple[int, int], sensor_preset: CameraProfile)

Bases: BaseCamera

property ortho_width: float

The width of the orthographic camera in meters.

set_ortho_width(ortho_width: float) None

Set the width of the orthographic camera in meters.

set_transform(transform: Transform) None

Set the transform of the instance. For efficiency, this method is preferred over setting individual transform components.

Parameters:

transform (Transform) – The transform.

class BasePerspectiveCamera(transform: Transform, fov: float, resolution: tuple[int, int], sensor_preset: CameraProfile)

Bases: BaseCamera

property fov: float

The field of view in degrees.

set_fov(fov: float) None

Sets the field of view.

Parameters:

fov (float) – The field of view in degrees.

set_transform(transform: Transform) None

Set the transform of the instance. For efficiency, this method is preferred over setting individual transform components.

Parameters:

transform (Transform) – The transform.

class SatelliteCamera(fov: float, resolution: tuple[int, int], sensor_preset: CameraProfile, gsd: float = _DEFAULT_GSD)

Bases: BasePerspectiveCamera, Animatable[SatelliteCameraUpdateParam]

A camera that is set up with functions to support a satellite-based workflow.

Parameters:
  • fov (float) – The field of view in degrees.

  • resolution (tuple[int, int]) – The resolution of the capture output.

  • gsd (float) – The Ground Sample Distance (GSD) of the camera in meters per pixel.

VERTICAL = -89.9
HARD_MIN_LOOK_ANGLE = 0
MIN_LOOK_ANGLE = 0.09999999999999432
MAX_LOOK_ANGLE = 90
property gsd: float

The Ground Sample Distance (GSD) of the camera in meters per pixel.

property ground_target: tuple[float, float]

The x and y position of the camera’s ground target.

property look_angle: float

The look angle of the camera in degrees.

property azimuth: float

The azimuth of the camera in degrees.

set_resolution(resolution: tuple[int, int]) None

Sets the resolution of the capture output.

Parameters:

resolution (tuple[int, int]) – The resolution of the capture output.

set_gsd(value: float) None

Sets the Ground Sample Distance (GSD) of the camera in meters per pixel.

Parameters:

value (float) – The GSD value.

set_ground_target(xy: tuple[float, float]) None

Sets the x and y position of the camera’s ground target.

This is not necessarily the camera’s final x- and y-position. Instead, the camera will rotate about this ground target to point at it.

Parameters:

xy (tuple[float, float]) – The x and y position.

set_look_angle(value: float) None

Sets the look angle of the camera.

A look angle of zero is looking straight down, and a look angle of 90 is looking straight ahead.

Parameters:

value (float) – The look angle in degrees.

set_azimuth(value: float) None

Sets the azimuth that the camera is pointing at.

Parameters:

value (float) – The azimuth in degrees.

execute(frame_id: int | None = None, frame_max: int | None = None, delta_seconds: float | None = None) None

Updates the SatelliteCamera state to the specified frame.

Parameters:
  • frame_id (int | None, optional) – The frame ID. Defaults to None.

  • frame_max (int | None, optional) – Max frame count in the current loop. Defaults to None.

  • delta_seconds (float | None, optional) – The target real-time in seconds between frames. This is used to calculate physical displacement for certain assets. Defaults to None.