|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
How can I convert spectral data to CIE XYZ components?
I calculate definite integral of spectrum multiplying spectrum values CIE
1931 color matching functions and then divide X, Y, Z -integrals with
(X+Y+Z). Then I calculate chromaticity coordinates from XYZ components and
compare these chromaticity coordinates to real chromaticity coordinates of
spectral data what I use to test code. My code gives wrong results and I
like to know what I do wrong.
I got spectral data with calculated chromaticity coordinates here:
http://www.cs.utah.edu/~bes/graphics/spectra/
And here is the critical part of code. cie_x, cie_y, cie_z and spectrum are
all natural splines.
---
#declare WaveLength = StartWaveLength;
#while (WaveLength <= EndWaveLength)
#declare X = X + cie_x(WaveLength) * spectrum(WaveLength);
#declare Y = Y + cie_y(WaveLength) * spectrum(WaveLength);
#declare Z = Z + cie_z(WaveLength) * spectrum(WaveLength);
* spectrum(WaveLength);
#declare WaveLength = WaveLength + 1;
#end
#declare xyz = X.x + Y.x + Z.x;
#declare X = X / xyz;
#declare Y = y / xyz;
#declare Z = Z / xyz;
---
Matti
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Matti:
> How can I convert spectral data to CIE XYZ components?
:) ...use CIE.inc by Ive, included with my lighting system:
http://www.ignorancia.org/t_lightsys.php
> I calculate definite integral of spectrum multiplying spectrum values
> CIE 1931 color matching functions and then divide X, Y, Z -integrals
> with(X+Y+Z). Then I calculate chromaticity coordinates from XYZ
> components and compare these chromaticity coordinates to real
> chromaticity coordinates of spectral data what I use to test code. My
> code gives wrong results and I like to know what I do wrong.
I'm not the expert (Ive done all this implementation himself), but I
think that taking a look at CIE.inc can give you some clues. The current
published version is not still 100% accurate, but I can send you a beta
for the next version, wich is almost 99'9% accurate. It will be very
nice to know your opinion on it...
Regards.
--
Jaime Vives Piqueres
La Persistencia de la Ignorancia
http://www.ignorancia.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 26 Mar 2003 10:22:42 +0100, Jaime Vives Piqueres
<jai### [at] ignoranciaorg> wrote:
> not still 100% accurate, (...)
> wich is almost 99'9% accurate
which still means not still 100% accurate ;-)
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sat, 29 Mar 2003 07:14:47 EST
"Matti Karnaattu" <nomail@nomail> wrote:
> BTW I also write similar include files but I like to make Pov-Ray to
> render images how human eye see things.. Lightning is real bitch to do
> right.
Lighting, like anything highly related to color, is a really difcult
matter... but very funny to research and experiment. ;)
--
Jaime Vives Piqueres
La Persistencia de la Ignorancia
http://www.ignorancia.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |