当前位置:网站首页>[CV basis] Color: rgb/hsv/lab

[CV basis] Color: rgb/hsv/lab

2022-06-11 10:47:00 Koma_ zhe

RGB Color space

RGB In mode , The three components of the channel vector represent R 、G 、B The color intensity of the three color channels .R 、G 、B Equivalent to three orthogonal bases of color space . The difference in color is through R 、G 、B To mix and adjust a variety of complex colors .

RGB Color model benefits

  • Easy to understand ;
  • It is convenient for hardware implementation , Modern displays are generally based on RGB Model
  • Introduce bit resolution ( Color depth ), Refers to... In a pixel , Number of bits per color component . Bit resolution determines the color level , for example 8 Bit color depth , Each color component has 256 Maybe .

RGB Disadvantages of color models

  • All three components are used to represent hue , That is, if you change the value of a component , The color of this pixel changes .
  • In color positioning and other projects , Use RGB The model should consider R 、G 、B Three variables , More complicated .

HSV Color space

HSV Color space ratio RGB Closer to people's perception of color , Very intuitive expression of color tone 、 Brightness and shade .

stay HSV In mode , Channel vector C It consists of three parts

  • tonal 、 Hue (Hue): Refers to the appearance and characteristics of color , In the waveform, a specific wavelength corresponds to a hue .
  • saturation (Saturation): Refers to the degree of bright color , Present a rational ( Grayscale ) To sensibility ( Pure color ) The change of .
  • Lightness (Value, Brightness): Refers to the light transmission of a certain color . And brightness (Lightness) Different , Brightness refers specifically to the concentration diluted by white light , The highlight of any color tends to be white , But each color is different .

 Insert picture description here

HSV advantage :
The hue value can be processed separately , Without affecting lightness and saturation ; Or change the brightness alone 、 Saturation without affecting the color itself , Therefore, in image processing ,HSV Commonly used for color location tracking 、 Extract color histogram, etc .
HSV shortcoming :
Currently, there is little hardware support , Need from RGB Or other color space .

Lab Color space

Lab Design based on people's feeling of color , With perceptual uniformity (Perceptual Uniform), That is, if the parameter L、a、b The range of change is the same , The range of changes in human vision is also similar .

stay Lab In mode , Channel vector C It consists of three parts

  • brightness (Lightness)
  • a Color component : Represents the component from green to red
  • b Color component : From blue to yellow

 Insert picture description here

Lab advantage :
It's also easy to adjust , Adjust the brightness only by paying attention to L passageway , Adjust the color balance only by paying attention to a and b passageway .
Lab It also has a wide color gamut 、 Equipment independent and other properties .

In the practical application of computer vision :

For a color digital picture , It is usually expressed as a W × H × C Of 3 D matrix . among W Represents the width of the picture ; H Represents the height of the picture ; C Indicates the number of channels in the picture ;
W × H It describes the resolution of the picture —— Indicates the total number of pixels contained in the image ;C Describes the color represented by pixels

原网站

版权声明
本文为[Koma_ zhe]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111016508885.html