mindspore.dataset.vision.Erase

class mindspore.dataset.vision.Erase(top, left, height, width, value=0, inplace=False)[source]

Erase the input image with given value.

Parameters
  • top (int) – Vertical ordinate of the upper left corner of erased region.

  • left (int) – Horizontal ordinate of the upper left corner of erased region.

  • height (int) – Height of erased region.

  • width (int) – Width of erased region.

  • value (Union[int, Sequence[int, int, int]], optional) – Pixel value used to pad the erased area. Default: 0. If int is provided, it will be used for all RGB channels. If Sequence[int, int, int] is provided, it will be used for R, G, B channels respectively.

  • inplace (bool, optional) – Whether to apply erasing inplace. Default: False.

Raises
Supported Platforms:

CPU

Examples

>>> transforms_list = [vision.Decode(), vision.Erase(10,10,10,10)]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])