Shortcuts

mmcv.image.lut_transform

mmcv.image.lut_transform(img, lut_table)[source]

Transform array by look-up table.

The function lut_transform fills the output array with values from the look-up table. Indices of the entries are taken from the input array.

Parameters
  • img (ndarray) – Image to be transformed.

  • lut_table (ndarray) – look-up table of 256 elements; in case of multi-channel input array, the table should either have a single channel (in this case the same table is used for all channels) or the same number of channels as in the input array.

Returns

The transformed image.

Return type

ndarray