Retinex algorithm implementation

落花浮王杯 提交于 2019-12-03 22:15:17
dajuric

Look at: http://www.fer.unizg.hr/ipg/resources/color_constancy

These algorithms are modifications of the Retinex algorithm (with speed improvement) although the author gave them funny names :)

There is a full source code (C++, but it is written very nicely).

Sorry for necro-posting, but it seems that there's a mistake in step 3 of your procedure that can mislead someone passing by.

In order to apply the correction, you want to divide source image by Gauss-filtered copy of it, not the Gaussian kernel itself. Approximately, in pseudo-code:

I_filtered(x,y) = G(x,y) * I(x,y)
I'(x,y) = log(I(x,y) / I_filtered(x,y))

And then apply casting of I'(x,y) to required numeric type (uint8, as I can refer from original post).

More on that topic can be found in this paper:

Ri(x, y) = log(Ii(x, y)) − log(Ii(x, y) ∗ F(x, y))

where Ii is the input image on the i-th color channel, Ri is the retinex output image on the i-th channel and F is the normalized surround function. .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!