Color model talks (3)

zhaozj2021-02-11  205

RGB color model

Our eyes feel colors through three visible light of the retina. These lights reach peak at wavelengths of 630 nm (red) 530 nm (green) and 450 (blue). Through the comparison of each stimulus, we feel the color of the light. This kind of visual theory is to use red, green, and blue three primary colors to display color-based foundations called RGB color models.

Three parameters of R, G, and B are coordinates, we can get one unit cube to describe the RGB color model. Please see the picture below:

Like the XYZ model, RGB is a color model. The brightness, chrominance, and purity of the light source are mixed in three parameters of R, G, and B. According to the concept of bright light in the previous section, the brightness of the light source should be expressed as:

L = 0.3r 0.6g 0.1R

Of course, the coefficients here is just approximation, and its specific value depends on the phosphorus powder standard used by the display, the three coefficients are: 0.299, 0.587, 0.144 by NTSC video signal standards.

The purity S is: s = min (r, g, b) / max (r, g, b)

Because everyone usually used the most familiar thing is RGB, so I will say so much about it, and we will further study it again.

YIQ color model

Similarly to the XYZ color model above, we can also convert the RGB color model into brightness-chromaticity space. The YIQ color model is used in the NTSC video signal. This is a luminance-chroma model that is converted from RGB, which represents Yence the brightness of the light source, and the color is included in the I and Q two parameters. The orange-blue color information is included in the parameter i, and the color of green-built red is included. Since the human eye is greater than the sensitivity of the brightness than the sensitivity to chromaticity, we always give the maximum bandwidth to the Y signal, and since the Y signal contains a brightness signal, only the Y signal is used in black and white television. . Here is the transform formula of RGB <-> YIQ: | Y | | 0.299 0.587 0.144 | | R | | i | = | 0.596 -0.275 -0.321 |. | g | | q | 0.212 -0.528 0.311 | | B | | R | | 1.000 0.956 0.620 | | Y | | G | = | 1.000 -0.272 -0.647 |. | I | | b | | 1.000 -1.108 1.705 | | q |

Since YIQ is only used in the NTSC video signal, it is not very much for our meaning, and it will not be described in detail here.

YUV color model

There is also a color model similar to the YIQ color model is the YUV color model. The YUV color model in the computer is the most widely used color model that is second only to the RGB model. In fact, YUV is just a class of color models (YCRCB), it is a large family, with considerable storage format, generally, any YUV based on YCRCB color models can be called. YCRCB is a color model similar to YIQ, where Y is the same, the color information is also combined in Cr, CB, where CR represents the red component in the light source, and Cr represents a blue component in the light source. Therefore, its transform formula is like this: | Y | 0.299 0.587 0.114 | | R | | 0 | | CB | = | -0.1687 -0.3313 0.5 |. | g | | 0.5 | | cr | | 0.5 -0.4187 -0.0813 | | B | | 0.5 | R = Y 1.402 * (CR-0.5) g = y - 0.34414 * (CB-0.5) - 0.71414 * (CR-0.5) B = Y 1.772 * (CB-0.5) After adding 0.5, CR CB is always positive, which is convenient for us to handle.

As mentioned earlier, the human eye is greater than the sensitivity of the brightness than the sensitivity of chromaticity, so it is completely able to use the same chromaticity value, and the feeling of the human eye does not change too much, through losses Chromaticity information to achieve the purpose of saving storage space, is the basic idea of ​​YUV. Based on this, we can define a number of YUV formats, such as the two pixels use a color value of the yuyv, JPEG / MPEG, and the four pixels use a color value of YUV12 and so on.

转载请注明原文地址:https://www.9cbs.com/read-3799.html

New Post(0)