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 XiR – CR = log SR + 1/N ·S logriR – CR
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 XiR – yR = log SR + logriR – log SR = logriR
…
(4) ZiR = exp( ziR ) = riR
…