The fundamental assumption in retinex is that the observed image is a multiplication between the illumination and the true underlying reflectance of the object.
We define our retinex model in two steps: First, we look for a filtered gradient that is the solution of an optimization problem consisting of two terms: A sparsity prior of the reflectance, such as the TV or H1 norm, and a quadratic fidelity prior of the reflectance gradient with respect to the observed image gradients.
In a second step, since this filtered gradient almost certainly is not a consistent image gradient, we then look for a reflectance whose actual gradient comes close.
Beyond unifying existing models, we are able to derive entirely novel retinex formulations by using more interesting non-local versions for the sparsity and fidelity prior. Hence we define within a single framework new retinex instances particularly suited for texture-preserving shadow removal, cartoon-texture decomposition, color and hyperspectral image enhancement.
When using this code, please do cite our underlying papers:
D. Zosso, G. Tran, S. Osher, "A unifying retinex model based on non-local differential operators," IS&T / SPIE Electronic Imaging: Computational
Imaging XI, San Francisco, USA, 2013.
D. Zosso, G. Tran, S. Osher, "Non-local Retinex - A Unifying Framework and Beyond," SIAM Journal on Imaging Science (submitted).
Dominique Zosso (2019). Non-local retinex (https://www.mathworks.com/matlabcentral/fileexchange/47562-non-local-retinex), MATLAB Central File Exchange. Retrieved .