Measuring Perceived Color Difference Using YIQ Color Space
Total Page:16
File Type:pdf, Size:1020Kb
Programación Matemática y Software (2010) Vol. 2. No 2. ISSN: 2007-3283 Recibido: 17 de Agosto de 2010 Aceptado: 25 de Noviembre de 2010 Publicado en línea: 30 de Diciembre de 2010 Measuring perceived color difference using YIQ NTSC transmission color space in mobile applications Yuriy Kotsarenko, Fernando Ramos TECNOLOGICO DE DE MONTERREY, CAMPUS CUERNAVACA. Resumen: En este trabajo varias fórmulas están introducidas que permiten calcular la medir la diferencia entre colores de forma perceptible, utilizando el espacio de colores YIQ. Las formulas clásicas y sus derivados que utilizan los espacios CIELAB y CIELUV requieren muchas transformaciones aritméticas de valores entrantes definidos comúnmente con los componentes de rojo, verde y azul, y por lo tanto son muy pesadas para su implementación en dispositivos móviles. Las fórmulas alternativas propuestas en este trabajo basadas en espacio de colores YIQ son sencillas y se calculan rápidamente, incluso en tiempo real. La comparación está incluida en este trabajo entre las formulas clásicas y las propuestas utilizando dos diferentes grupos de experimentos. El primer grupo de experimentos se enfoca en evaluar la diferencia perceptible utilizando diferentes fórmulas, mientras el segundo grupo de experimentos permite determinar el desempeño de cada una de las fórmulas para determinar su velocidad cuando se procesan imágenes. Los resultados experimentales indican que las formulas propuestas en este trabajo son muy cercanas en términos perceptibles a las de CIELAB y CIELUV, pero son significativamente más rápidas, lo que los hace buenos candidatos para la medición de las diferencias de colores en dispositivos móviles y aplicaciones en tiempo real. Abstract: An alternative color difference formulas are presented for measuring the perceived difference between two color samples defined in YIQ color space. The classical color difference formulas such as CIELAB, CIELUV and their derivatives require many arithmetic transformations of the input values commonly given using red, green and blue components, making these formulas cumbersome to implement on mobile devices. The alternative formulas based on YIQ color space presented in this work are lightweight and can be quickly calculated, even in real-time. The comparison is made between the newly introduced formulas and the classical ones using two different sets of experiments. The first set of experiments is focused on evaluating the perceived difference of colors using different formulas for picking colors. The second set of experiments allows benchmarking of the color difference formulas to evaluate their performance when processing images. The experimental results show that the newly introduced formulas are close in perceived terms to CIELAB and CIELUV but are significantly faster, making them good candidates for measuring color difference on mobile devices and applications even in real-time. KEYWORDS: COLOR DIFFERENCE, COLOR METRIC, YIQ, PERCEPTUAL UNIFORMITY, COLOR SPACE 28 Yuriy Kotsarenko, Fernando Ramos Introduction There are many applications where two or This fact led to the development of more more colors need to be compared for some perceptually uniform color spaces described purpose. The examples of such applications later on in this work. In addition, not all colors include but are not limited to stereo vision visible to human eye can be modeled by the algorithms, recognition algorithms used in RGB color space [1]. The RGB color space surveillance, textile industry and image itself can be defined in many ways depending processing. As the number of mobile devices on the three chosen primaries making the is growing, there is an increasing range of space dependent on the particularly used devices, each with unique set of processing device. In the context of this work, the values capabilities. In the typical software of RGB color space are specified according applications running on the aforementioned to sRGB standard described in Rec. 709 [2]. systems the colors are usually defined by In an informal article “Colour Metric” their respective red, green and blue values, posted on CompuPhase web site on Internet also called RGB color space. A comparison [3], Thiadmer Riemersma suggested a of two sample colors usually involves variation to the equation (1), which calculating the distance or difference apparently gives better results in perceptual between them. If the sample colors have their terms and justifies it by the fact that the respective coordinates specified as modification is used in their products such as ( r , g , b ) and ( r , g , b ), then the 1 1 1 2 2 2 EGI, AniSprite and PaletteMaker. The difference between the two colors can be proposed modification is the following: calculated as: r 2 2 255 r 2 Eri 2 r 4 g 2 b 2 2 2 256 256 (2) E r r g g b b (1) rgb 2 1 2 1 2 1 E r 2 g 2 b 2 (1.1) rgb where r r1 r 2 2 and r1, g1, b1, r2, g2 The values of , , and , , are and b2 values are given in the range of [0, specified in the range of [0, 1]. In some 255]. According to Thiadmer Riemersma, the performance critical applications, the square formula was derived from several tests using 2 a program which displayed 64 colors palette root is omitted and the value of Ergb is and a sample color, that user had to match to used instead. an existing color on the palette; in addition, The equation (1.1) is both easy to the program also suggested a matching color implement and fast to compute. However, the depending on one of the available color arbitrary variations of values in RGB space difference equations. are not perceived as uniform by human eye. Measuring perceived color difference using YIQ NTSC transmission color space in mobile applications 29 The equation (2) has an elegant form the equation (4) are specified according to and can actually accept integer values for Rec. 709 standard [7], but other RGB components – a good point for mobile specifications exist [2]. applications, but it lacks experimental data to The CIE 1931 XYZ color space is justify the selection of weight coefficients and primarily used for specifying other the program used by the author to deduce perceptually uniform color spaces. One of the equation (2) displayed a very limited such color spaces that is also considered a palette to the users, making the reliability of CIE standard - the CIE 1976 L*, a*, b* the proposed formula inconclusive. (CIELAB) color space, which can encompass A color space that can encompass all all the colors visible to human eye and is the colors visible to the human eye has been somewhat perceptually uniform [2], [9]. The proposed - the CIE 1931 XYZ color space, coordinates in CIELAB color space can be which is considered to be CIE standard. The calculated from CIE XYZ values as the selection of XYZ functions and the following [2], [4]: development of the color space were Y described by J. Schanda [4]. The coordinates * 116 fL 16 (5) Y specified in RGB color space can be n transformed to CIE XYZ as the following [2], X Y * 500 fa f (6) [5]: X Y n n X .0 412453 .0 357580 .0 180423 r * Y Z Y .0 212671 .0 715160 .0 072169 g (3) 200 fb f (7) Z .0 019334 .0 119193 .0 950227 b Yn Z n where X, Y and Z are the new coordinates in t 31 , t 6 29 3 2 CIE XYZ color space and r, g and b are the tf 1 29 4 (8) t , otherwise linear RGB coordinates [5], [6]. The 3 6 29 transformation from non-linear r , g and b where f(t) is a temporary transform function, coordinates to their linear counterparts is Xn, Yn, and Zn are the coordinates of the made by applying gamma correction [2], [6]: particular white point used in the calculations. According to Rec. 709 [5] the white point D65 1 VsRGB VsRGB .00, 03928 has the coordinates of X =0.9505, Y =1 and 12.92 n n L 4.2 (4) V sRGB .0 055 Zn=1.0891 (calculated from their x and y .0, 03928 VsRGB 1 .1 055 coordinates of 0.3127 and 0.329 respectively on the CIE chromaticity diagram [1], [6], [7] where VsRGB should be replaced by the [9]). The values of a* and b* can vary in [- r , g and b values to obtain the linear 100, 100] range for typical images, while the values of r, g and b. The coefficients used in value of L* is usually defined in the range of 30 Yuriy Kotsarenko, Fernando Ramos [0, 100]. The color difference between a pair The simplified equation using the of two samples can therefore be calculated aforementioned cylindrical values of C* and as: h* according to J. Schanda [4] is the following: * * 2 * 2 * 2 (9) ELab L a b 2 2 2 (15) ELCH LCH There are many color difference formulas derived from CIELAB color difference (for The equations (9), (10) and (15) represent instance, several variants are measured in the human perception of colors more closely [10]) and in many cases they can be (unless CIELAB is not really perceptually generalized to the following form [10], [11]: uniform [9]) and they provide a way of calculating color differences for all colors that 2 2 2 L C * H * * Egen R (10) can be seen by human eye (as opposed to kLL S kCC S kHH S RGB-based color difference formulas where R according to M. R. Luo, G. Cui described earlier). However, they require and B. Rigg [11] is an interactive term three transformations from original RGB between chroma and hue differences (in coordinates to CIELAB and equation (15) many variants it is set to zero [10]), kL, kC, requires further transformation of the and kH are parameters given by the user that coordinates to cylindrical coordinate system, according to M.