How to estimate and apply color correction matrix using a 24 block color card?

后端 未结 2 707
无人及你
无人及你 2021-01-16 02:10

I have a 24 block color card and I\'m trying to estimate a color correction matrix to the captured images with the said color card. I have manually estimated a CCM

相关标签:
2条回答
  • 2021-01-16 02:42

    color correction model you are using is well described here:

    https://www.informatik.hu-berlin.de/de/forschung/gebiete/viscom/thesis/final/Studienarbeit_Behringer_201308.pdf

    This can also be done in c++ opencv. You have to determine equation:

     [p1' p2' ... pn' ] = M * [ p1 p2 ... pn]
             P'         = M *        P
    

    Where p1',...pn' are desired values (better if in XYZ color space), p1, ... pn are real values detected and M is 3x3 transformation matrix.

    You could solve that system as follows:

    M = P * P'.inv(CV_SVD)
    
    0 讨论(0)
  • 2021-01-16 02:44

    The RGB samples used in the optimization should be linear. Undo gamma correction first by calling rgb2lin on the image.

    You will also need to apply the CCM on linear RGB values. So undo the gamma correction in your image with rgb2lin, apply the CCM, and then re-apply gamma correction with lin2rgb.

    0 讨论(0)
提交回复
热议问题