Skip to content
Search

Gamma correction

lastmod 2023-11-29created 2016-02-1315 edits

Gamma correction refers to nonlinearly transforming a light intensity signal using a nonlinear transfer function in video cameras, computer graphics, and so on. The term gamma correction is widely used, but in most cases the expression gamma encoding is more appropriate.

Fine-tuning the gamma value according to the characteristics of a display and the like is gamma adjustment, which is a different concept from gamma correction

Brightness/contrast adjustment

How results change depending on the brightness adjustment method

Excerpt from the ddrm project:

with self.layer(f"{prefix}-channels-bgr") as layer:
    layer.frame = image.copy()
with self.layer(f"{prefix}-channels-v") as layer:
    hsv = cvt_color_BGR2HSV(image)
    v = hsv[:, :, 2]
    layer.frame = v
with self.layer(f"{prefix}-channels-gray") as layer:
    v = cvt_color_BGR2GRAY(image)
    layer.frame = v
with self.layer(f"{prefix}-channels-sum") as layer:
    v = image.sum(axis=2)
    v = (v / (255 * 3) * 255).astype(uint8)
    layer.frame = v
Gamma_correction_-sample-_bgr.png
Gamma_correction_-sample-_hsv-v.png
Gamma_correction_-sample-_gray.png
Gamma_correction_-sample-_sum.png

Original BGR

HSV - Value channel

Gray

Channels Sum

See also

Favorite site

author Zer0 sitemap