Solarization
类keras.layers.Solarization(
addition_factor=0.0, threshold_factor=0.0, value_range=(0, 255), seed=None, **kwargs
)
对图像中的每个像素应用 (max_value - pixel + min_value)
。
当不带 threshold
参数创建时,该层对所有值执行日光化。当带指定 threshold
创建时,该层仅增强高于 threshold
值的像素。
参数
(0, addition_factor)
。如果指定,该值(乘以输入图像的值范围,例如 255)将在日光化和阈值处理之前添加到每个像素。默认为 0.0。(0, threshold_factor)
。如果指定,只有高于此阈值的像素值才会被日光化。value_range
内。典型的传入值是 (0, 255)
(RGB 图像) 或 (0., 1.)
(缩放图像)。name
和 dtype
。示例
(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]