參考自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]
中。