POV-Ray : Newsgroups : povray.advanced-users : Spectral data -> XYZ Server Time
29 Jul 2024 04:21:03 EDT (-0400)
  Spectral data -> XYZ (Message 1 to 4 of 4)  
From: Matti Karnaattu
Subject: Spectral data -> XYZ
Date: 25 Mar 2003 19:20:04
Message: <web.3e80f0b531078484bef0bd7d0@news.povray.org>
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

From: Jaime Vives Piqueres
Subject: Re: Spectral data -> XYZ
Date: 26 Mar 2003 04:22:43
Message: <20030326102242.390b82f5.jaimevives@ignorancia.org>
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

From: ABX
Subject: Re: Spectral data -> XYZ
Date: 26 Mar 2003 04:37:45
Message: <81t28vcr5k6fgedgv1kju35ech1nmoc34f@4ax.com>
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

From: Jaime Vives Piqueres
Subject: Re: Spectral data -> XYZ
Date: 30 Mar 2003 05:35:14
Message: <20030330123515.5737cbd8.jaimevives@ignorancia.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.