Many different descriptions of retinex methods of lightness computation exist. This paper provides concise MATLAB implementations of two of the spatial techniques of making pixel comparisons. The code is presented along with test results on several images and a discussion of the results. The paper also discusses the calibration of input images and the post-retinex processing required to display the output images.
Brian Funt, Florian Ciurea, John McCann, "Retinex in Matlab" in Proc. IS&T 8th Color and Imaging Conf., 2000, pp 112 - 121, https://doi.org/10.2352/CIC.2000.8.1.art00022