bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / exposure / exposure / adjust_gamma
function
skimage.exposure.exposure:adjust_gamma
source: /dev/scikit-image/src/skimage/exposure/exposure.py :626
Signature
def adjust_gamma ( image , gamma = 1 , gain = 1 ) Summary
Perform gamma correction on the input image.
Extended Summary
Gamma correction is a power-law transform [1]. This function transforms the input image pixel-wise according to the power law image**gamma after scaling each pixel to the range 0 to 1. Then it is rescaled to its original range and muliplied by gain.
Parameters
image: ndarrayInput image.
gamma: float, optionalNon negative real number. Default value is 1.
gain: float, optionalThe constant multiplier. Default value is 1.
Returns
out: ndarrayGamma corrected output image.
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.
Examples
import skimage as ski image = ski.util.img_as_float(ski.data.moon()) gamma_corrected = ski.exposure.adjust_gamma(image, 2)✓
image.mean() > gamma_corrected.mean()
✗See also
Aliases
-
skimage.exposure.adjust_gamma