tf.image.adjust_gamma
Stay organized with collections
Save and categorize content based on your preferences.
Performs Gamma Correction on the input image.
tf.image.adjust_gamma(
image, gamma=1, gain=1
)
Also known as Power Law Transform. This function converts the
input images at first to float representation, then transforms them
pixelwise according to the equation Out = gain * In**gamma
,
and then converts the back to the original data type.
Args |
image
|
RGB image or images to adjust.
|
gamma
|
A scalar or tensor. Non negative real number.
|
gain
|
A scalar or tensor. The constant multiplier.
|
Returns |
A Tensor. A Gamma-adjusted tensor of the same shape and type as image .
|
Usage Example:
>> import tensorflow as tf
>> x = tf.random.normal(shape=(256, 256, 3))
>> tf.image.adjust_gamma(x, 0.2)
Raises |
ValueError
|
If gamma is negative.
|
Notes:
For gamma greater than 1, the histogram will shift towards left and
the output image will be darker than the input image.
For gamma less than 1, the histogram will shift towards right and
the output image will be brighter than the input image.
References:
[1] http://en.wikipedia.org/wiki/Gamma_correction
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]