Class RandomSolarize

Inheritance Relationships

Base Type

Class Documentation

class RandomSolarize : public mindspore::dataset::TensorTransform

Invert pixels randomly within a specified range.

Public Functions

explicit RandomSolarize(const std::vector<uint8_t> &threshold = {0, 255})

Constructor.

Parameters

threshold[in] A vector with two elements specifying the pixel range to invert. Threshold values should always be in (min, max) format. If min=max, it will to invert all pixels above min(max).

Example
/* Define operations */
auto decode_op = vision::Decode();
auto random_op = vision::RandomSharpness({0, 255});

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

Destructor.