Hello I'm using opencv on python and I was wondering if there was a way to generalise the value of the parameter gamma on a set on images that have diffrents luminance( dark , bright and normal images) in order to have a a set of images in the same range of luminosity.
here is the code where i use my gamma :
lookUpTable = np.empty((1,256), np.uint8)
for i in range(256):
lookUpTable[0,i] = np.clip(pow(i / 255.0, gamma) * 255.0, 0, 255)
img1 = cv2.LUT(img1, lookUpTable)
I'm not trying to use the same value of gamma but I'm looking for a way to change it automatically depending on the image luminosity.
I tried using the Image.getpixel function on images but i couldn't find a relation between the value of brightness and the gamma value.