1. Know colors

The nitrogen in our DNA, the calcium in our teeth, the iron in our blood, the carbon in the food we eat, all came from the millions of stars that were scattered in the Big Bang, so we are all stars. — Carl Sagan

In our impression, the stars are gorgeous, beautiful, boundless, but I do not know you have not thought, you really know and understand the story behind the brilliant colors of the stars?

What is color?

As shown in the figure, color corresponds to the visible band of electromagnetic wave, which is the wavelength information processed after the post processing. Color is the objective attribute of the object — the determined wavelength, and the subjective attribute of the brain — different individuals are sensitive to the electromagnetic wave of specific wavelength, and the color they experience is also different.

2 Describe colors

In order to represent color, coordinate models of one, two, three and even four dimensional Space have been established. These color models are called Colour Space. Introduce common colour space below.

2.1 RGB color space

RGB color space based on the theory of three primary colors: there are three types of cones, the retina contains respectively for red, green, blue three kinds of light sensitive visual pigment, when a certain wavelengths of light on the retina, with certain proportion makes three kinds of cones respectively produce different degree of excitement, such information to the brain center to produce the feeling of a kind of color.

In RGB mode, the three components of the channel vector represent the color intensity of,, and the three color channels respectively. ,, and are equivalent to the three orthogonal bases of color space. As shown in the figure, a variety of complicated colors can be mixed and adjusted by the proportion of,, and.

The advantages of RGB color models are:

  • Easy to understand;
  • It is easy to realize by hardware. Modern display screen is generally based on RGB model.
  • Introduced bit resolution (color depth), which refers to the number of bits per color component in a pixel. The bit resolution determines the color level, such as an 8-bit color depth, where each color component has 256 possibilities.

The disadvantage of the RGB color model is that all three components are used to represent hue, that is, if the value of a component is changed, the color of the pixel will change. In color positioning and other projects, the USE of RGB model should consider,, and three variables at the same time, which is relatively complex.

2.2 HSV color space

HSV color space is closer to people’s perception experience of color than RGB, and it intuitively expresses the hue, brightness and shade of color.

In HSV mode, the channel vector is composed of three parts:

  1. Hue: Refers to the appearance and characteristics of a color. In a waveform, a specific wavelength corresponds to a Hue.
  2. Saturation refers to the brightness of colors, representing a change from rational (gray) to emotional (pure color).
  3. Value, Brightness: Indicates the amount of light transmitted to a color. Unlike Lightness, which specifically refers to the concentration diluted by white light, the highlight of any color tends to be white, but each high brightness color is different.

Because HSV can deal with tonal value alone, without affecting brightness and saturation; Or change the brightness and saturation alone without affecting the color itself. Therefore, IN image processing, HSV is often used for color location tracking and color histogram extraction.

The disadvantage of the HSV model is that there is currently little hardware support and conversion from RGB or other color Spaces is required.

2.3 Lab Color Space

The Lab color space is designed based on people’s perception of colors and has Perceptual uniformity, meaning that if parameters L, A and B change in the same amplitude, people’s visual variation is similar.

In Lab mode, the channel vector is composed of three parts:

  1. Intensity (Lightness)
  2. A Color component: represents the component from green to red
  3. B Color component: represents the component from blue to yellow

Lab is also easy to adjust – adjust brightness only by focusing on channels L and color balance only by focusing on channels A and B. In addition, Lab also has a wide gamut, equipment independent and other properties.

3 Digital imaging

In digital imaging, the device is sensitized by the image sensor as shown in the figure and converted to a certain intensity value. This process is called image digitization, and the basic unit of digital image is called Pixel.

If digital imaging equipment only uses image sensor, the color information of illumination cannot be obtained, that is, only gray image can be generated. In order to obtain color images, Bayer Filter is introduced. The core principle of Bayer Filter is to obtain image color information by filtering down sampling, and restore color images by interpolation, correction and other algorithms.

Specifically, a filter layer is placed in front of the image sensor, which is filled with dots corresponding to the lower pixels. These dots are arranged in a sequence of 2×2 color blocks, called the Bayer array. Each filter spot can only pass through one of,, and — the lower pixel can only be,, or NULL. Thus, the device has completed the collection of original color information after image downsampling.

4 Digital imaging examples

For a color digital image, it is usually represented as a 3 – dimensional matrix. Among them

  • Indicates the width of the picture;
  • Denotes the height of the picture;
  • Represents the number of channels of the picture;
  • It describes the resolution of the image — the total number of pixels it contains;

It describes the color represented by pixels, usually a vector. It can describe different color Spaces by giving different meanings to different dimensions, reflecting deeper details of the picture.


Computer vision basics tutorial outline

The chapter content

Color space and digital imaging

Fundamentals of computer geometry

2. Image enhancement, filtering, pyramid

3. Image feature extraction

4. Image feature description

5. Image feature matching

6 Stereovision

7 Actual Project

Welcome to my AI channel “AI Technology Club”.