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
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.