Source: Baidu Library
Generally the image of the color space is effectively processed in the HSV space, and then for the basic color corresponding to the HSV component needs to be given a strict range, the following is the experimental calculation of the fuzzy range (the exact range is not given on the Internet).
h:0-180
s:0-255
v:0-255
This part of red is classified as a purple range:
There are many types of color space in the field of computer vision. HSL and HSV are two of the most common color models for cylindrical coordinates, which re-allude to the RGB model, making it visually more visually intuitive than the RGB model.
HSV Color Space
The model of the HSV (hue,saturation,value) color space corresponds to a conical subset in the cylindrical coordinate system, and the top face of the cone corresponds to v=1. It contains r=1,g=1,b=1 three polygons in the RGB model, which represents a lighter color. The color h is given by the rotation angle around the V-axis. The red corresponds to the angle 0°, the green corresponds to the angle 120°, the blue corresponds to the angle 240°. In the HSV color model, each color differs from its complement by 180 °. Saturation s takes values from 0 to 1, so the radius of the top of the cone is 1. The Color field represented by the HSV color model is a subset of the CIE chromaticity graph, with a saturation of 100% in the model, which is generally less than 100% in purity. At the apex of the cone (that is, the origin), v=0,h and s are undefined and represent black. The top of the cone is s=0,v=1,h undefined at the center of the face, representing white. From this point to the origin represents the dimmed gray of the brightness, which is gray with different shades of gray. For these points, the value of s=0,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 of the cone, V=1,s=1, is a solid color. The HSV model corresponds to the painter's method of color matching. The painter uses the method of changing the color concentration and the color depth to obtain the color of different tones from a solid color, adding white in a solid color to change the color concentration, adding black to change the color depth, and adding different proportions of white, Black can obtain a variety of different shades.
HSI Color Space
The HSI color space is based on the human visual system, using Hue (hue), color saturation (saturation or chroma) and brightness (intensity or brightness) to describe the color. The HSI color space can be described by a cone-space model. It is quite complex to describe the cone model of his color space, but the change of hue, brightness and color saturation can be clearly demonstrated. Hue and saturation are commonly referred to as Chroma, which is used to indicate the type and depth of color. Because people's visual sensitivity to brightness is far stronger than the sensitivity of the color shade, in order to facilitate color processing and recognition, the human visual system is often used in the HSI color space, it more than the RGB color space in line with human visual characteristics. In image processing and computer vision, a large number of algorithms can be easily used in the HSI color space, they can be processed separately and independent of each other. Therefore, in the HSI color space can greatly simplify the image analysis and processing workload. The HSI color space and the RGB color space are just different representations of the same physical quantity, so there is a transformation relationship between them.
The HSI color model is based on the human visual system, using H to represent Hue (hue), S for saturation (saturation) and I for luminance (Intensity) to describe color. Saturation is just inversely proportional to the Baiguang of the color, which can be said to be an indicator of the color's sharpness or not. Therefore, if we use his model on the display to process the image, we will be able to achieve a more realistic effect.
Hue: Refers to the wavelength at which an object conducts or reflects. More commonly, it is identified by color such as red, orange or green, measured by a value of 0-360 degrees.
Saturation (saturation): Also known as Chroma, refers to the intensity or purity of the color. Saturation represents the ratio of gray to hue and is measured in 0% (gray) to 100% (full saturation).
Brightness (Intensity): refers to the relative brightness of a color, usually measured as a percentage of 0% (black) to 100% (white).
HSL stands for Hue (hue), saturation (saturation), and brightness (lightness), often also known as HLS. The HSV represents the hue, saturation, and value of the color (value). Note that the meaning of the two H of HSL and HSV is the same, and the definition of saturation is different, although it is called saturation, which can be seen from the following definition.
HSL and HSV both describe the color in the cylinder body point, the center axis of the cylinder is from the bottom of the black to the top of the white and in between them is gray, the angle around the axis corresponds to "hue", the distance to the axis corresponds to "saturation", and the distance along this axis corresponds to "brightness", "hue" or "Lightness". The HSV encapsulates information about colors in a way that is more familiar to humans: "What color is this?" How shallow. How light and dark. ”。 The HSL color space is similar to HSV, in some ways even better than it is. The HSL model is a double cone shape.
These two representations are similar in purpose, but differ in method. Both are mathematically cylindrical, but the HSV (hue, saturation, lightness) can conceptually be regarded as the inverted cone of color (black dots at the bottom of the vertex, white on the center of the top), HSL conceptually represents a double cone and sphere (white at the top vertex, black at the bottom vertex, and the center of the largest cross-sectional is a half-way gray The HSV model was founded in 1978 by Elvira Lei Smith. The following figure shows a cylindrical model of HSL and HSV.
On a cone, the angle represents the hue h, and the saturation s represents the distance from the point to the center vertical line, while the luminance or value V is represented by a central vertical line. The red angle is 0 degrees, followed by yellow, green, cyan, blue, and orange. The angle of two successive colors is 60 degrees.