mindspore.dataset.vision.c_transforms.AutoContrast

class mindspore.dataset.vision.c_transforms.AutoContrast(cutoff=0.0, ignore=None)[source]

Apply automatic contrast on input image. This operator calculates histogram of image, reassign cutoff percent of lightest pixels from histogram to 255, and reassign cutoff percent of darkest pixels from histogram to 0.

Parameters
  • cutoff (float, optional) – Percent of lightest and darkest pixels to cut off from the histogram of input image. the value must be in the range [0.0, 50.0) (default=0.0).

  • ignore (Union[int, sequence], optional) – The background pixel values to ignore (default=None).

Examples

>>> transforms_list = [c_vision.Decode(), c_vision.AutoContrast(cutoff=10.0, ignore=[10, 20])]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])