-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate colour differences of Smits (1999) recovered spectral power distributions. #196
Comments
I will dive back into that shortly after our Machado (2010) CVD simulation implementation is in proper working order as I wanted to implement Meng, Simon and Hanika (2015) which is highly related to Smits (1999) as per #182. I have restored a fully working Matlab version of Smits (1999) here: https://github.com/colour-science/smits1999 and would like to take that opportunity to thanks Brian for his contribution. |
Much appreciated. |
On this note, how well are the modules tested? Could there be a |
I don't think so as the code is very well tested (we are even testing for nan, infinity support for most of the functions where it makes sense) and I'm fairly sure that all the relevant modules (with definitions) have a |
That's reassuring. :) |
Allright! The problem is happening even before any chromatic adaptation steps as the tristimulus values of original and recovered spd are already not matching perfectly:
It is actually probably related to the interpolation we are doing, let me explain: Smits (1999) base spds are provided with the following shape: print(colour.SMITS_1999_SPDS['White'].shape)
(380.0, 720.0, 37.7777) Notice the bins / steps size: 37.7777 (which actually tend to infinity) Our CIE 1931 2 Degree Standard Observer CMFS have the following shape: print(colour.CMFS['CIE 1931 2 Degree Standard Observer'].shape)
(360, 830, 1) In order to perform the products before the integrals (summation) in Now it is unfortunate but Smits (1999) base spds cannot be zeros filled properly against the CIE 1931 2 Degree Standard Observer CMFS because of the steps size. As a result I'm aligning the resulting spd to CIE 1931 2 Degree Standard Observer shape which slightly alter its quality as you cannot get the exact same curve. I took that opportunity to raise an exception in Now that being said I found some other issues related to fractional numbers and the way we retrieve the related wavelength values. |
I might have found a typo: Why is the 3rd element of the 2nd tuple |
Thanks for fixing Looking at some function implementations, I also have the impression, that CMFS usage might not be consistent. Some functions allow it to be specified, some use a hard-wired CMFS (e.g. I've seen the 1931 2° observer used hard-wired, and not by a default-argument definition). Is it possible and if yes, is there any safeguard against or warning for using them in a non-matching way? Could this also contribute to the problem? |
Good catch, it is a typo, although without apparent consequences as the main purpose of |
Do you have an example where it is the case? Usually if you can't pass an arbitrary CMFS, it is because the algorithm / method was based on a very specific one.
There is nothing like that, it's either the CMFS usage is bound to one specific or open to any. |
IIRC, it was some plotting/displaying function. I saw it somewhere 1 or 2 days ago, but when writing about it, I couldn't find it. If I stumble upon it again, I'll make a note. |
Allright! Let me know, I have a related old issue: #25 It is quite a complex subject, for example can you use a colourspace the same way with the 2 degrees and 10 degrees observers? Would you change the primaries accordingly as the white point is changed? How would you compute the new primaries as most of the RGB colourspaces don't have associated primaries spds? Etc... |
It is kind of unfortunate but Smits (1999) Matlab Code doesn't produce the same basis functions than the paper, they are slightly different and as a result exacerbate the colour discrepancies. |
Found one in
Huhh, and one would think that scientists strive to be precise...can't believe what anyone says these days... :D |
Ah yes! Ohno (2010) specifically uses the CIE 1931 2 Degree Standard Observer CMFS, I'm not sure it is something you can change without having to tweak some other factors, hence the fact it is not exposed as a parameter. I could ask Yoshi about it actually.
It is maybe some discrepancies in Matlab itself too, a case of bitrot. |
I did not think of that. :) Every day a new lesson. :) |
It is maybe not that but without Brian help it will prove to be tough to know where it's coming from, I had to find online various deprecated Matlab functions to have his code working again. The two first generated curves (White and Cyan) match but the remaining ones don't. |
This discussion is related to @henczati comment: #191 (comment)
Our implementation currently suffers from small discrepancies in regard to the original colour as seen in this IPython notebook: http://nbviewer.ipython.org/github/colour-science/colour-website/blob/master/ipython/about_reflectance_recovery.ipynb
I suspect it is related to the 1nm interpolation we are doing but it is of high interest for @henczati to find out the reason.
The text was updated successfully, but these errors were encountered: