Class RandomColorAdjust

Inheritance Relationships

Base Type

Class Documentation

class RandomColorAdjust : public mindspore::dataset::TensorTransform

Randomly adjust the brightness, contrast, saturation, and hue of the input image.

Public Functions

explicit RandomColorAdjust(const std::vector<float> &brightness = {1.0, 1.0}, const std::vector<float> &contrast = {1.0, 1.0}, const std::vector<float> &saturation = {1.0, 1.0}, const std::vector<float> &hue = {0.0, 0.0})

Constructor.

参数
  • brightness[in] Brightness adjustment factor. Must be a vector of one or two values if it is a vector of two values it needs to be in the form of [min, max] (Default={1, 1}).

  • contrast[in] Contrast adjustment factor. Must be a vector of one or two values if it is a vector of two values, it needs to be in the form of [min, max] (Default={1, 1}).

  • saturation[in] Saturation adjustment factor. Must be a vector of one or two values if it is a vector of two values, it needs to be in the form of [min, max] (Default={1, 1}).

  • hue[in] Hue adjustment factor. Must be a vector of one or two values if it is a vector of two values, it must be in the form of [min, max] where -0.5 <= min <= max <= 0.5 (Default={0, 0}).

样例
/* Define operations */
auto decode_op = vision::Decode();
auto random_color_adjust_op = vision::RandomColorAdjust({1.0, 5.0}, {10.0, 20.0}, {40.0, 40.0});

/* dataset is an instance of Dataset object */
dataset = dataset->Map({decode_op, random_color_adjust_op},  // operations
                       {"image"});                           // input columns
~RandomColorAdjust() = default

Destructor.