Digital Image Processing (Minimal) Chapter 2 Color Model (docx)

Suggested prerequisites: advanced mathematics (calculus), linear algebra.
Bibliography:
1. Image Engineering (Volume 1)-Image Processing (4th Edition) Zhang Yujin Tsinghua University Press


Link: https://pan.baidu.com/s/1tpHBX2sWtu0oHrLF9fW_IQ
extraction code: 0000

Two-color model

In order to express and use color information correctly and effectively, it is necessary to establish a color model to describe and reproduce the color of an image.
There are 4 commonly used color models: RGB, CMYK, HIS, LAB. The first two are device-oriented color models, and the latter two are color perception-oriented color models.

The RGB model is based on the principle of bionics. There are three types of cells in the human retina, which are sensitive to the three colors of red, green, and blue (the most sensitive to green). By superimposing these three colors of light, most of the colors that can be seen by the naked eye can be mixed.
The RGB model is the most widely used color model. Very suitable for use in output display occasions, such as monitors and projectors. RGB models are also commonly used in digital cameras, broadcast and film cameras, and image processing software. The three colors of red, green and blue are represented by three channels, and the image processing software sometimes adds an Alpha channel to portray transparency.

All color images can be divided into three gray-scale images according to channels, and they are processed in the same way as gray-scale images.

The color model used in the color TV system is also based on different combinations of RGB.
The YIQ color system is usually adopted by North American television systems (NTSC system). The Y value represents the brightness component, I corresponds to the color between orange and cyan, and Q corresponds to the color between green and purple. The correspondence between RGB and YIQ is as follows:
█(&[█(Y@I@Q)]=[■(0.299&0.587&[email protected]&-0.274&[email protected]&-0.523&0.312) ][█(R@G@B)]@&[█(R@G@B)]=[■(1&0.956&0.621@1&-0.272&-0.647@1&-1.106&-1.703)][█ (Y@I@Q)]) The
YUV color system is adopted by European television systems (PAL system), where Y is the same as Y in the above YIQ color system, representing the luminance component, U and V representing the chrominance component, and The calculation methods for I and Q are similar, but not exactly the same. The correspondence between RGB and YUV is as follows:
█(&[█(Y@U@V)]=[■(0.299&0.587&[email protected]&-0.289&[email protected]&-0.515&-0.100 )][█(R@G@B)]@&[█(R@G@B)]=[■(1&0&1.14@1&-0.395&-0.581@1&2.032&0)][█(Y@U @V)])
China’s TV also uses the PAL system.
The YCbCr color system is derived from the YUV color system. Commonly found in consumer video products such as DVDs, camcorders, and digital TVs. Among them, Y still refers to the brightness component, while Cb and Cr are obtained by slightly adjusting U and V. The correspondence between RGB and YCbCr is as follows:
█(&[█(Y@C_b@C_r@1)]=[■(0.2990&0.5870&0.1140&[email protected]&-0.3313&0.5000&[email protected]&-0.4187&-0.0813&128@0&0&0&1)][█( R@G@B@1)]@&[█(R@G@B)]=[■(1&1.4020&0@1&-0.3441&-0.7141@1&1.7720&0)][█(Y@C_b-128@ C_r-128)]) The
color resolution of the human eye is much lower than the brightness resolution, so the use of these RGB model variants is conducive to image and video compression. In video compression, a total of 4 pixels of 2×2 are often shared with the same color.

The CMYK color system is a mode used for printing, which refers to Cyan, Magenta, Yellow and Black.
The CMYK mode is essentially the same as the RGB color mode, but the principle of color generation is different. RGB color synthesis is through color addition. CMYK produces other colors through color subtraction.
There is no one-to-one conversion between RGB and CMYK, and the conversion process will be related to monitor settings, printing ink settings, and color separation settings.
When processing images, CMYK mode is generally not used. Because: ①The image file of this mode occupies a larger storage space; ②The color gamut is much smaller than RGB.

The device-oriented color model has a certain distance from human visual perception, so it is not convenient to use. For example, when describing a color, it is difficult for people to describe the R, G, and B components. People always start from their own visual perception habits and use brightness, hue and saturation to describe a color. For example: dark red, light blue, light gray, etc.
Brightness represents the degree of lightness and darkness caused by a certain color in human vision. It is determined by the intensity (energy) of the light: the greater the light intensity, the brighter the scene; the lower the light intensity, the darker the scene. For grayscale images, brightness is the grayscale value of the image.
Hue (hue) represents the color of light and is determined by the wavelength of light. For example, the seven colors of light in nature correspond to different tones, and each tone corresponds to a different wavelength. In normal use, the hue is identified by the color name, such as red, orange, or green.
Saturation refers to the purity (brightness) of the color, which is determined by the ratio of the pure spectral color of the dominant wavelength to the white light. The closer to the spectral color, the smaller the proportion of white light, the higher the saturation, and the brighter and more vivid the color; Far, the greater the proportion of white light, the lower the saturation, the more dull and dull the color, and the less vivid. For white light, its color saturation is 0 (no color); the color saturation of a pure color is 100%, which means that the color does not contain white light.

The HIS color model is the most intuitive method of color description. Use Hue, Saturation and Intensity to describe colors. It is very close to human visual perception of color, but is independent of the device.
This model has two characteristics: the I component has nothing to do with the color information of the image; second, the H and S components are closely connected with the way people perceive colors. These characteristics make the HSI model more in line with human visual characteristics than the RGB color space, and it is very suitable for image processing algorithms that use human visual system to perceive color characteristics.
HIS and RGB conversion formula:
RGB→HSI:
I=1/3 (R+G+B)
S=1-3/(R+G+B) [min⁡(R,G,B)]
H=arccos (((RG)+(RB))/2)/√((RG)^2+(RB)(GB) ), R≠G or R≠B
H=2π-arccos (((RG)+(RB ))/2)/√((RG)^2+(RB)(GB) ), B>G
HSI→RGB:
█(&B=I(1-S), R=I[1+Scos⁡H/ cos⁡(60^∘-H) ], G=3I-(B+R), H∈[0°,120°]@&R=I(1-S), G=I[1+Scos⁡(H -120^∘ )/cos⁡(180^∘-H) ], B=3I-(R+G), H∈[120°,240°]@&G=I(1-S), B=I[ 1+Scos⁡(H-240^∘ )/cos⁡(300^∘-H) ], R=3I-(G+B), H∈[240°,360°])

The LAB color model is a standard language that can describe color sensations, and can use mathematical methods to uniquely and precisely define the sensations produced by color stimuli.
L represents brightness, A gives all colors from red to green, and B gives all colors from yellow to blue. This model covers all the visible light spectrum.
The model has nothing to do with the device (only exists in math/software). No direct display format is provided, and it must be converted to other color spaces for display.

Unlike RGB and CMYK color spaces, Lab colors are designed to approximate human vision. It is dedicated to perceiving uniformity, and its L component closely matches human brightness perception. Therefore, it can be used to make accurate color balance by modifying the output levels of the a and b components, or use the L component to adjust the brightness contrast. These transformations are difficult or impossible in RGB or CMYK-they are modeled on the output of physical devices, rather than human visual perception.
Because the Lab space is larger than the color gamut of computer screens, printers, and even human vision, a bitmap expressed as Lab requires more data per pixel than RGB or CMYK bitmaps to obtain the same accuracy. In the 1990s, computer hardware and software at this time were usually limited to storing and manipulating 8-bit/channel bitmaps, and the conversion from RGB image to Lab back and forth was a lossy operation. For now common 16-bit/channel support, this is not a problem.
In addition, many "colors" in the Lab space are beyond the horizon of human vision, so they are purely imaginary; these "colors" cannot be reproduced in the physical world. Through color management software, such as those built into image editing applications, you can select the closest approximation in the color gamut, and change the brightness, chroma and even hue during processing. Dan Margulis (famous color correction and photo reproduction expert) said that it is useful to use imaginary colors between the multiple steps of image manipulation.
When the image processing software converts the RGB model to the CMYK model, it first converts it to the LAB model, and then converts the LAB model to the CMYK model to reduce the loss in the conversion process.

Guess you like

Origin blog.csdn.net/COFACTOR/article/details/109854159