Shortcuts

mmcv.image.imshear

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

Shear an image.

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

  • magnitude (int | float) – The magnitude used for shear.

  • direction (str) – The flip 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 sheared image.

Return type

ndarray