Shortcuts

mmedit.utils.adjust_gamma

mmedit.utils.adjust_gamma(image, gamma=1, gain=1)[source]

Performs Gamma Correction on the input image.

This function is adopted from skimage: https://github.com/scikit-image/scikit-image/blob/ 7e4840bd9439d1dfb6beaf549998452c99f97fdd/skimage/exposure/ exposure.py#L439-L494

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 (np.ndarray) – Input image.

  • gamma (float, optional) – Non negative real number. Defaults to 1.

  • gain (float, optional) – The constant multiplier. Defaults to 1.

Returns

Gamma corrected output image.

Return type

np.ndarray

Read the Docs v: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.