geo3d.visualization.visualizer

Classes

PointCloudColorizer

Handles different methods of colorizing point clouds.

ValidationVisualizer

A class for visualizing objects for validation.

Functions

visualize(, point_size)

Create a visualization window for the list of geometries.

Module Contents

class geo3d.visualization.visualizer.PointCloudColorizer(object_cmap: str = 'plasma', background_cmap: str = 'viridis', background_dim: str = 'Intensity', labels_cmap: dict = COLOR_MAP, background_subclasses: list = CUSTOM_VIZ_MAPPING)

Handles different methods of colorizing point clouds.

object_cmap = 'plasma'
background_cmap = 'viridis'
background_dim = 'Intensity'
labels_cmap
background_subclasses
colorize(method: str, pcd_array: numpy.ndarray, label: int) List[open3d.geometry.PointCloud]

Get the colorize function.

Parameters:
  • method (str) – A choice from 3 methods: ‘background_colors’, ‘label_colors’, or ‘subclass_colors’.

  • pcd_array (np.ndarray) – The point cloud array as a structured numpy array.

  • label (int) – The label of the object to highlight.

Returns:

The colorization method.

Return type:

Callable

_colorize_with_background(pcd_array: numpy.ndarray, label: int) List[open3d.geometry.PointCloud]

Colorize an array containing an object and other labels.

The main object is colorized using a colormap defined according to the object’s ‘Z’ axis. The rest of the point cloud is colorized using a colormap defined according to a dimension.

Parameters:
  • pcd_array (np.ndarray) – An array of point cloud as read from pdal. It should contain coordinates as well as other dimensions like ‘Intensity’.

  • label (int) – The label number of the object.

Returns:

(np.ndarray) An array containing colorized point clouds.

_colorize_with_label(pcd_array: numpy.ndarray, label: int) List[open3d.geometry.PointCloud]

Colorize an array containing an object and other labels.

The main object is colorized using a colormap defined according to the object’s ‘Z’ axis. For the rest of the point cloud, each label is colorized uniformly using a colormap dictionary.

Parameters:
  • pcd_array (np.ndarray) – An array of point cloud as read from pdal. It should contain coordinates as well as other dimensions like ‘Intensity’.

  • label (int) – The label number of the object.

Returns:

(np.ndarray) An array containing colorized point clouds.

_colorize_with_subclass(pcd_array: numpy.ndarray, label: int) List[open3d.geometry.PointCloud]

Colorize an array containing an object and other labels.

The main object is colorized using a colormap defined according to the object’s ‘Z’ axis. For the rest of the point cloud, each label is colorized uniformly using a colormap dictionary.

Parameters:
  • pcd_array (np.ndarray) – An array of point cloud as read from pdal. It should contain coordinates as well as other dimensions like ‘Intensity’.

  • label (int) – The label number of the object.

Returns:

(np.ndarray) An array containing colorized point clouds.

_colorize_with_default(pcd_array: numpy.ndarray) List[open3d.geometry.PointCloud]

Colorize in default the entered point cloud array.

Parameters:

pcd_array (np.ndarray) – An array of point cloud as read from pdal. It should contain coordinates as well as other dimensions like ‘Intensity’.

Returns:

(np.ndarray) An array containing uncolored point clouds.

class geo3d.visualization.visualizer.ValidationVisualizer(method: str, object_cmap: str = 'plasma', background_cmap: str = 'viridis', background_dim: str = 'Intensity', labels_cmap: dict = COLOR_MAP, background_subclasses: list = CUSTOM_VIZ_MAPPING, visualizer_background: tuple = (1, 1, 1), visualizer_point_size: int = 3)

A class for visualizing objects for validation.

method
colorizer
object_cmap = 'plasma'
background_cmap = 'viridis'
background_dim = 'Intensity'
labels_cmap
background_subclasses
visualizer_background = (1, 1, 1)
visualizer_point_size = 3
colorized_pcd = []
plot(pcd_array: numpy.ndarray, label: int) None

Plot method.

Parameters:
  • pcd_array (np.ndarray) – The point cloud array.

  • label (str) – The label to highlight.

geo3d.visualization.visualizer.visualize(geometries: list, background_color: tuple = (1, 1, 1), point_size: int = 3) None

Create a visualization window for the list of geometries.

Parameters:
  • geometries (list) – A list of geometries to be visualized (open3d.geometry.Geometry).

  • background_color (tuple) – A tuple of RGB values of the background color. Defaults to white (1, 1, 1).

  • point_size (int) – The size of points in the visualization. Defaults to 3.

Returns:

None