Shortcuts

mmcv.image.imtranslate

mmcv.image.imtranslate(img: numpy.ndarray, offset: Union[int, float], direction: str = 'horizontal', border_value: Union[int, tuple] = 0, interpolation: str = 'bilinear')numpy.ndarray[source]

Translate an image.

Parameters
  • img (ndarray) – Image to be translated with format (h, w) or (h, w, c).

  • offset (int | float) – The offset used for translate.

  • direction (str) – The translate direction, either “horizontal” or “vertical”.

  • border_value (int | tuple[int]) – Value used in case of a constant border.

  • interpolation (str) – Same as resize().

Returns

The translated image.

Return type

ndarray