Class RandomRotation

Inheritance Relationships

Base Type

Class Documentation

class RandomRotation : public mindspore::dataset::TensorTransform

Rotate the image according to parameters.

Public Functions

RandomRotation(std::vector<float> degrees, InterpolationMode resample = InterpolationMode::kNearestNeighbour, bool expand = false, std::vector<float> center = {}, std::vector<uint8_t> fill_value = {0, 0, 0})

Constructor.

Parameters
  • degrees[in] A float vector of size 2, representing the starting and ending degrees.

  • resample[in] An enum for the mode of interpolation.

    • InterpolationMode::kLinear, Interpolation method is linear interpolation.

    • InterpolationMode::kNearestNeighbour, Interpolation method is nearest-neighbor interpolation.

    • InterpolationMode::kCubic, Interpolation method is bicubic interpolation.

    • InterpolationMode::kArea, Interpolation method is pixel area interpolation.

    • InterpolationMode::kCubicPil, Interpolation method is bicubic interpolation like implemented in pillow.

  • expand[in] A boolean representing whether the image is expanded after rotation.

  • center[in] A float vector of size 2 or empty, representing the x and y center of rotation or the center of the image.

  • fill_value[in] A vector representing the value to fill the area outside the transform in the output image. If 1 value is provided, it is used for all RGB channels. If 3 values are provided, it is used to fill R, G, B channels respectively.

~RandomRotation() = default

Destructor.