mindspore.dataset.vision.RandomSolarize ======================================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/dataset_vision/mindspore.dataset.vision.RandomSolarize.rst :alt: 查看源文件 .. py:class:: mindspore.dataset.vision.RandomSolarize(threshold=(0, 255)) 从给定阈值范围内随机选择一个子范围,对位于给定子范围内的像素,将其像素值设置为(255 - 原本像素值)。 参数: - **threshold** (tuple, 可选) - 随机反转的阈值范围。默认值: ``(0, 255)`` 。 `threshold` 输入格式应该为 (min, max),其中min和max是 [0, 255] 范围内的整数,并且min <= max,那么属于[min, max]这个区间的像素值会被反转。如果min与max相等,则反转所有大于等于 min(或max) 的像素值。 异常: - **TypeError** - 当 `threshold` 的类型不为tuple。 - **ValueError** - 当 `threshold` 取值不在[0, 255]范围内。 教程样例: - `视觉变换样例库 `_