cc(色彩校正)调试相关

本文介绍了相机颜色校正模块的重要性和作用,通过3x3矩阵进行颜色校正以提高色彩保真度。讨论了线性、多项式和根多项式校正方法,并详细阐述了Chromatix工具和CcmTrain工具的调优步骤。此外,还提出了评估颜色校正性能的Delta E和椭圆工具。最后,比较了不同方法的调优效果,强调了X工具在结果上的优越性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.Introduction

The Color Correction (CC) module is used to minimize color reproduction inaccuracies and improve color fidelity. Role of the color correction block in the pipe should be to accurately transform the sensor RGB color space to device independent color space.

Due to the characteristics of optics (lens, color filters, etc.) and sensors used in the camera system, the native RGB data may not provide faithful color rendition to the human eye when the image is presented on a particular output media. Therefore, color correction is required.

In modern digital camera designs, color correction is an essential part of the color signal processing chain because it helps the system achieve higher color quality and fidelity. Typically, a 3x3 matrix (in the case of a three-color camera) is used for color correction. Color correction matrix (CCM) tuning minimizes the color reproduction inaccuracies and improves color fidelity.

The color correction parameters in the Color Correction module are in the form of 3x3 matrices.

2.Tuning methods

We have three ways to get CC matrix, including using chormatix tool, ccm code from github. Different methods have different tuning skills. The following will describe the tuning process and the theory of these methods respectively.

2.1 Theory of the methods

The basic principle is to use the ccm matrix to bring the original image closer to the target image. The built-in method of chromatix is unknown, the other two algorithms are introduced as follows.

2.2.1 X
2.2.2CCMtrain

The method is proposed in paper  “ Color Correction Using Root-Polynomial Regression”. In this paper, three methods are mainly introduced, including LCC(linear color correction), PCC(polynomial color correction), RPCC(root-polynomial color correction).

LCC has two mainly advantages. First, typical lights and surfaces interact with typical cameras as if reflectances and illuminants were well described by the 3D linear model. Another advantage of LCC is that it works correctly as scene radiance/exposure changes. Despite these benefits, LCC may produce significant errors for some surfaces. Indeed, given a linear fit from RGBs to XYZs, errors for individual surfaces can be in excess of 10 CIE ΔE (1ΔE denotes just noticeable difference, 10ΔE differences are highly visually different).

To reduce this error a simple extension to the linear approach is to use polynomial color correction (PCC). In the 2nd degree PCC each image RGB is represented by the 9-vector R G B R2 G2 B2 RG RB GB. Analogously, one can define a higher degree polynomials e.g. the 3rd degree where the RGB vector is extended to 19 elements and the 4th degree where it is extended to 34 elements. PCC can reduce the mapping error for fixed calibration settings, but if the RGB is scaled by k, the individual components of the 9-vector either scale by k or k2, it means when changing the scene radiance or exposure, the best color correction matrix must be changed.

The paper mentioned above proposes a new root polynomial color correction(PRCC), which has the undoubted power of polynomial data fitting in a way that does not depend on exposure/scene radiance.

For a given pth degree polynomial expansion, we take each term and raise it to the inverse of its degree. The unique individual terms that are left are what we use in Root-Polynomial Color Correction

2.2. Operation guide

  1. Chromatix

The chromatix tool is provided by Qualcomm, the tuning procedures are as following:

1)Download software from: Qualcomm CreatePoint.

2)Project download and load. File> open project .Select the project folder.
3)Check demosaic and CC, select CC in the Pipeline IPE to open the Color Correction window, and select Region;

4)If it is necessary to modify the standard gamma curve or to create a new gamma curve, click Edit Gamma and make the changes before tuning the color correction matrix.

 

 

5)Import the raw image into MMC, pay attention to the image size format, etc., otherwise the project cannot be recognized. And for different image size, it’s necessary to change values in xml.

6)Select Mark->color checker->Macbeth in the pop-up box, adjust the grid mark position so that it is at the center of each color block, and close the window;

 7)Click optimize;

8)Check the three diagonal values of the color correction matrix to see how they change due to optimization. A higher noise weight value produces a color correction matrix with a lower diagonal parameter. For the diagonal parameter, higher values indicate higher color saturation and increased noise. The ideal range for the highest diagonal value is 1.8 to 3.

9)Adjust the saturation and noise weights and click optimize until the highest diagonal value in the CCM is within the ideal range.Click simulate to use the new value to perform a complete simulation. If the simulated image is acceptable, proceed to the next step. If it is unacceptable, continue to repeat the optimization. Click preview to run a faster optimization;

10) After finishing the tuning, click File>Save to Project to save these settings.

  

2.2.2 Ccmtrain

The tool is downloaded on:

GitHub - QiuJueqin/color-correction-toolbox: Camera Color Correction Toolbox.

The tool can calculate the matrix of batches of images. Change the directory and run the program, then we can get CC matrix in excel.

Then change values in simulation project and get tuning images. In this code, we need to change image size and change the location of color circles correspondingly, ensuring every color block has two circles.

 

 

 

3.Preferred CC performance

3.1 Objective evaluation

3.1.1 Delta e

In chromatix, after getting output image, Select Mark->color checker->Macbeth in the pop-up box, adjust the grid mark position so that it is at the center of each color block, then click Delta E plot and select illuminant.

 

 

For different output images, the smaller the error value, the better the effect.

3.2Ellipse tool

First, we install python and related dependencies required by the code, change the directory of the input image.Run the code, select the entire color card and press enter. Finally we get ellipse image.

In the ellipse image, if the little circle is radially outward, the color is as expected.

3.3The diagonal of the CC matrix

In the document of Qualcomm, we can use the values of the diagonal elements of the matrix to evaluate CCM. The ideal range for the highest diagonal value is 1.8 to 3. But usually the results of debugging do not conform to this rule.

4. Tuning example and comparison of the methods

该段略过

4.4.2 Conclusions

      For a fair comparison, we analyze the result calculated in chromatix, and the results show :

  1. X (internal method)and CCM train have inseparable results, the output of chroamtix seems to have more saturation for red;
  2. X and CCMtrain have similar ellipse images, while X performs a little bit better, such as on yellow and green. And for the ellipse images of chromatix, it has worse performance.
  3. For CC matrixes, all of the highest diagonal values are between 1.8 to 3.

Finally, the conclusion is: the X tool gets the best results.

5.Manual tuning skills

Define CCM as:

Where c00 represents the influence of the r component on R, c01 and c02 represent the influence of the g and b components on R, respectively

Assuming that the CMOS model completely matches the human eye model, it is obviously that c00=1,c01=c02=0. In fact, the filter in the CMOS image sensor cannot completely filter out those unwanted light waves. The frequency of the light waves received by the CMOS sensor photosensitive unit is generally too wide, and the three colors are aliased, resulting in the color of the image being not bright enough.

In order to eliminate this kind of aliasing, the coefficients in CCM have a general rule. The coefficients c00, c11, and c22 are all greater than 1, and the other coefficients are all less than 0 or close to 0. The influence of G on R is greater than the influence of B on R, so the absolute value of c01 is greater than the absolute value of c02. Similarly, the absolute value of c21is greater than the absolute value of c20.

Generally, the CCM is based on the three-dimensional model of the three primary colors. Then when we want to adjust the colors that are not RGB, such as yellow, because yellow is a color formed by the fusion of red and green in equal proportions, and is right against blue and purple. If you want to modify the yellow to be redder or orange, you only need to increase the R in the b column, that is, increase c20, or decrease the G in the b column, that is, reduce c21. The specific adjustment to what extent depends on personal preference.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值