1 pose_generation.orientations

pose_generation.orientations

Orientation builder for finite candidate camera poses.

This module assigns camera frames after candidate centers have been sampled. It does not decide whether a candidate is valid; it only constructs base orientations and optional local jitter.

It provides OrientationBuilder plus local yaw, pitch, roll, and normalization helpers. Candidate positions and actor-visible target context are supplied by the generator, while pruning rules own feasibility decisions and renderers own camera projection.

1.1 Theory

forward_rig copies the reference rig rotation, while radial_away and radial_towards align the camera with the reference-candidate ray. In target_point mode, an actor-visible target center \(p_e\) defines a look-at frame for candidate center \(c_w\):

\[ z_w=\operatorname{norm}(p_e-c_w),\quad y_w=\operatorname{norm}(u_{\mathrm{up}}-(u_{\mathrm{up}}^\top z_w)z_w), \quad x_w=y_w\times z_w. \]

View jitter samples yaw and pitch in the local camera frame, \(\delta\psi\sim\mathcal{U}(-\psi_{\max},\psi_{\max})\) and \(\delta\theta\sim\mathcal{U}(-\theta_{\max},\theta_{\max})\), then builds a roll-free local forward axis before optional roll jitter is applied.

1.2 Classes

Name Description
OrientationBuilder Construct candidate camera orientations from centers and view settings.

1.2.1 OrientationBuilder

pose_generation.orientations.OrientationBuilder(config, *, verbosity)

Construct candidate camera orientations from centers and view settings.

1.2.1.1 Methods

Name Description
build Construct cam2world candidate poses for given centers.
1.2.1.1.1 build
pose_generation.orientations.OrientationBuilder.build(
    reference_pose,
    centers_world,
    *,
    target_center_world,
)

Construct cam2world candidate poses for given centers.

1.2.1.1.1.1 Parameters
Name Type Description Default
reference_pose PoseTW reference2world PoseTW used as origin for radial modes and as source of the rig2world rotation. required
centers_world torch.Tensor Tensor['N, 3'] candidate camera centers in the world frame. required
1.2.1.1.1.2 Returns
Name Type Description
tuple[PoseTW, PoseTW | None] PoseTW instance encoding cam2world SE(3) transforms for all candidates (length N).

This method takes a reference2world rig pose and world-space candidate centers and returns per-candidate PoseTW cam2world transforms. It proceeds in two stages:

  1. Construct base poses according to ViewDirectionMode:

    • ViewDirectionMode.FORWARD_RIG: reuse the rig rotation for all candidates and place cameras at centers_world.
    • ViewDirectionMode.RADIAL_AWAY / RADIAL_TOWARDS: call view_axes_from_poses so that camera optical axes point away from or towards the reference pose along the center-reference line, keeping x horizontal.
    • ViewDirectionMode.TARGET_POINT: build look-at frames for the configured target point, using the world up vector to stabilise roll.
  2. Apply local view jitter:

    • sample camera-frame forward axes via _sample_view_dirs_cam,
    • build orthonormal camera bases from these directions,
    • optionally apply roll jitter around the forward axis, and
    • compose the resulting rotations as right-multiplicative deltas with the base cam2world poses.
Back to top