1 2 3
4 5 6
7 8 9
10 11 12

feedforward algorithm

          The mean of the light from natural scenes is supposed to bear an information about colour of the illuminant. In such an assumption one of the simplest algorithm of discounting the illumination using the space-averaged signals from retinal cones might look as follows.
XiR = SR ·riR
XiG = SG ·riG
XiB = SB ·riB
(1) log XiR = log SR + logriR
(2) yR = 1/N ·S log XiRCR = log SR + 1/N ·S logriRCR
Under the gray world assumption, the middle term in (2) is stable in different scenes, and the constant CR in the algorithm have to be fixed to compensate it. Then the average, yR, will estimate the light source: yR = log SR
(3) ziR = log XiRyR = log SR + logriR – log SR = logriR
(4) ZiR = exp( ziR ) = riR