Skip to content
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

ZCAM results are slightly different from the paper #1

Open
kdrag0n opened this issue Aug 29, 2021 · 2 comments
Open

ZCAM results are slightly different from the paper #1

kdrag0n opened this issue Aug 29, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@kdrag0n
Copy link
Owner

kdrag0n commented Aug 29, 2021

The results of our ZCAM implementation are slightly different from the official ZCAM examples in the supplementary document. For example, the paper provides the following values for Example 1 (chromatically adapted to D65 using Luxpy's implementation of CAT02, because we don't support chromatic adaptation yet):

hz = 196.3524
Qz = 321.3464
Jz = 92.2520
Mz = 10.5252
Cz = 3.0216
Sz = 19.1314
Vz = 34.7022
Kz = 25.2994
Wz = 91.6837

Our results:

hz = 196.33770439109085
Qz = 321.3462189522057
Jz = 92.25198613424337
Mz = 10.519364954372517
Cz = 3.0198964626876563
Sz = 19.12610852817541
Vz = 34.70166837393559
Kz = 25.88274309285123
Wz = 91.68426229915165

I've reached out to the authors for clarification, but I haven't gotten an answer for the discrepancies and it appears that they're not willing to provide source code for the reference implementation.

This is probably related to D65 adaptation because the example inputs are not relative to D65. As such, it's unlikely to affect our primary use case where all colors come from sRGB and thus do not need adaptation, but it's still worth investigating.

Adapted XYZ values for Example 1 (colorio, ASTM D65, CAT02, average surround, La = 264): 182.25997236, 206.57412429, 231.18612283

@kdrag0n kdrag0n added bug Something isn't working and removed bug Something isn't working labels Aug 29, 2021
@kdrag0n
Copy link
Owner Author

kdrag0n commented Aug 29, 2021

This is the same issue as ksmet1977/luxpy#17, but that doesn't seem to have been fixed.

kdrag0n added a commit that referenced this issue Sep 1, 2021
All sample XYZ values have been adapted using colorio's implementation
of CAT02, with F values chosen to match the given surround and L_a
matching the one used for ZCAM.

The paper appears to have the wrong L_a and Y_b values for example #3.
Changing them to match #1 and #2 fixes the tests.

The paper also gives an odd value for hue angle in #5: 389.7720 degrees,
likely caused by unconditionally adding 360 to make the angle positive.
Subtracting 360 makes the test pass.

Closes #3.
@kdrag0n
Copy link
Owner Author

kdrag0n commented Sep 1, 2021

By adapting the sample inputs with CAT02 parameters that match the example viewing conditions and leaving the reference white unadapted, our results are now much closer to the examples, but still not exactly the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant