参考自tf2.1
官方文档:
https://www.tensorflow.org/api_docs/python/tf/image/random_hue
Adjust the hue of RGB images by a random factor.
该函数用于随机调整RGB图像的色调。
tf.image.random_hue(
image, max_delta, seed=None
)
Equivalent to adjust_hue() but uses a delta randomly picked in the interval [-max_delta, max_delta].
max_delta must be in the interval [0, 0.5].
在区间[-max_delta, max_delta]
上随机选择delta值,更改图片色调。
max_delta
必须在区间[0, 0.5]
中。
Args:
-
image: RGB image or images. Size of the last dimension must be 3.
-
image: 单张RGB图片或多张RGB图片,最后一维必须为3
-
max_delta: float. Maximum value for the random delta.
-
max_delta: 浮点数,指定随机 delta 值的最大值
-
seed: An operation-specific seed.
It will be used in conjunction with the graph-level seed to determine the real seeds that will be used in this operation.
Please see the documentation of set_random_seed for its interaction with the graph-level random seed. -
seed: 特定操作的种子。(注:笔者不太明白这个种子和随机数种子有什么区别,只是感觉有点儿玄乎)
Returns:
- Adjusted image(s), same shape and DType as image.
- 色调调整过后的图片,与输入 image 有相同的shape和类型
Raises:
- ValueError: if max_delta is invalid.
- 如果 max_delta 是无效的,将 raise ValueError,
max_delta
必须在区间[0, 0.5]
中。