Class Erase

Inheritance Relationships

Base Type

Class Documentation

class Erase : public mindspore::dataset::TensorTransform

Erase the input image with given value.

Public Functions

Erase(int32_t top, int32_t left, int32_t height, int32_t width, const std::vector<uint8_t> &value = {0, 0, 0}, bool inplace = false)

Constructor.

Parameters
  • top[in] Vertical ordinate of the upper left corner of erased region.

  • left[in] Horizontal ordinate of the upper left corner of erased region.

  • height[in] Height of erased region.

  • width[in] Width of erased region.

  • value[in] Pixel value used to pad the erased area. If a single integer is provided, it will be used for all RGB channels. If a sequence of length 3 is provided, it will be used for R, G, B channels respectively. Default: 0.

  • inplace[in] Whether to erase inplace. Default: False.

Example
/* dataset is an instance of Dataset object */
dataset = dataset->Map({std::make_shared<vision::Decode>(),
                        std::make_shared<vision::Erase>(10, 10, 10, 10)}, // operations
                       {"image"});                                        // input columns
~Erase() override = default

Destructor.