What's new

Math Help Needed!

Steve Mariotti

Kavapithecus Krunkarensis
Review Maestro
Method:
- Ingest massive quantities of Pouni Ono
- Shift chromaticity curve so that the white point is the origin.
- Convert the shifted chromaticity curve to polar coordinates
- Convert the experimental xy(Y) point to the same shifted polar coordinates
- Step up the angle until it is between two angles of the chroma curve
- Linear interpolation between the 2 points found that way

Source is up. I'll get an executable release out tomorrow. Blerg.
Wow. You made that data your bitch, huh?
 

Steve Mariotti

Kavapithecus Krunkarensis
Review Maestro
Man, miss a day and everything gets done!

I went back and added interpolation of color matching function results, and I'm getting more accurate output now:

Noble:
Color Point: (0.4112, 0.4338)
WhitePt: (0.3333, 0.3333)
DomWavelen: 574.95 nm

Tudei:
Color Point: (0.5149, 0.4562)
WhitePt: (0.3333, 0.3333)
DomWavelen: 582.81 nm

The goal with my code has been to write it so simply that it can be ported to any language, including embedded platforms like Arduino, and to require no additional libraries or external dependencies. I have some work to do to abstract a few of my C++-isms away into wrapper functions, but when I'm done, I should have a source base that can be migrated anywhere if need be. Even on the damn spectrometer if it's programmable. :)
 

verticity

I'm interested in things
The goal with my code has been to write it so simply that it can be ported to any language, including embedded platforms like Arduino, and to require no additional libraries or external dependencies. I have some work to do to abstract a few of my C++-isms away into wrapper functions, but when I'm done, I should have a source base that can be migrated anywhere if need be. Even on the damn spectrometer if it's programmable. :)
That would be very cool (and useful) to implement it on something like an Arduino or Raspberry Pi: One can envision a hand-held spectrometer for spot checks in the field...
 

verticity

I'm interested in things
So I wanted to share this: a way to possibly make the algo even simpler.
I had found the attached article, about measuring the color of spaghetti. I'm completely serious. The author noticed that the region of the chromaticity curve between 550 and 600 nm is pretty much exactly a straight line, so developed a simple analytical formula for dom WL based on that fact.

So I did some plots, to see for myself. Here is the chroma curve:
1931chroma_Judd_and_Vos_1978.jpg


Then zoomed in in that region, and shown with a linear regression fit line:

1931chroma_Judd_and_Vos_1978_closeup.jpg


That's pretty darn linear, except for a little curvature at the blue end. (That little curvature can actually be taken care of with a quadratic fit...)

I think it would be worth looking into the accuracy of doing it this way.
 

Attachments

verticity

I'm interested in things
@verticity - Great find, a very interesting article. I notice they are using an xy of 0.3103, 0.3163 which is Illuminant C, a now obsolete standard for daylight that was in use when the article was written. I'm assuming they chose it because their application was reflective rather than transmissive. Your zoomed graph doesn't quite have room for Illuminant E, is that what you are using with this method?
Well, I'm not actually using this method, it's just an idea. I just wanted to illustrate how straight the line is. The linear regression parameters in my picture are independent of the illuminant, they are just fitting the chromaticity curve. Obviously if I tried this I would use Illum E, with my own linear fit, rather than the literal formula from the paper, which is pretty old. I'm not sure if this would work as well for the complementary WL as it is more curvey on the other side
 

Steve Mariotti

Kavapithecus Krunkarensis
Review Maestro
That's brilliant.

And that's really the range we're talking about anyways, right? And really from like 530 on up, there's not a whole lot of curvature.
 

Mat Allan

Newbie
Hi Guys,
I'm wondering if there is a final version of this code available. I'm trying to calculate dom. wavelength from XYZ.
Cheers,
Mat
 
Top