Descent Image Equalization
Currently I am involved in an Image processing project in which I am dealing with the human faces. But I am facing problems with the images in which the light source is on either of left or right side of the face , in that case, the other portion of image is darker, But I want to Distribute the brightness over the image So that the the brightness of darker pixels is increased and the brightness of Over Bright pixels is decreased at the same time. I had used 'gamma Correction' techniques to do the same but the results are not desirable , Actually I want to create an output in which the brightness is independent of the light source, in other words , increasing the brightness of Darker part and decreasing the brightness of Brighter part. I am not sure if I reproduced the problem statement correctly but this is a very common problem and I haven't anything useful abut this on the web.
1. Image with Light source on the right side
2. Image after increasing the brightness of the darker pixels.[img = cv2.pow(img, 0.5)]
3. Image after decreasing the brightness of Bright pixels[img = cv2.pow(img, 2.0)]
I was thinking of taking mean of both the images 2 and 3 but as we see that the over bright pixels still persist in the image 3 , and I want to get rid of that pixels, Any suggestion ?
In the end I need an image with homogeneous brightness, and independent of the light source.