mindspore.dataset.vision.Solarize

class mindspore.dataset.vision.Solarize(threshold)[source]

Solarize the image by inverting all pixel values within the threshold.

Parameters

threshold (Union[float, Sequence[float, float]]) – Range of solarize threshold, should always be in (min, max) format, where min and max are integers in range of [0, 255], and min <= max. If a single value is provided or min=max, then invert all pixel values above min(max).

Raises
  • TypeError – If threshold is not of type float or Sequence[float, float].

  • ValueError – If threshold is not in range of [0, 255].

Supported Platforms:

CPU

Examples

>>> import mindspore.dataset as ds
>>> import mindspore.dataset.vision as vision
>>>
>>> image_folder_dataset = ds.ImageFolderDataset("/path/to/image_folder_dataset_directory")
>>> transforms_list = [vision.Decode(), vision.Solarize(threshold=(10, 100))]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])
Tutorial Examples: