Image Equalization to compensate for light sources

荒凉一梦 提交于 2019-12-08 09:03:12

问题


Currently I am involved in an image processing project where I am dealing with human faces. But I am facing problems with the images in cases where the light source is on either the left or right side of the face. In those cases, the portion of the image away from the light source is darker. I want to distribute the brightness over the image more evenly, so that the the brightness of darker pixels is increased and the brightness of overly 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 the darker part and decreasing the brightness of the brighter part. I am not sure if I reproduced the problem statement correctly but this is a very common problem and I haven't found 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 the 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.


回答1:


Take a look at homomorphic filtering applied to image enhancement in which you can selectively filter reflectance and illumination components of an image.




回答2:


I found this paper: http://www.mirlab.org/conference_papers/International_Conference/ICASSP%202010/pdfs/0001374.pdf i think it exactly addresses the concern you have.

you will need to compute "gradient" of an image i.e. laplacian derivatives for which you can read up on this: http://docs.opencv.org/trunk/doc/py_tutorials/py_imgproc/py_gradients/py_gradients.html

i'd be very interested to know about your implementation. if you run into trouble post a comment here and i can try to help.



来源:https://stackoverflow.com/questions/28370075/image-equalization-to-compensate-for-light-sources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!