geo3d.utils.colors ================== .. py:module:: geo3d.utils.colors Functions --------- .. autoapisummary:: geo3d.utils.colors.norm_color geo3d.utils.colors.colormap_rgb geo3d.utils.colors.color_array geo3d.utils.colors.assign_color Module Contents --------------- .. py:function:: norm_color(rgb: List[int]) -> List[float] Normalize RGB values in [0, 1]. :param rgb: [R, G, B] values in 8 bits. :returns: A list of normalized RGB values. .. py:function:: 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. :param x: An input array to be normalized. :type x: np.ndarray :param colormap: A colormap as defined by 'matplotlib.colormaps'. :type colormap: str :returns: An array of RGB values .. py:function:: 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. :param pcd_array: An structured array containing dimensions. :type pcd_array: np.ndarray :param cmap: A colormap as defined by `matplotlib.colormaps`. :type cmap: str :param dimension: A column of the array to use to create the colors array. :type dimension: str :returns: (np.ndarray) An array of shape (n, 3) of RGB values. .. py:function:: assign_color(o3d_pcd: open3d.geometry.PointCloud, colors: numpy.typing.NDArray[numpy.floating]) -> None Assign colors to a PointCloud object. :param o3d_pcd: A PointCloud object as defined by o3d. :param colors: An array of RGB colors.