geo3d.utils.colors¶
Functions¶
|
Normalize RGB values in [0, 1]. |
|
Return an array of RGB values according the input array x. |
|
Create an array of RGB colors according to the chosen colormap. |
|
Assign colors to a PointCloud object. |
Module Contents¶
- geo3d.utils.colors.norm_color(rgb: List[int]) List[float]¶
Normalize RGB values in [0, 1].
- Parameters:
rgb – [R, G, B] values in 8 bits.
- Returns:
A list of normalized RGB values.
- geo3d.utils.colors.colormap_rgb(x: numpy.typing.NDArray[numpy.floating], colormap: str) numpy.typing.NDArray[numpy.floating]¶
Return an array of RGB values according the input array x.
- Parameters:
x (np.ndarray) – An input array to be normalized.
colormap (str) – A colormap as defined by ‘matplotlib.colormaps’.
- Returns:
An array of RGB values
- geo3d.utils.colors.color_array(pcd_array: numpy.typing.NDArray[numpy.floating], cmap: str = 'plasma', dimension: str = 'Z') numpy.typing.NDArray[numpy.floating]¶
Create an array of RGB colors according to the chosen colormap.
- Parameters:
pcd_array (np.ndarray) – An structured array containing dimensions.
cmap (str) – A colormap as defined by matplotlib.colormaps.
dimension (str) – A column of the array to use to create the colors array.
- Returns:
(np.ndarray) An array of shape (n, 3) of RGB values.
- geo3d.utils.colors.assign_color(o3d_pcd: open3d.geometry.PointCloud, colors: numpy.typing.NDArray[numpy.floating]) None¶
Assign colors to a PointCloud object.
- Parameters:
o3d_pcd – A PointCloud object as defined by o3d.
colors – An array of RGB colors.