WhiteBalance

Module used for white balancing adaptation of a color image. Given a reference image area and a target color, for example a white part of the input image and the color coordinates for white, applies von Kries adaptation to the image. This will transform the reference area the target color and simultaneously change the color coordinates for all other pixels in the image. The image region for the reference color is given by x0, y0, x1, and y1 and the color of the reference region is given by red_target, green_target and blue_target. In addition, the average color of an arbitrary region can be written to the output, This region is set by the log-parameters.

Example XML definition

A simple example

  <module
      class = "WhiteBalance"
      name = "WhiteBalance"
  />

Parameters

NameDescriptionTypeDefault
classThe class name for the module; must be "WhiteBalance".string
nameThe name of this instance of the module.string
red_targetCoordinate for the red channel of the target colorfloat255
green_targetCoordinate for the green channel of the target colorfloat255
blue_targetCoordinate for the blue channel of the target colorfloat255
x0Left coordinate for the reference region (inclusive)int10
x1Top coordinate for the reference region (exclusive)int10
y0Right coordinate for the reference region (inclusive)int20
y1Bottom coordinate for the reference region (exclusive)int20
log_x0Left coordinate for the logged region (inclusive)int0
log_x1Top coordinate for the logged region (exclusive)int0
log_y0Right coordinate for the logged region (inclusive)int0
log_y1Bottom coordinate for the logged region (exclusive)int0

Module Connections

Inputs

NameDescription
INPUT0The first input
INPUT1The second input
INPUT2The third input

Outputs

NameDescription
OUTPUT0The output
OUTPUT1The output
OUTPUT2The output

Limitations

The reference region can only be set in the XML-file and can not change during execution. This should be changed in the future with either an adaptive white calcuation or an attention based method.

References

von Kries, J. (1902) Chromatic adaptation. In MacAdam, D. L. (Ed.) Sources of color vision, 109-119, Cambridge, MA: MIT Press.

Balkenius, C., Johansson, A. J, and Balkenius, A. (2003). Color constancy in visual scene perception. Lund University Cognitive Studies, 98.

Author

Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science

Files

WhiteBalance.h
WhiteBalance.cc
WhiteBalance.ikc

blog comments powered by Disqus