Class Posterize

Inheritance Relationships

Base Type

Class Documentation

class Posterize : public mindspore::dataset::TensorTransform

Posterize an image by reducing the number of bits for each color channel.

Public Functions

explicit Posterize(uint8_t bits)

Constructor.

Parameters

bits[in] The number of bits to keep for each channel, should be in range of [0, 8].

样例
/* Define operations */
auto decode_op = vision::Decode();
auto posterize_op = vision::Posterize(8);

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

Destructor.