CameraPoseRandomizer
Samples one camera pose per view and keyframes it, so a single randomized scene yields several images.
python
from telekinesis.illusion.randomizer.randomizer_node import CameraPoseRandomizer
CameraPoseRandomizer(
pose_sampling_function, # callable returning (location, euler_angles)
number_of_views=0, # rendered images per scene
**kwargs, # forwarded to the sampling function
)Parameters
| Parameter | Type | Description |
|---|---|---|
pose_sampling_function | Callable[..., tuple[np.ndarray, np.ndarray]] | Returns a location and XYZ Euler angles. Receives the Context as context plus every keyword argument passed to the node. |
number_of_views | int | Number of camera poses sampled per scene, and therefore images rendered per scene. |
**kwargs | Forwarded verbatim to the sampling function on every call. |
Camera Pose Samplers
Ready-made samplers live in telekinesis.illusion.sampler.camera_pose_sampler:
python
from telekinesis.illusion.sampler.camera_pose_sampler import (
shell_sampler,
volume_sampler,
)shell_sampler places the camera on a spherical shell around a center point:
| Parameter | Type | Default | Description |
|---|---|---|---|
center | np.ndarray | list[str] | None | None | The point the shell is centered on, or the names of the objects to center on. |
radius_min / radius_max | float | 0.4 / 0.6 | Bounds on the camera distance from the center, in meters. |
elevation_min / elevation_max | float | -90.0 / 90.0 | Bounds on the elevation angle, in degrees. |
azimuth_min / azimuth_max | float | -180.0 / 180.0 | Bounds on the azimuth angle, in degrees. |
inplane_rot_min / inplane_rot_max | float | -60.0 / 60.0 | Bounds on the in-plane camera rotation, in degrees. |
volume_sampler places the camera inside a volume and orients it towards a point of interest:
| Parameter | Type | Default | Description |
|---|---|---|---|
point_of_interst | np.ndarray | list[str] | None | None | The point the camera looks at, or the names of the objects to look at. |
volume_size | tuple[float, float, float] | None | None | Size of the sampling volume. Derived from the scene when omitted. |
volume_center | np.ndarray | None | None | Center of the sampling volume. |
distance_range | tuple[float, float] | None | None | Bounds on the camera distance from the point of interest. |
inplane_rot_min / inplane_rot_max | float | -60.0 / 60.0 | Bounds on the in-plane camera rotation, in degrees. |
Usage
python
randomizer.add_randomizer(
randomizer_node=CameraPoseRandomizer(
pose_sampling_function=shell_sampler,
number_of_views=2,
radius_min=0.5,
radius_max=0.7,
),
node_name="camera_pose_randomizer",
)