adjust_gamma
-
skimage.exposure.adjust_gamma(image, gamma=1, gain=1)
[source] -
Performs Gamma Correction on the input image.
Also known as Power Law Transform. This function transforms the input image pixelwise according to the equation
O = I**gamma
after scaling each pixel to the range 0 to 1.Parameters: image : ndarray
Input image.
gamma : float
Non negative real number. Default value is 1.
gain : float
The constant multiplier. Default value is 1.
Returns: out : ndarray
Gamma corrected output image.
See also
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
[R82] http://en.wikipedia.org/wiki/Gamma_correction Examples
>>> from skimage import data, exposure, img_as_float >>> image = img_as_float(data.moon()) >>> gamma_corrected = exposure.adjust_gamma(image, 2) >>> # Output is darker for gamma > 1 >>> image.mean() > gamma_corrected.mean() True
Please login to continue.