ToRgbDisplay#

class ToRgbDisplay(color_compo: Optional[str] = None, channels_display: Optional[List[int]] = None, lut: Optional[numpy.array] = None, flatten_mask: bool = True)#

Convert (image, mask) sample into compatible RGB format for display purpose

For the image choose the channel to use as Red, Green, Blue for display, for the mask data an argmax flattening is apply first if needed and then a lut conversion is made

Note

Input (image, mask) should already be in HWC order and not CHW. To convert from one to another format see ..

Parameters
  • color_compo (str) – Name or color composition to use, if use then image channels should be ordered by increasing spectral wavelenght (Blue, Green , Red, Infra-Red)

  • channels_display (List(Int)) – List of channel to use as gray or Red, Green, Blue band if len(channels_display)=1 is for gray mode and len=3 for RGB mode

  • lut (np.array) – numpy array to convert class number to rgb value. If shape is (N, 3) then the array index is use class number if shape is (N, 4) then each is ( Class_Id, R, V, B)

  • flatten_mask (bool) – use an argmax function for mask data before lut conversion.