曝光過度
類別keras_cv.layers.Solarization(
value_range, addition_factor=0.0, threshold_factor=0.0, seed=None, **kwargs
)
對影像中的每個像素套用 (最大值 - 像素 + 最小值)。
如果在建立時沒有 threshold
參數,則該層會對所有值執行曝光過度。如果在建立時指定了 threshold
,則該層只會擴充值大於 threshold
值的像素。
參考
引數
value_range
範圍內。keras_cv.FactorSampler
。對於每個擴充影像,會從提供的範圍中取樣一個值。如果傳入一個浮點數,則該範圍會被解釋為 (0, addition_factor)
。如果指定,則在曝光過度和閾值處理之前,此值會加到每個像素。加法值應根據值範圍 (0, 255) 進行縮放,預設值為 0.0。keras_cv.FactorSampler
。對於每個擴充影像,會從提供的範圍中取樣一個值。如果傳入一個浮點數,則該範圍會被解釋為 (0, threshold_factor)
。如果指定,則只有大於此閾值的像素值才會進行曝光過度處理。範例
(images, labels), _ = keras.datasets.cifar10.load_data()
print(images[0, 0, 0])
# [59 62 63]
# Note that images are Tensor with values in the range [0, 255]
solarization = Solarization(value_range=(0, 255))
images = solarization(images)
print(images[0, 0, 0])
# [196, 193, 192]
呼叫引數