Render
compute_modelview_matrices
paz.backend.render.compute_modelview_matrices(camera_origin, world_origin, roll=None, translate=None)
Compute model-view matrices from camera to origin and origin to camera.
Arguments
- camera_origin: Numpy-array of length 3 determining the camera origin
- world_origin: Numpy-array of length 3 determining the world origin
- roll:
None
or float. IfNone
no roll is performed. If float
value should be between [0, 2*pi)
Returns
Transformation from camera to world and world to camera.
get_look_at_transform
paz.backend.render.get_look_at_transform(camera_position, target_position)
Make transformation from target position to camera position with orientation looking at the target position.
Arguments
- camera_position: Numpy-array of length 3. Camera position.
- target_position: Numpy-array of length 3. Target position.
random_perturbation
paz.backend.render.random_perturbation(localization, shift)
Adds noise to 'localization' vector coordinates.
Arguments
- localization: List of 3 floats.
- shift: Float indicating a uniform distribution [-shift, shift].
Returns
perturbed localization
random_translation
paz.backend.render.random_translation(localization, shift)
Adds noise to 'localization' vector coordinates.
Arguments
- localization: List of 3 floats.
- shift: Float indicating a uniform distribution [-shift, shift]. Returns
perturbed localization
roll_camera
paz.backend.render.roll_camera(world_to_camera, angle)
Roll camera coordinate system.
Arguments:
- world_to_camera: Numpy array containing the affine transformation.
- max_roll: 'None' or float. If None, the camera is not rolled. If float it should be a value between [0, 2*pi)
sample_point_in_full_sphere
paz.backend.render.sample_point_in_full_sphere(distance=1.0)
Get a point of the top of the unit sphere.
Arguments
- distance: Float, indicating distance to origin.
Returns
- sphere_point: List of spatial coordinates of a sphere.
sample_point_in_sphere
paz.backend.render.sample_point_in_sphere(distance, top_only=False)
Samples random points from a sphere
Arguments
- distance: Float, indicating distance to origin.
Returns:
List of spatial coordinates of a sphere.
sample_point_in_top_sphere
paz.backend.render.sample_point_in_top_sphere(distance=1.0)
Get a point of the top of the unit sphere.
Arguments
- distance: Float, indicating distance to origin.
Returns
- sphere_point: List of spatial coordinates of a sphere.
sample_uniformly
paz.backend.render.sample_uniformly(value)
Samples from a uniform distribution.
Arguments
- values: List or float. If list it must have [min_value, max_value].
Returns
Float
scale_translation
paz.backend.render.scale_translation(matrix, scale=10.0)
Changes the scale of the translation vector. Used for changing the regression problem to a bigger scale.
Arguments:
- matrix: Numpy array of shape [4, 4]
- scale: Float used to multiple all the translation component.
Returns:
Numpy array of shape [4, 4]
split_alpha_channel
paz.backend.render.split_alpha_channel(image)
Splits alpha channel from an RGBD image.
Arguments
- image: Numpy array of shape [H, W, 4]
Returns
List of two numpy arrays of shape [H, W, 3] and [H, W]
translate_camera
paz.backend.render.translate_camera(world_to_camera, translation)
Translate camera coordinate system in its XY plane.
Arguments:
- world_to_camera: Numpy array containing the affine transformation.
- translation: List or array with two inputs.