From 93d0842aae13d14c863298e1903e235ac43500d9 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 26 Jun 2020 11:56:21 +0200 Subject: Trying to figure out why the solver diverges... --- test_what.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test_what.py (limited to 'test_what.py') diff --git a/test_what.py b/test_what.py new file mode 100644 index 0000000..92b98e8 --- /dev/null +++ b/test_what.py @@ -0,0 +1,36 @@ +import numpy as np +from colour import * +from colour.difference import delta_E_CIE1976 +from colour.models import RGB_COLOURSPACES +from colour.recovery import RGB_to_sd_Jakob2019, Jakob2019Interpolator +from gsoc_common import * + +colourspace = RGB_COLOURSPACES["sRGB"] + + +if __name__ == "__main__": + RGB = np.array([0.1668, 0.000, 0.0334]) + + + matched_sd, error = RGB_to_sd_Jakob2019( + RGB, + colourspace, + #coefficients_0=(57.94046366, -39.65092867, 2.48839434), + return_error=True, + use_feedback=True, + ) + + print("Error is %g" % error) + + XYZ = RGB_to_XYZ( + RGB, + colourspace.whitepoint, + D65_xy, + colourspace.RGB_to_XYZ_matrix, + ) + + print("Target was %s %s" % (colourspace.name, RGB)) + print("...XYZ = %s" % XYZ) + print("...Lab = %s" % XYZ_to_Lab(XYZ, D65_xy)) + + plot_comparison(XYZ, matched_sd, "target", error, D65) -- cgit