evlib.vis.utils¶
Utility functions for coloring, loading, etc.
Functions
|
Color depth image. |
|
Color depth image even with nan values. |
|
Color optical flow. |
|
A wrapper function to get image and returns PIL Image object. |
- evlib.vis.utils.load_image(image)¶
A wrapper function to get image and returns PIL Image object.
- Parameters:
image (str or np.ndarray) – If it is str, open and load the image. If it is numpy array, it converts to PIL.Image.
- Returns:
PIl Image object.
- Return type:
Image.Image
- evlib.vis.utils.color_depth_with_nan(depth, min_depth, max_depth, fillnan)¶
Color depth image even with nan values. The nan will be padded with fillnan value.
- evlib.vis.utils.color_depth(depth, min_depth, max_depth)¶
Color depth image.
- evlib.vis.utils.color_optical_flow(flow_v, flow_h, max_magnitude=None, ord=1.0)¶
Color optical flow.
- Parameters:
flow_v (numpy.ndarray) – [H x W], vertical direction.
flow_h (numpy.ndarray) – [H x W], horizontal direction.
max_magnitude (float, optional) – Max magnitude used for the colorization. Defaults to None.
ord (float) – 1: our usual, 0.5: DSEC colorinzing.
- Returns:
[W, H, 3] color_wheel (np.ndarray): [H, H, 3] color wheel max_magnitude (float): max magnitude of the flow.
- Return type:
flow_rgb (np.ndarray)