参考自tf2.1
官方文档:
https://www.tensorflow.org/api_docs/python/tf/image/random_brightness
Adjust the brightness of images by a random factor.
该函数用于随机调整图像的亮度。
tf.image.random_brightness(
image, max_delta, seed=None
)
Equivalent to adjust_brightness() using a delta randomly picked in the interval [-max_delta, max_delta)
.
在区间[-max_delta, max_delta)
上随机选择delta值,增加到图片亮度上
Args:
- image: An image or images to adjust.
- image: 要去调整的一张图片或者多张图片
- max_delta: float, must be non-negative.
- max_delta: 浮点型,必须是非负的。
- seed: A Python integer. Used to create a random seed. See tf.compat.v1.set_random_seed for behavior.
- seed: 整型,用于创建随机数种子。
Returns:
- The brightness-adjusted image(s).
- 返回亮度调整过的图片
Raises:
- ValueError: if max_delta is negative.
- 如果
max_delta
是负数,则 raise ValueError