If I plot the average luminance as a function of x-pixel location I can see that the image is bright along the center than at the edges.
I would like to correct this using OpenCV so that the luminance is the same across the image. Is this possible?
EDIT: My code so far is
import cv2
import pylab
img = cv2.imread('3.jpeg', 1)
cv2.imshow("img",img)
lab= cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
cv2.imshow("lab",lab)
l, a, b = cv2.split(lab)
values = []
for c in xrange(l.shape[1]):
count = 0
for r in xrange(l.shape[0]):
count += l[r][c]
values.append(1.0 * count / l.shape[0])
pylab.figure()
pylab.ylabel('Average Luminance')
pylab.xlabel('X axis')
pylab.plot(values, 'k-')
pylab.show()