cupyx.scipy.ndimage.rotate#

cupyx.scipy.ndimage.rotate(input, angle, axes=(1, 0), reshape=True, output=None, order=3, mode='constant', cval=0.0, prefilter=True)[source]#

Rotate an array.

The array is rotated in the plane defined by the two axes given by the axes parameter using spline interpolation of the requested order.

Parameters:
  • input (cupy.ndarray) – The input array.

  • angle (float) – The rotation angle in degrees.

  • axes (tuple of 2 ints) – The two axes that define the plane of rotation. Default is the first two axes.

  • reshape (bool) – If reshape is True, the output shape is adapted so that the input array is contained completely in the output. Default is True.

  • output (cupy.ndarray or dtype) – The array in which to place the output, or the dtype of the returned array.

  • order (int) – The order of the spline interpolation, default is 3. Must be in the range 0-5.

  • mode (str) – Points outside the boundaries of the input are filled according to the given mode ('constant', 'nearest', 'mirror', 'reflect', 'wrap', 'grid-mirror', 'grid-wrap', 'grid-constant' or 'opencv').

  • cval (scalar) – Value used for points outside the boundaries of the input if mode='constant' or mode='opencv'. Default is 0.0

  • prefilter (bool) – Determines if the input array is prefiltered with spline_filter before interpolation. The default is True, which will create a temporary float64 array of filtered values if order > 1. If setting this to False, the output will be slightly blurred if order > 1, unless the input is prefiltered, i.e. it is the result of calling spline_filter on the original input.

Returns:

The rotated input.

Return type:

cupy.ndarray or None