mindspore.dataset.vision.c_transforms.RandomSharpness

class mindspore.dataset.vision.c_transforms.RandomSharpness(degrees=(0.1, 1.9))[source]

Adjust the sharpness of the input image by a fixed or random degree. Degree of 0.0 gives a blurred image, degree of 1.0 gives the original image, and degree of 2.0 gives a sharpened image.

Parameters

degrees (Union[list, tuple], optional) – Range of random sharpness adjustment degrees. It should be in (min, max) format. If min=max, then it is a single fixed magnitude operation (default = (0.1, 1.9)).

Raises
  • TypeError – If degrees is not a list or tuple.

  • ValueError – If degrees is negative.

  • ValueError – If degrees is in (max, min) format instead of (min, max).

Examples

>>> transforms_list = [c_vision.Decode(), c_vision.RandomSharpness(degrees=(0.2, 1.9))]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])