Hi watertreader.
The uneven illumination is one of the most serious problems in image processing. I will describe in the following lines a method for grayscale images that i have already applied to my project.
Image (f(x,y)) is a function which is consist of two components
1) the amount of source light incident on the scene being viewed and (2) the amount of light reflected by the objects in the scene. Appropriately they are called the illumination (i(x,y)) and reflectance (r(x,y)) components.
The functions i(x,y) and r(x,y) combine as a product to form f(x,y):
f(x,y)=i(x,y)*r(x,y)
Our goal is to have at the end only the reflectance component, so initially must be calculated the illumination function. At the frequency domain the illumination is the very low frequencies and the reflectance is the high frequencies.
The initial image is filtered by a very low pass filter (F(0,0)) in frequency domain. The result is an image which shows the estimated illumination.
As you can see at the above equation the two components are combined by non linear method (multiplication).
If you divide the initial image with the estimated illumination you will get an image with illumination correction. The result of the division is the reflectance component.
Regards
auto_mitch