Class Affine

Inheritance Relationships

Base Type

Class Documentation

class Affine : public mindspore::dataset::TensorTransform

Apply affine transform on the input image.

Public Functions

explicit Affine(float_t degrees, const std::vector<float> &translation = {0.0, 0.0}, float scale = 0.0, const std::vector<float> &shear = {0.0, 0.0}, InterpolationMode interpolation = InterpolationMode::kNearestNeighbour, const std::vector<uint8_t> &fill_value = {0, 0, 0})

Constructor.

Parameters
  • degrees[in] The degrees to rotate the image.

  • translation[in] The values representing vertical and horizontal translation (default = {0.0, 0.0}). The first value represents the x axis translation while the second represents the y axis translation.

  • scale[in] The scaling factor for the image (default = 0.0).

  • shear[in] A float vector of size 2, representing the shear degrees (default = {0.0, 0.0}).

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

    • InterpolationMode::kLinear, Interpolation method is blinear interpolation (Only supports this mode in Lite).

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

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

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

  • fill_value[in] A vector representing the value to fill the area outside the transformation 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.

~Affine() = default

Destructor.

virtual std::shared_ptr<TensorOperation> Parse() override

The function to convert a TensorTransform object into a TensorOperation object.

Returns

Shared pointer to TensorOperation object.