通過隨機因子調整 RGB 圖像的色調。
用法
tf.image.random_hue(
image, max_delta, seed=None
)參數
-
imageRGB 圖像或圖像。最後一個維度的大小必須為 3。 -
max_delta浮點數。隨機增量的最大值。 -
seedoperation-specific 種子。它將與graph-level 種子一起使用,以確定將在此操作中使用的真實種子。請參閱set_random_seed 的文檔以了解它與graph-level 隨機種子的交互。
返回
-
調整後的圖像,形狀和 DType 與
image相同。
拋出
-
ValueError如果max_delta無效。
等效於 adjust_hue() 但使用在區間 [-max_delta, max_delta) 中隨機選取的 delta 。
max_delta 必須在區間 [0, 0.5] 中。
使用示例:
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_hue(x, 0.2)
<tf.Tensor:shape=(2, 2, 3), dtype=float32, numpy=...>
要在給定 seed 值的情況下生成確定性結果,請使用 tf.image.stateless_random_hue 。與使用seed 參數和tf.image.random_* ops 不同,tf.image.stateless_random_* ops 保證相同的結果給定相同的種子,而與調用函數的次數無關,並且與全局種子設置無關(例如 tf.random.set_seed )。
相關用法
- Python tf.image.random_brightness用法及代碼示例
- Python tf.image.random_contrast用法及代碼示例
- 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_hue。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
