参考自tf2.1
官方文档:
https://www.tensorflow.org/api_docs/python/tf/image/random_saturation
Adjust the saturation of RGB images by a random factor.
该函数用于随机调整RGB图像的饱和度。
tf.image.random_saturation(
image, lower, upper, seed=None
)
Equivalent to adjust_saturation() but uses a saturation_factor randomly picked in the interval [lower, upper].
在区间[lower, upper]
上随机选择saturation_factor,更改图片饱和度
Args:
-
image: RGB image or images. Size of the last dimension must be 3.
-
image: 单张RGB图片或多张RGB图片,最后一维必须为3
-
lower: float. Lower bound for the random saturation factor.
-
lower: 浮点数,随机saturation factor的下限。
-
upper: float. Upper bound for the random saturation factor.
-
upper: 浮点数,随机saturation factor的上限。
-
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 upper <= lower or if lower < 0.
- 如果 upper <= lower 或者 lower < 0,将 raise ValueError