8.
Advanced Tutorial
8.1
Modify the Identification Color
8.1.1.
Lab Colour Space
The default color of color identification gameplay is the blue, change the
parameter in the program to modify the default color. Usually, the
color space we use is RGB color, which color display is based on a
mixture of three original color red, green and blue.
L component means the brightness of the pixel. The greater the L value,
the higher the brightness is.
A component means the range from red to green.
B component means the range from yellow to blue.
In OpenCV, the range of values of R, G, and B in the RGB colour space
is [0-255], but the range of L values in the Lab colour space is [0-100]. L
value 0 means black; in contrast, L value 0 means white. The range of a
and b values are [127, -128]. Both a and b value are 0 mean grey.
Image 8-1 Common Color Corresponding Lab Value