Image color recognition theory in machine vision

Generally, the effective processing of the color space image is performed in the HSV space, and then a strict range needs to be given to the corresponding HSV component in the basic color. The following is the fuzzy range calculated through experiments (the exact range is not available on the Internet Given).

H: 0 — 180

S: 0 — 255

V: 0 — 255
Here, part of the red is classified as the purple range:
Insert picture description here
Insert picture description here

At present, there are many types of color spaces in the field of computer vision. HSL and HSV are the two most common color models represented by cylindrical coordinates, which re-map the RGB model, which can be visually more intuitive than the RGB model.

HSV color space

The HSV (hue, saturation, value) color space model corresponds to a cone-shaped subset in the cylindrical coordinate system, and the top surface of the cone corresponds to V=1. It contains R=1, G=1 in the RGB model, B=1 Three faces, the colors represented are brighter. The color H is given by the rotation angle around the V axis. Red corresponds to an angle of 0°, green corresponds to an angle of 120°, and blue corresponds to an angle of 240°. In the HSV color model, each color differs by 180° from its complementary color. The saturation S takes a value from 0 to 1, so the radius of the top surface of the cone is 1. The color gamut represented by the HSV color model is a subset of the CIE chromaticity diagram. In this model, a color with a saturation of 100% has a purity generally less than 100%. At the apex (or origin) of the cone, V=0, H and S are undefined and represent black. At the center of the top surface of the cone, S=0, V=1, H is undefined, representing white. From this point to the origin, it represents gray with dimming brightness, that is, gray with different gray levels. For these points, S=0 and the value of H is undefined. It can be said that the V axis in the HSV model corresponds to the main diagonal in the RGB color space. The color on the circumference of the top surface of the cone, V=1, S=1, this color is a pure color. The HSV model corresponds to the painter's method of color matching. The painter uses the method of changing the color density and color depth to obtain different tones of colors from a certain pure color, adding white to a pure color to change the color density, adding black to change the color depth, and adding different proportions of white to obtain black. Various shades.

HSI color space

The HSI color space starts from the human visual system, using hue (Hue), color saturation (Saturation or Chroma) and brightness (Intensity or Brightness) to describe colors. The HSI color space can be described by a conical space model. Using this cone model to describe the HIS color space is quite complicated, but it can really express the changes in hue, brightness and color saturation very clearly. Hue and saturation are usually called chroma, which is used to indicate the type and depth of color. Since human vision is more sensitive to brightness than to color density, in order to facilitate color processing and recognition, the human visual system often uses the HSI color space, which is more in line with human visual characteristics than the RGB color space. A large number of algorithms in image processing and computer vision can be conveniently used in the HSI color space, they can be processed separately and are independent of each other. Therefore, the HSI color space can greatly simplify the workload of image analysis and processing. HSI color space and RGB color space are just different representations of the same physical quantity, so there is a conversion relationship between them.

The HSI color model starts from the human visual system, using H for Hue, S for Saturation and I for Intensity to describe colors. Saturation is just inversely proportional to the amount of white light of a color, and it can be said to be an indicator of whether the color is vivid or not. Therefore, if we use the HIS model to process images on the monitor, we will be able to get a more realistic effect.
• Hue (Hue): refers to the wavelength of the object conduction or reflection. It is more common to identify it by colors such as red, orange or green, with a value ranging from 0 to 360 degrees.
• Saturation: Also known as chroma, it refers to the intensity or purity of a color. Saturation represents the ratio of gray to hue and is measured from 0% (gray) to 100% (fully saturated).
•Intensity: refers to the relative lightness and darkness of the color, usually measured as a percentage from 0% (black) to 100% (white).

HSL stands for Hue, Saturation and Lightness, and is also commonly referred to as HLS. HSV stands for hue, saturation and value (Value). Note that the meanings of the two H in HSL and HSV are the same, but the definition of saturation is different. Although both are called saturation, the difference between the two can be seen from the following definition.
Both HSL and HSV describe the color at the point in the cylinder. The central axis of this cylinder is from black at the bottom to white at the top and gray in the middle. The angle around this axis corresponds to the "hue", The distance to this axis corresponds to "saturation", and the distance along this axis corresponds to "brightness", "hue" or "brightness". HSV encapsulates information about color in a way that is more familiar to humans: "What color is this? How light is it? How light and dark?". The HSL color space is similar to HSV and even better than it in some respects. The HSL model is a double cone shape.

Guess you like

Origin blog.csdn.net/luoyir1997/article/details/109100619