Research on RGB to CIELab Color Space Conversion Algorithm Based on Local Polynomial Method

- Oct 25, 2018-

Research on RGB to CIELab Color Space Conversion Algorithm Based on Local Polynomial Method

We are a big printing company in Shenzhen China . We offer all book publications, hardcover book printing, papercover book printing, hardcover notebook, sprial book printing, saddle stiching book printing, booklet printing,packaging box, calendars, all kinds of PVC, product brochures, notes, Children's book, stickers, all kinds of special paper color printing products, game cardand so on.

For more information please visit 

http://www.joyful-printing.com.   ENG only    

http://www.joyful-printing.net 

http://www.joyful-printing.org

email: info@joyful-printing.net


Color reproduction and reproduction depend on various hardware devices, such as monitors, printers, etc., but the characteristics of these hardware devices cannot be identical, so that even for the same type of device, if the same color value (such as RGB, CMYK) is input, its display Or the effect of printing is also inconsistent, even far from each other. In order to achieve color reproduction consistency on different hardware devices, color management techniques based on device-independent space have emerged. As shown in Figure 1, the device-related space (such as RGB, CMY) is converted to a device-independent space (such as CIELab), and then the device-independent space is converted to the device-related space. Therefore, the core content of color management technology is the conversion of color space. Traditional mathematical methods such as interpolation and polynomial regression have been widely used in practice and achieved good results. In this paper, a local polynomial method different from the above two methods is used to realize the conversion from RGB to CIELab color space, and compared with polynomial regression method (20 items). The experimental results show that the model has high conversion accuracy and can provide reference for scientific research.


First, based on local polynomial RGB to CIELab color space conversion algorithm


1. Algorithm principle

In subgraph (a) of Figure 2, there are 512 points in the RGB space, which are neatly arranged into a large cube. However, if the CIELab values corresponding to these points are obtained in Photoshop software and displayed in the CIELab space, as shown in sub-picture (b) of Figure 2, the distribution of points is not a large cube, but an irregular shape. . Therefore, there is a nonlinear relationship between RGB and CIELab space.

(a) RGB space (b) CIELab space


In order to approximate the nonlinear relationship between the two, this paper uses the local polynomial method. It is characterized by dividing the source space, that is, dividing the large color space into several sub-color spaces, and then performing polynomial regression on the color space conversion in the sub-color space. The traditional polynomial regression method is to convert directly in the large color space, which will cause large errors in some areas of the space, because the nonlinear relationship of some regions is so obvious that it is difficult to approximate with a global method. Therefore, if the source color space is first divided, then the polynomial regression method is used in the subspace to realize the spatial transformation, which can better approximate the nonlinear relationship between the two color spaces and improve the conversion precision.


The local polynomial method can be divided into two steps: First, the source color space needs to be segmented, the modeling points are obtained, and a lookup table is established. If the level of the segmentation is higher, the smaller the volume of the divided subspace, the higher the conversion accuracy, but at the same time the amount of calculation increases. Secondly, the polynomial regression method is used in the subspace to realize spatial transformation. First, the polynomial coefficients are solved by using the color values of the subspace grid points (RGB, CIELab), and then the color values of the points to be converted in the target space are obtained according to the obtained coefficients.


2. Implementation steps

2.1 Create a lookup table

Firstly, this paper performs 8 levels of uniform partitioning on RGB space to obtain 512 modeling points (n-level segmentation, there are n3 modeling points), that is, equally spaced sampling on R, G, B channels, respectively. The spacing is 36, and the sampling points are 0, 36, 72, 108, 144, 180, 216, 255, respectively, as shown in sub-figure (a) of Figure 3. Secondly, in order to better verify the error of the model, it is necessary to eliminate the occurrence of other errors, such as the measurement error of the experimental data. Therefore, this article does not use the measuring instrument to read the experimental data, but directly obtains the RGB values of 512 modeling points and the corresponding CIELab values in the Photoshop panel of Photoshop.


(a) 8-level uniform division of RGB space (b) 8 grid points of subspace

Figure 3 8-level uniform division of RGB space and 8 grid points of its subspace


2.2 looking for subspace

Since the source space has been divided into 8 levels, 343 subspaces are formed (n-level division, there are (n-1) 3 subspaces), as shown in subgraph (a) of FIG. For a color point to be converted, if the point is a modeling point, the corresponding CIELab value is directly output according to the lookup table. If it is a non-modeling point, use its RGB value to find the subspace in which the point is located in the RGB three-dimensional space, as shown in sub-picture (b) of Figure 3, and then extract the RGB of the 8 grid points of the subspace. And the CIELab value, ready to do polynomial regression, solve the polynomial coefficients.


For example, for an RGB value (33, 144, 200) to be converted (the point is a non-modeling point), the RGB values of the 8 grid points in the subspace are (0, 108, 180). 0,108,216) (0,144,180), (0,144,216), (36,108,180), (36,108,216), (36,144,216). Since these grid points are modeling points, the corresponding CIELab values can be found in the lookup table. After determining the RGB and CIELab values of these grid points by looking up the table, you can prepare for the next step to solve the polynomial coefficients corresponding to this subspace, and each subspace has a unique corresponding polynomial coefficient.


2.3 Find the polynomial coefficient of the subspace

Polynomial regression requires that the number of items should be less than the number of modeling points. When solving the coefficients of the subspace, since only 8 grid points of the subspace are used as modeling points, only 7 polynomials can be used, as shown in equations (1), (2), and (3).


Where: R, G, B, L, A, B are the R, G, B, L, a, b values of the subspace grid points; respectively, and the polynomials corresponding to the L, a, b values respectively coefficient.


For example, in the solution process, the RGB and L values of the first to eighth grid points of the subspace should be substituted into equation (1), and eight equations can be obtained, which are then obtained by Gaussian elimination. Similarly, the RGB, a value, RGB, and b values of the eight grid points are substituted into the equations (2) and (3), respectively, and the sum can be obtained. For example, for a color point with an RGB value of (33, 44, 200), the polynomial coefficient corresponding to the subspace in which it is located is as shown in equations (4), (5), and (6).


2.4 seeking CIELab value

After obtaining and then, the RGB values of the color points are substituted into the equations (1), (2), and (3), and the CIELab value of the point is solved. For example, the RGB value is also the color point of (33, 44, 200), and R=33, G=44, and B=200 are sequentially substituted into the equation (4), equation (5), and equation (6) where the coefficient is known. , you can find L = 56, A = -15, B = -38, respectively, to achieve RGB to CIELab space conversion.


Second, the experimental results and analysis


1. Accuracy test

In this paper, the RGB color space is divided into six levels to obtain 216 test points. The RGB values of these color points and the corresponding CIELab values are also obtained in Photoshop, and then the data is used to verify the accuracy of the model.


2. Analysis of results

In the process of verifying the accuracy of the model, this paper also uses polynomial regression method (20 items) to compare with it. The experimental results are shown in Table 1. Obviously, the local polynomial method is much better than the polynomial regression method (20 items), regardless of the maximum color difference, minimum error, and average error of the conversion.

Table 1 Comparison of experimental results of the two methods


In addition, the error distribution of the two methods is shown in Figure 4 and Figure 5. For the 216 test points, the local polynomial method is used. The number of errors between 0 and 1 is about 150, which is nearly 70%, and most of the errors are between 0 and 2. If polynomial regression is used (20 items) The error is mainly distributed between 1 and 5, and a small number of points are distributed between 7 and 9, and the distribution is not ideal. Therefore, the local polynomial method is a method with high conversion precision.


Third, the conclusion


In this paper, the RGB to CIELab color space conversion is implemented by the local polynomial method, and compared with the polynomial regression method (20 items). The experimental results show that the local polynomial method is a highly accurate conversion method and is superior to the polynomial regression method (20 items). At the same time, if the conversion accuracy is further improved and the error distribution is better improved, the modeling data can be divided by 8 or more or non-uniformly divided, or a nonlinear function can be introduced in the polynomial to better approximate the two colors. A nonlinear relationship between spaces.

You Might Also Like