Color constancy

Introduction

Color constancy is the ability of the human visual system that ensures the perception of the color of objects to remain relatively constant under varying illumination conditions. In achieving computational color constancy it is necessary first to estimate the scene illumination and then to perform the chromatic adaptation, which adjusts the scene colors so that they look as they would under a desired illumination (mostly daylight). If it is assumed that the scene illumination is uniform, then the global illumination can be estimated for the whole scene. However, if this is not the case, then the illumination has to be estimated locally.

Here we offer the source code for ten color constnacy algorithms: seven that estimats the global illumination, and three that estimate the illuminiation locally and also perform local brightness adjustment (they can also be used for tone mapping, with one of them (Color Badger) specifically designed for that purpose). Additionally, we offer the source code of a brightness adjustment method. The code available here is research code and is therefore only of prototype quality.

The links to the papers that describe all these methods are available together with their brief descriptions that follow. Additionally, they are also available at this website and they can be found at the bottom of this page.

Color Sparrow

The Color Sparrow algorithm is essentially a derivative of the Random Sprays Retinex, but it is nevertheless as fast as other well-known global illumination estimation algorithms. It is explained in detail in the 2nd Croatian Computer Vision Workshop paper "Using the Random Sprays Retinex algorithm for global illumination estimation", and which can be downloaded here.

Light Random Sprays Retinex

The Light Random Sprays Retinex algorithm is an extension and improvement of the Random Sprays Retinex algorithm, which allows a much lower execution time and higher resulting image quality. It is explained in detail in the IEEE Signal Processing Letters paper "Light Random Sprays Retinex: Exploiting the Noisy Illumination Estimation", which can be downloaded here. Both the the C++ source code and an HTML + JavaScript demonstration are available at the bottom of the page.

Improved White Patch

The Improved White Patch algorithm is an improvement of the White Patch algorithm by means of image pixel sampling. It is of greater accuracy but still of the same speed as the White Patch algorithm. The paper in which it is explained in detail was presented at ICIP 2014 and it can be downloaded here.

Color Rabbit

The Color Rabbit algorithm is essentially a modification and a more accurate upgrade of the Color Sparrow algorithm. It is explained in detail in the DSP 2014 paper "Color Rabbit: Guiding the Distance of Local Maximums in Illumination Estimation", which can be downloaded here.

Color Badger

The Color Badger algorithm is an extension and improvement of the Light Random Sprays Retinex (LRSR) algorithm intended to overcome LRSR's weaknesses in tone mapping. Additionally, it can also be used as a local white balancing algorithm. It is explained in detail in the ICISP 2014 paper "Color Badger: A Novel Retinex-based Local Tone Mapping Operator", which can be downloaded here. The OpenCV C++ implementation of the TMQI that was used in the testing is also available.

Color Cat

The Color Cat algorithm is a learning-based algorithm that uses color distribution to perform illumination estimation. It is explained in detail in the IEEE Signal Processing Letters paper "Color Cat: Remebering Colors for Illuminiation Estimation", which can be downloaded here.

Smart Color Cat

The Smart Color Cat algorithm is a learning-based algorithm that represents the upgrade of the Color Cat algorithm. It uses simpler features and it can be trained and tested significantly faster. The paper "Using the red chromaticity for illumination estimation" which describes it has been accepted for publication as part of ISPA 2015.

Color Dog

The Color Dog algorithm is a learning-based algorithm that alters the illumination estimation of other methods by using the information available from the illumination chromaticity distribution. Even though relatively simple, the method outperforms most other methods on any kind of images. It is explained in detail in the VISAPP paper "Color Dog: Guiding the Global Illumination Estimation to Better Accuracy" which is about to be published.

Color Ant

The Color Ant algorithm is a relatively simple learning-based algorithm that uses the k-NN algorithm in its core to perform illumination estimation. The paper "Using the red chromaticity for illumination estimation" which describes it has been accepted for publication as part of ISPA 2015.

Firefly

The Firefly is a brightness adjustment algorithm designed to be very fast, suitable for hardware implementation, and to produce high-quality results. The paper which describes it has been accepted for publication as part of ICIP 2015. Both the the C++ source code and an HTML + JavaScript demonstration are available at the bottom of the page.

Smart Light Random Memory Sprays Retinex

Smart Light Random Memory Sprays Retinex is an image enhancing program local brightness adjustment and color correction. It is relatively fast and it produces images of high quality. It is based on the Light Random Sprays Retinex algorithm, but many of its flaws and weaknesses are fixed. The paper which describes has been accepted for publication in the Journal of the Optical Society of America A. Both the the C++ source code and an HTML + JavaScript demonstration are available at the bottom of the page.

Puma

The Puma algorithm is a tone mapping operator based on an adjusted version Naka-Rushton equation and the Smart Light Random Sprays Retinex algorithm. It is explained in detail in the EUSIPCO 2016 paper "Puma: A High-Quality Retinex-Based Tone Mapping Operator".


Publications

Software implementations source code