RGBClassTransformer#
- class RGBClassTransformer[source]#
Bases:
RasterTransformer
Maps RGB values to class IDs. Can also do the reverse.
- __init__(class_config: ClassConfig)[source]#
- Parameters
class_config (ClassConfig) –
Methods
__init__
(class_config)class_to_rgb
(class_labels)rgb_to_class
(array_rgb)transform
(chip[, channel_order])Transform RGB array to array of class IDs or vice versa.
- __init__(class_config: ClassConfig)[source]#
- Parameters
class_config (ClassConfig) –
- transform(chip: ndarray, channel_order: Optional[List[int]] = None) ndarray [source]#
Transform RGB array to array of class IDs or vice versa.
- Parameters
chip (np.ndarray) – Numpy array of shape (H, W, 3).
channel_order (Optional[List[int]], optional) – List of indices of channels that were extracted from the raw imagery. Defaults to None.
- Returns
An array of class IDs.
- Return type
np.ndarray