Example #1
0
    def test_n_dimensional_colour_correction_Finlayson2015(self):
        """
        Tests :func:`colour.characterisation.correction.\
colour_correction_Finlayson2015` definition n-dimensions support.
        """

        RGB = np.array([0.17224810, 0.09170660, 0.06416938])
        RGB_c = np.array([0.13348722, 0.08439216, 0.05990144])
        np.testing.assert_almost_equal(colour_correction_Finlayson2015(
            RGB, M_T, M_R),
                                       RGB_c,
                                       decimal=7)

        RGB = np.tile(RGB, (6, 1))
        RGB_c = np.tile(RGB_c, (6, 1))
        np.testing.assert_almost_equal(colour_correction_Finlayson2015(
            RGB, M_T, M_R),
                                       RGB_c,
                                       decimal=7)

        RGB = np.reshape(RGB, (2, 3, 3))
        RGB_c = np.reshape(RGB_c, (2, 3, 3))
        np.testing.assert_almost_equal(colour_correction_Finlayson2015(
            RGB, M_T, M_R),
                                       RGB_c,
                                       decimal=7)
Example #2
0
    def test_n_dimensional_colour_correction_Finlayson2015(self):
        """
        Test :func:`colour.characterisation.correction.\
colour_correction_Finlayson2015` definition n-dimensional support.
        """

        RGB = np.array([0.17224810, 0.09170660, 0.06416938])
        RGB_c = colour_correction_Finlayson2015(
            RGB, MATRIX_TEST, MATRIX_REFERENCE
        )

        RGB = np.tile(RGB, (6, 1))
        RGB_c = np.tile(RGB_c, (6, 1))
        np.testing.assert_almost_equal(
            colour_correction_Finlayson2015(
                RGB, MATRIX_TEST, MATRIX_REFERENCE
            ),
            RGB_c,
            decimal=7,
        )

        RGB = np.reshape(RGB, (2, 3, 3))
        RGB_c = np.reshape(RGB_c, (2, 3, 3))
        np.testing.assert_almost_equal(
            colour_correction_Finlayson2015(
                RGB, MATRIX_TEST, MATRIX_REFERENCE
            ),
            RGB_c,
            decimal=7,
        )
Example #3
0
    def test_colour_correction_Finlayson2015(self):
        """
        Tests :func:`colour.characterisation.correction.\
colour_correction_Finlayson2015` definition.
        """

        RGB = np.array([0.17224810, 0.09170660, 0.06416938])

        np.testing.assert_almost_equal(
            colour_correction_Finlayson2015(RGB, M_T, M_R),
            np.array([0.13348722, 0.08439216, 0.05990144]),
            decimal=7)

        np.testing.assert_almost_equal(
            colour_correction_Finlayson2015(RGB, M_T, M_R, degree=3),
            np.array([0.15576430, 0.09483056, 0.07131041]),
            decimal=7)
Example #4
0
    def test_colour_correction_Finlayson2015(self):
        """
        Tests :func:`colour.characterisation.correction.\
colour_correction_Finlayson2015` definition.
        """

        RGB = np.array([0.17224810, 0.09170660, 0.06416938])

        np.testing.assert_almost_equal(
            colour_correction_Finlayson2015(RGB, MATRIX_TEST,
                                            MATRIX_REFERENCE),
            np.array([0.13348722, 0.08439216, 0.05990144]),
            decimal=7)

        np.testing.assert_almost_equal(
            colour_correction_Finlayson2015(RGB,
                                            MATRIX_TEST,
                                            MATRIX_REFERENCE,
                                            degree=3),
            np.array([0.13914542, 0.08602124, 0.06422973]),
            decimal=7)