Despite the fact that the recovery algorithms for unevenly lit images are numerous, OpenCV currently does not provide something ready-made from the box. Nevertheless, the network has many examples of implementation, and just using OpenCV.
The most common algorithms are based on Retinex (a bit of a related theory on the Russian wiki: Color Constancy ), but I would like to highlight the site, if I'm not mistaken, of the Croatian developers - "Image Processing Group" . It presents in free access not only the source code (C ++ / OpenCV, GNU GPL license), but even a tool that allows you to personally evaluate the results of the algorithms directly in the browser.
