Gamma correction is used to skew pixels, value distribution in a non-linear manner. With gamma correction, it's possible to adjust the luminescence of the image to make it easier to see. In this recipe, you will learn how to apply gamma correction to images.
Gamma correction and per-element math
Getting ready
You need to have OpenCV 3.x installed with Python API support.
How to do it...
The steps for this recipe are as follows:
- Load the image as grayscale and convert every pixel value to the np.float32 data type in the [0, 1] range:
import cv2
import numpy as np
image...