Color difference calculation metric

Color difference calculation metric

1. CIE L * function

The CIE equation that maps relative brightness (Y / Yn) to brightness (L ∗) consists of two independent functions f () and g ()

 

 

 

 

 These two functions are at ϵ, which I call the intersection. Two constants κ, ϵ CIE standard provides:

 

 

 You can see this interruption by close-up the connection point of the two functions. In the animation below, f () is drawn in blue and g () is drawn in red. When we zoom in on the connection point, the discontinuity becomes apparent:

 

 

 It can be seen that the function is not only discontinuous, but also non-monotonic, which makes it irreversible in this area. What about the slope at the junction? We can compare them with the first derivative.

 

 

 Replacing again shows that the slope at the connection point also does not match:

 

 

 If we want to find the correction constant 

, If both function and slope continuity are provided, the function and its first derivative must be matched at the junction:

 

 

 After transformation

 

 

 Find constants to show that their values ​​can be accurately expressed with rational numbers:

 

 

 Using these values ​​instead of the published CIE values ​​can provide a perfect function and slope continuity at the connection point:

 

 

 CIE decided to express these constants as decimal values, which is an unnecessary approximation and introduces functions and slope discontinuities.

If you check the conversion of the CIE equation between XYZ and Lab, you will find the constant 7.787. By extending the above analysis to these equations, you will find that the exact value of this constant is a rational number.

By using the above values, the function discontinuities, non-monotonicity, inversion failures, and slope discontinuities that exist in the published CIE conversions between XYZ, Lab, LCHab, Luv, and LCHuv will be fixed.

2. Color difference calculation

Color difference is the difference between two colors. In general, under certain conditions, the human eye can easily distinguish whether the two color samples are different. In practical applications, especially in engineering calculations, this difference needs to be quantified by a mathematical formula, that is, the color difference formula. The calculation of chromatic aberration is an important subject of color science. It has a development history of more than 80 years.

 

It is not a simple matter to establish a color difference calculation formula. First, a model is needed to describe color. The most widely used is the CIE1931-XYZ standard chromaticity system.

CIE1931-XYZ (CIE: International Commission on Illumination) is the chromaticity system recommended by CIE in 1931. Most color measurement and calculations use this system. However, the tristimulus values ​​or chromaticity coordinates used in this system model have no direct correspondence with the color perception, and they are not uniform. You can refer to Figure 1 to see that on the CIE1931xy chromaticity diagram, the green area changes greatly , The human eye can distinguish the difference between the two colors (large circle), but in the blue-violet area, small changes can cause visual differences (small circle). Therefore, CIE1931-XYZ cannot be used to calculate color difference. Therefore, finding a uniform color space and then describing the color difference has become an important research direction for people in this field.

 

  

Figure 1 MacAdam [1] ellipse (picture source: reference [2] )

 

CIE1976LAB: Since 1931, experts have proposed dozens of uniform color spaces. Before 1976, CIE recommended CIE1960UCS and CIEWUV respectively, but they were not ideal. Until 1976, CIE recommended the CIE LAB color space to everyone, with good visual uniformity and a good description of color difference. The conversion relationship between this model and the CIEXYZ chromaticity system is as follows:

 

 

 X n , Y n , Z n are the tristimulus values ​​of the illuminating body. In the CIELAB color space, the definition of chroma and hueangle is as follows:

 

 

 Note: This is also called CIEL * C * h * or CIELCH color space.

Therefore, the definition of the color difference formula in the CIELAB color space is:

 

 

 Attentive readers may find that this is the Euclidean distance in three-dimensional space, yes, the definition of the color difference of the CIELAB color space is the European distance of the two colors in the CIELAB color space. This formula has been used to this day, and is still the preferred color difference formula for many companies in the image-related field, although CIE has been "strongly recommend" CIEDE2000.

However, the CIELAB color space is not so perfect!

In the CIELAB color space, the color difference is the Euclidean distance of the two color coordinate points, which means that as long as the distance is the same, no matter which color area is in, no matter what the direction of color change, the color difference should be the same. The actual situation is that CIELAB is not completely uniform, the color of different areas, different directions, the changes are not consistent. The actual area of ​​the same color difference is not a sphere, but an ellipsoid! Therefore, most of the subsequent improvement of the color difference formulas are based on CIELAB, and make an article on this ellipsoid, such as CMC ( l: c ).

CMC ( l: c ) ( CMC: British Color Measurement Commissioner) color difference formula is based on CIELAB with some corrections. The specific formula is as follows:

 

 In the formula, the textile industry sets the values ​​of l and c to l = 2, c = 1, S L , S C , and S H are the correction coefficients of brightness, saturation, and hue angle, respectively.

 

 After correction, each round sphere in the CIELAB color space (the two-dimensional plane is a circle) becomes a series of ellipsoids (ovals), as shown in Figure 2.

 

 

  

Figure 2 CMC ( l: c ) color difference ellipse

 

The CIE94 color difference formula is similar to CMC, and it is also a modification of the CIELAB color difference formula. The difference is that the correction coefficients are different. The CIE94 color difference formula and the correction coefficient are as follows:

 

 Regardless of CMC or CIE94, no new color space is proposed, but for CIELAB color difference formulas, some correction coefficients are added to brightness, chroma, and hue, respectively. The basic structure of color difference formulas is similar or even the same. This structure is also the standard form used by many color difference formulas. The calculation of CIE94 is relatively simple and has been recognized by some application scenarios, but the improvement effect of this formula is not ideal.

CIEDE2000 : In 2001, based on the evaluation of a large number of color difference samples and a large number of visual experiments, CIE officially recommended the CIE DE2000 color difference formula to everyone. The formula and correction factor are as follows:

 

 

 CIEDE2000 is now the main color difference formula promoted by CIE. In fact, everyone should use this color difference formula as much as possible. If everyone's previous database is CIELAB, as long as the original LAB chromaticity data is retained, it can be recalculated using the CIE2000 formula.

The figure below is a common color difference chart used to test color accuracy. The ellipse in the picture is 4 times the CIEDE2000 unit ellipse. With the aid of the ellipse, you can estimate the deviation of color reproduction and the difference in visual perception.

 

 

  

Figure 3 CIEDE2000 ellipse (images are generated with Imatest software, please refer to [4] for parameters in the figure)

 

The above four color difference formulas can be seen in some common color and image software. But in fact, the color difference formula is far more than that. Since the establishment of the CIE1931 chromaticity system, there have been dozens of color difference formulas. The following is a simple list of several representative formulas.

Adams-Nickerson formula ( 1942 )

This formula is a correction to the unevenness of the CIEXYZ color space. The VX, VY, and VZ in the following formula are transformed from CIEXYZ.

 

 

 Hunter formula ( 1948 )

The color difference calculation of this formula is similar to the CIE1976 formula, but the calculation method of the chromaticity value LAB is different from that of CIELAB.

 

 

 The definition of XYZ in the formula is the same as CIEXYZ, and the LAB in this formula is also called Hunter-LAB.

 

CIELUV formula (1976)

CIELUV is a color space of almost the same period as CIELAB. Due to the characteristics of its u'v ' calculation method, it has been widely used in light sources, displays and other fields. The calculation method and color difference formula of CIELUV color space are as follows:

 

 

Guess you like

Origin www.cnblogs.com/wujianming-110117/p/12684958.html