Rotate the image by angle

transform_random_rotation(
  img,
  degrees,
  resample = FALSE,
  expand = FALSE,
  center = NULL,
  fill = NULL
)

Arguments

img

A magick-image, array or torch_tensor.

degrees

(sequence or float or int): Range of degrees to select from. If degrees is a number instead of sequence like (min, max), the range of degrees will be (-degrees, +degrees).

resample

(int, optional): An optional resampling filter.

expand

(bool, optional): Optional expansion flag. If true, expands the output to make it large enough to hold the entire rotated image. If false or omitted, make the output image the same size as the input image. Note that the expand flag assumes rotation around the center and no translation.

center

(list or tuple, optional): Optional center of rotation, (x, y). Origin is the upper left corner. Default is the center of the image.

fill

(n-tuple or int or float): Pixel fill value for area outside the rotated image. If int or float, the value is used for all bands respectively. Defaults to 0 for all bands. This option is only available for Pillow>=5.2.0. This option is not supported for Tensor input. Fill value for the area outside the transform in the output image is always 0.