LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Color Temperature Calculation with Optic Sensor

Solved!
Go to solution

Hi ,

Would like to know if any one has worked on color temperature

and CIE XYZ calculation with optical CCD devices.

I could capture wavelength and Intensity only from the sensor.

 

Sundar. 

Message 1 of 17
(9,635 Views)

I know this might not be terribly helpful but I often do these calculations - all I need is CALIBRATED data (watts at wavelength) which I then feed into a colleague's DLL (written in VB.net I think) and out comes the relevant CCT, Color Rendering Indices, and XYZ. Unfortunately, I don't have permission to share these files.

 

The underling calculations themselves are not all that difficult and could be put into LV with some effort. I may do this for an exercise anyway. Most of the information needed can be found online - two sources came up for me in a quick search:

 

http://www.cis.rit.edu/mcsl/online/cie.php

http://www.brucelindbloom.com/index.html?Equations.html

 

If you end up having to do this your self please feel free to post your calibrated data and I can check it against the code I use - this code has been unofficially checked with our ANSI certified lab and should be pretty much correct.

 

-Jolt

0 Kudos
Message 2 of 17
(9,585 Views)

Since I said it would be a good exercise I decided to try it. Not as straight forward as I thought...

 

Basically, data you get from a CCD device must be calibrated to a known lamp. This data then represents "energy." However, the CCD device might have arbitrary wavelength spacing and almost certainly doesn't line up with the Xbar, Ybar, Zbar tables from ANSI (2degree CIE).

 

You can do some data manipulation to resampling and match the tables but you have to be very careful not to change the energy picture.

 

These data are then feed into the very a simple sum-product equations given in the previous links and forced to X+Y+Z=1.

 

I was not able to spend much time on this so the code is UGLY. Sorry.

 

I'll continue this exercise next week for CCT, Rendering Indices, and Lumen calculations.

 

Fun Stuff!

-Jolt

Download All
Message 3 of 17
(9,575 Views)

Thanks Jolt,

That has been quite usefull.Managed to get this info .

However stuck with Calculation of black body locus distance.

Do let know if you have any information on this one .

 

Sundar. 

0 Kudos
Message 4 of 17
(9,545 Views)

Hello Sundar,

 

My understanding is that you can get OK approximations from a couple of expressions and from Robertson's method. However, it is better in the long run to do a binary optimization function, basically using Planck's Law, iterating for the lowest Delta_uv.

 

This iteration method also gives you CCT because you have just found the closest reference body.

 

Again, I'm working through this exercise too - I hope to have something that is not too embarrassing to post soon...

 

Thanks,

-Jeff

 

 

 

 

0 Kudos
Message 5 of 17
(9,522 Views)

Sundar,

 

I'm attaching my code in its current form, Let me know if this helps!

 

The last part (I hope!) will be obtaining the color rendering indices.

 

Take Care,

-Jolt

Message 6 of 17
(9,505 Views)

Hey Jolt,

Appriciate for the wonderful effort.

I guess this should solve my problem.

Just trying to incorporate these into my code. 

 

Sundar. 

0 Kudos
Message 7 of 17
(9,479 Views)

Is it possible to calculate planckian distance with only (u,v) ??

if not , what other  params are required .

 

Sundar. 

0 Kudos
Message 8 of 17
(9,469 Views)

Hello Sundar, Glad to hear this is moving forward for you. I have updated my code to reflect pretty much all relevant calculations. PLEASE DISREGARD ALL OLD CODE POSTED ABOVE - it is messy and not optimized! (Obviously I was trying to figure this out myself as a went along.)

 

Unfortunately, I do not have great documentation (like written equations) to explain everything that was done here. Much of this was adapted from very thorough work compiled by a colleague of mine and has been verified to be accurate. Some steps should be easily to follow - some, like the color rendering calculations, are probably not so easy. Please let me know if you really need the math and science behind this - laying it all out will be a good exercise for me but I'm not sure I will get to it...

 

To attempt to answer your specific question: you will need CCT to get Delta u,v. You can get estimated CCT from your sample u,v using relatively simple equations. The link below is a pretty good article on some of these and offers a new equation to add to the list.

 

http://www.usna.edu/Users/oceano/raylee/papers/RLee_AO_CCTpaper.pdf

 

From CCT you then calculate the planckian radiator and use these u.v, coordinates to calculate Delta u,v. As stated before, many consider it better to do an iterative optimization where you create a starting point (CCT) and find Delta u,v. Then move your starting CCT and recalculate. Iterate as many times as you feel it is necessary to find the best CCT. This then gives you the Planckian and your Delta u,v (already calculated as part of the last iteration). Please note that the equations I was working from use reciprocal micro-units for CCT.

 

Please also note that I saved these for 8.0 - in 8.6 I used a couple of feedback nodes that I guess don't back-save. This make things a little messy but hopefully still readable.

 

Enjoy!

-Jolt

0 Kudos
Message 9 of 17
(9,461 Views)

Could you repost the latest zip archive.

there seems be some error in opening this file .

 

Sundar.

0 Kudos
Message 10 of 17
(9,429 Views)