-
Notifications
You must be signed in to change notification settings - Fork 31
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 is published #17
Comments
Ok. Thanks for letting me know. I'll see if I can update zcam as soon as possible. |
I've implemented the published version of ZCAM. However, note that the example values in the supplementary material cannot be exactly replicated. I've checked all parameters, and I think they are correct, but there is already a discrepancy for the XYZ to Jz, az, bz conversion, especially for the bz value. The only reason I can see (assuming I indeed not missed any wrong parameter values, but please check yourself), is that the CAT02 chromatic adaptation transform parameters or more likely the XYZ of the D65 reference white that Safdar et al used in their calculations is different from what one would normally use/get: for XYZw of D65, maybe they used a different, non-standard wavelength range, mistyped, or something else?. In any case, (and I've reported this to the authors months ago), published values of D65 for the CIE 1932 2° observer don't lead to a (az, bz) values of (0,0) which is what one would expect for a stimulus matching the reference white. In addition (also reported to the authors), they report that for Iz the reference is a D65 stimulus of 10000 cd/m², but Iz becomes 1 only for a much higher value! So there is probably something wrong there as well. So for now, I won't put any more time in this until perhaps somebody else can very my findings or point out where I might have made a coding mistaking. If you want to use the new ZCAM update your luxpy copy from github directly. I'll make another release for pypi later, but I'm working on some other things that I want to incorporate in the new version. |
That's great, thank you very much! I've tried to test the worked examples, but it doesn't work as expected. Maybe I'm doing something wrong, but it seems the CAT is not even applied? The following function call gives the same result when I remove the parameter "xyzw".
By the way, it would be good to have az and bz as output parameters for testing. |
Maybe you can try again, I noticed that there was still a line of code in
there for testing the location of the origin that always sets the xyzw to
that of D65.
In any case, as I mentioned I can't match the values as in the examples,
while the parameters are the same
Op vr 30 apr. 2021 om 17:04 schreef Joshua Krämer ***@***.***
…:
That's great, thank you very much!
I've tried to test the worked examples, but it doesn't work as expected.
Maybe I'm doing something wrong, but it seems the CAT is not even applied?
The following function call gives the same result when I remove the
parameter "xyzw".
>>> luxpy.color.cam.zcam(numpy.array([[185, 206, 163]]), xyzw = numpy.array([[256, 264, 202]]), outin = "J,C,h", cieobs = "1931_2", conditions = {"La": 264, "Yb": 100, "surround": "avg", "D": None, "Dtype": "cat02"}, forward = True, mcat = "cat02")
array([[127.7651, 4.7005, 104.3055]])
By the way, it would be good to have az and bz as output parameters for
testing.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#17 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACS4LX6SEFROK76T7CPYRSTTLLBH5ANCNFSM432GSAGA>
.
|
btw to get the Iz,az,bz out, you could try setting out = 'iabz' as that is
the name of the variable storing these values in the calculation. That's
how I tested the correctness of these valuesn but already here there are
differences, which I think are likely due to the way the corresponding
colors are calculated with the CAT02 matrix. When at some point I got the
matlab code from one of the authors, I noticed that some of the parameters
were different than in the paper and his code for the forward model applied
chromatic adaptation while in inverse did not (or vice versa, can't quite
remember). You're welcome to further try and figure his out using the code
in the zcam.py file and let me know once you might have figured out where
the exact problem is, but I think it might be difficult without more
intermediate steps in the worked examples in the supplementary file to the
paper.
Op vr 30 apr. 2021 om 17:15 schreef kevin smet ***@***.***>:
… Maybe you can try again, I noticed that there was still a line of code in
there for testing the location of the origin that always sets the xyzw to
that of D65.
In any case, as I mentioned I can't match the values as in the examples,
while the parameters are the same
Op vr 30 apr. 2021 om 17:04 schreef Joshua Krämer <
***@***.***>:
> That's great, thank you very much!
>
> I've tried to test the worked examples, but it doesn't work as expected.
> Maybe I'm doing something wrong, but it seems the CAT is not even applied?
> The following function call gives the same result when I remove the
> parameter "xyzw".
>
> >>> luxpy.color.cam.zcam(numpy.array([[185, 206, 163]]), xyzw = numpy.array([[256, 264, 202]]), outin = "J,C,h", cieobs = "1931_2", conditions = {"La": 264, "Yb": 100, "surround": "avg", "D": None, "Dtype": "cat02"}, forward = True, mcat = "cat02")
> array([[127.7651, 4.7005, 104.3055]])
>
> By the way, it would be good to have az and bz as output parameters for
> testing.
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#17 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACS4LX6SEFROK76T7CPYRSTTLLBH5ANCNFSM432GSAGA>
> .
>
|
Thank you, it works now. I think a clarification from the authors is necessary. I will try to contact them and ask for a current Matlab implementation. |
I think I have found a small bug with the ZCAM implementation: Hue quadrature H seems to be interpreted as hue angle h in backwards mode.
|
Thanks for letting me know
Fixed that, it was never supposed to work with H quadrature, but now it
should. (I've also changed CIECAM02, CIECAM16 and CAM18sl to now be able to
work with inverse of hue_quadrature)
I've also just released a new version of luxpy on pypi and conda.
regards,
Kevin
Op di 4 mei 2021 om 10:10 schreef Joshua Krämer ***@***.***>:
… I think I have found a small bug with the ZCAM implementation: Hue
quadrature *H* seems to be interpreted as hue angle *h* in backwards mode.
>>> luxpy.color.cam.zcam(luxpy.color.cam.zcam(numpy.array([[50, 10, 100]]), outin = "J,C,H", forward = False), outin = "J,C,H", forward = True)
array([[[ 50. , 10. , 135.5]]])
>>> luxpy.color.cam.zcam(luxpy.color.cam.zcam(numpy.array([[50, 10, 100]]), outin = "J,C,H", forward = False), outin = "J,C,h", forward = True)
array([[[ 50., 10., 100.]]])
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#17 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACS4LX5RYSI7ITKUZQ2GUZTTL6TW3ANCNFSM432GSAGA>
.
|
Thanks a lot! |
Accessing the ZCAM functions prints the following warning:
WARNING: Z-CAM is as yet unpublished and under development, so parameter values might change! (07 Oct, 2020
But ZCAM has already been published (https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-29-4-6036).
The text was updated successfully, but these errors were encountered: