blenderproc.python.renderer.FlowRendererUtility module

Provides functionality to render an optical flow image.

class blenderproc.python.renderer.FlowRendererUtility._FlowRendererUtility[source]

Bases: object

static output_vector_field(forward_flow, backward_flow, output_dir)[source]

Configures compositor to output speed vectors.

Parameters:
  • forward_flow (bool) – Whether to render forward optical flow.

  • backward_flow (bool) – Whether to render backward optical flow.

  • output_dir (str) – The directory to write images to.

blenderproc.python.renderer.FlowRendererUtility.render_optical_flow(output_dir=None, temp_dir=None, get_forward_flow=True, get_backward_flow=True, blender_image_coordinate_style=False, forward_flow_output_file_prefix='forward_flow_', forward_flow_output_key='forward_flow', backward_flow_output_file_prefix='backward_flow_', backward_flow_output_key='backward_flow', return_data=True, verbose=False)[source]

Renders the optical flow (forward and backward) for all frames.

Parameters:
  • output_dir (Optional[str]) – The directory to write images to.

  • temp_dir (Optional[str]) – The directory to write intermediate data to.

  • get_forward_flow (bool) – Whether to render forward optical flow.

  • get_backward_flow (bool) – Whether to render backward optical flow.

  • blender_image_coordinate_style (bool) – Whether to specify the image coordinate system at the bottom left (blender default; True) or top left (standard convention; False).

  • forward_flow_output_file_prefix (str) – The file prefix that should be used when writing forward flow to a file.

  • forward_flow_output_key (str) – The key which should be used for storing forward optical flow values.

  • backward_flow_output_file_prefix (str) – The file prefix that should be used when writing backward flow to a file.

  • backward_flow_output_key (str) – The key which should be used for storing backward optical flow values.

  • return_data (bool) – Whether to load and return generated data.

  • verbose (bool) – If True, more details about the rendering process are printed.

Return type:

Dict[str, Union[ndarray, List[ndarray]]]

Returns:

dict of lists of raw renderer outputs. Keys can be ‘forward_flow’, ‘backward_flow’