0
$\begingroup$

How can I calculate the color temperature(CCT) of the light source illuminating a given raw image correctly?

The method I used is proposed by McCamy, and the algorithm was also described in the Wikipedia. The problem is that I don't know whether should I apply white balance process before calculating CCT.

If it should not, how do I get the conversion matrix that convert the current device-dependent RGB color space to CIE XYZ to calculate the algorithm correctly?

$\endgroup$
0
$\begingroup$

The problem is that I don't know whether should I apply white balance process before calculating CCT.

Definitely not. Afterwards, the light source would have a completely different color profile, depending on how you implement white balance, and hence, a different color temperature.

If it should not, how do I get the conversion matrix that convert the current device-dependent RGB color space to CIE XYZ to calculate the algorithm correctly?

Get the color profile (which might be much more complex than a simple matrix) of your device; usually, that means getting the ICC file for your camera/scanner/sensor, and applying that to convert your image from the device color space to something canonical.

If your camera/scanner/sensor doesn't have such a profile, you will need to calibrate it first.

$\endgroup$
  • $\begingroup$ Thanks for the answer! Unfortunately, I'm the developer of the camera... so I need to find the solution by myself. And I don't know the "normal way" that used by the other developers. Please give me some hints to calibrate the data. >< $\endgroup$ – W. Lee Feb 21 '16 at 12:07
  • $\begingroup$ Well... read up on color calibration, then :) Basically, you can order calibrated color sheets, use a light source of known color temperature and calibrate the camera yourself, creating a color profile on the go. With that, you're definitely leaving the scope of dsp.SE; I'd recommend asking on the photography stackexchange sites; pretty sure there's someone out there who actually has done this before :) $\endgroup$ – Marcus Müller Feb 21 '16 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.