Non-uniform illumination, cause problems in various areas of photography, such as mosaicing of panoramas, face recognition and microscopy. The remedying procedure is often called illumination or shading correction/normalisation.


The paper propose a method that can be used both for minimising the change in intensity over the image, but also for increasing the contrast in low contrast areas. This is important, as the contrast is generally lower in high and low intensity areas.

Another important enhancement of the method is aimed at preserving the original intensity of medium-sized objects having intensity different than that of their surroundings. Such objects are smaller than the uneven illumination varying across the image, but still much larger than small details in the image. Preservation of their intensity would otherwise be impossible, as the goal of any illumination correction method is to minimise the overall change in intensity across the image.

The image above shows three aerial photos, which have obvious uneven illumination (top row). The middle row shows what happens when trying to normalise the illumination. The big white field and the black river appears grey and “washed out”. Rippling effects along the borders are also visible. The bottom row shows the result of the proposed algorithm. The intensity of the field and river is preserved and the rippling effect is almost invisible.


The images above show an synthetic image where the image to the left contains two medium sized objects and uneven illumination. The middle image shows the result of normalising the overall illumination. The objects are washed out. The image to the right shows the result of the proposed algorithm. The objects are preserved and the back ground illumination is even.


The first image above image shows a photo of a brick wall with a bit darker bricks on the right side that we wanted to make more like the others, without making them too similar to the rest. The second image shows what happens if each illumination is corrected for colour channel. The colours are changed in an improper way (see within the the blue circles). The third image use the proposed method and the colours are preserved and the dark bricks are brighter. The same goes for the fourth image where the process is applied on the V part of the HSV space. Obviously, the process is then three times faster, but it does not always work as the next example shows.



The image above shows a cake with uneven illumination. Especially note how the upper corners are much darker than the lower ones.  The middle image is corrected by processing the V part of the HSV space, but fails to improve the upper corners because there is not much light there at all. The reason is that the conversion between RGB and HSV yields an undetermined colour, and the upper corners in the image are not represented correctly. The rightmost image is better since all three colour channels are processed separately. Note how the illumination of the plate is more even for both corrected images.


Let’s say you want to create a texture for a computer graphics model of your BBQ in the image to the left. The presented tool can be used to normalise the illumination so that the   dark area in the front facing part will have similar intensity as the brighter right side of the BBQ.

The image to the right shows the result where both the illumination has been normalised and the contrast has been enhanced. Here the parameters have been set with focus on the illumination of the BBQ and not on the surrounding area.

Matlab implementation

Please download shaCorr.m

Play around with the parameters to get acquainted to what effect they have. For instance the parameters for the very first example of aerial photography was set to

First image, white field:

[im1] = shaCorr(ima,0.016,1.4,0.0,6,3,2,0.3,0.7);

Third image, black river:

[im3] = shaCorr(imc,0.03,0.0,0.75,6,3,2,0.3,0.7);

Note that both the illumination  is corrected but also the contrast is increased.

For more information, please read the paper or contact me!

The paper

  • Improved Illumination Correction that Preserves Medium Sized Objects.
    A. Hast, A. Marchetti.
    Machine GRAPHICS & VISION, Vol. 23, no.1/2, Journal. pp. 3-20. 2014. pdf
   author = {Hast, Anders and Marchetti, Andrea},
   institution = {Uppsala University, Division of Visual Information and Interaction},
   journal = {Machine Graphics & Vision},
   number = {1/2},
   pages = {3--20},
   title = {Improved illumination correction that preserves medium sized objects},
   volume = {23},
   year = {2014}

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s