通过随机因子调整图像的亮度。
用法
tf.image.random_brightness(
image, max_delta, seed=None
)参数
-
image要调整的图像或图像。 -
max_delta浮点数,必须为非负数。 -
seed一个 Python 整数。用于创建随机种子。有关行为,请参见tf.compat.v1.set_random_seed。
返回
- brightness-adjusted 图像。
抛出
-
ValueError如果max_delta为负数。
等效于 adjust_brightness() 使用在间隔 [-max_delta, max_delta) 中随机选取的 delta 。
要在给定 seed 值的情况下生成确定性结果,请使用 tf.image.stateless_random_brightness 。与使用seed 参数和tf.image.random_* ops 不同,tf.image.stateless_random_* ops 保证相同的结果给定相同的种子,而与调用函数的次数无关,并且与全局种子设置无关(例如 tf.random.set_seed )。
使用示例:
x = [[[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0],
[10.0, 11.0, 12.0]]]
tf.image.random_brightness(x, 0.2)
<tf.Tensor:shape=(2, 2, 3), dtype=float32, numpy=...>
相关用法
- Python tf.image.random_contrast用法及代码示例
- Python tf.image.random_hue用法及代码示例
- Python tf.image.random_saturation用法及代码示例
- Python tf.image.random_jpeg_quality用法及代码示例
- Python tf.image.random_flip_up_down用法及代码示例
- Python tf.image.random_crop用法及代码示例
- Python tf.image.random_flip_left_right用法及代码示例
- Python tf.image.rot90用法及代码示例
- Python tf.image.rgb_to_yiq用法及代码示例
- Python tf.image.resize_with_crop_or_pad用法及代码示例
- Python tf.image.resize用法及代码示例
- Python tf.image.rgb_to_hsv用法及代码示例
- Python tf.image.rgb_to_grayscale用法及代码示例
- Python tf.image.pad_to_bounding_box用法及代码示例
- Python tf.image.adjust_hue用法及代码示例
- Python tf.image.flip_left_right用法及代码示例
- Python tf.image.convert_image_dtype用法及代码示例
- Python tf.image.stateless_random_flip_up_down用法及代码示例
- Python tf.image.extract_glimpse用法及代码示例
- Python tf.image.flip_up_down用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.image.random_brightness。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
