This a matlab code to perform an auto white balance to an image based in the energy of each channel