Ejemplo n.º 1
0
    def test_spectral_to_aces_relative_exposure_values(self):
        """
                Test :func:`colour.characterisation.aces_it.
        sd_to_aces_relative_exposure_values` definition.
        """

        shape = MSDS_ACES_RICD.shape
        grey_reflector = sd_constant(0.18, shape)
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(grey_reflector),
            np.array([0.18, 0.18, 0.18]),
            decimal=7,
        )

        perfect_reflector = sd_ones(shape)
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(perfect_reflector),
            np.array([0.97783784, 0.97783784, 0.97783784]),
            decimal=7,
        )

        dark_skin = SDS_COLOURCHECKERS["ColorChecker N Ohta"]["dark skin"]
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(dark_skin),
            np.array([0.11718149, 0.08663609, 0.05897268]),
            decimal=7,
        )

        dark_skin = SDS_COLOURCHECKERS["ColorChecker N Ohta"]["dark skin"]
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(dark_skin,
                                                SDS_ILLUMINANTS["A"]),
            np.array([0.13583991, 0.09431845, 0.05928214]),
            decimal=7,
        )

        dark_skin = SDS_COLOURCHECKERS["ColorChecker N Ohta"]["dark skin"]
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(
                dark_skin, apply_chromatic_adaptation=True),
            np.array([0.11807796, 0.08690312, 0.05891252]),
            decimal=7,
        )

        dark_skin = SDS_COLOURCHECKERS["ColorChecker N Ohta"]["dark skin"]
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(
                dark_skin,
                apply_chromatic_adaptation=True,
                chromatic_adaptation_transform="Bradford",
            ),
            np.array([0.11805993, 0.08689013, 0.05900396]),
            decimal=7,
        )
Ejemplo n.º 2
0
    def test_spectral_to_aces_relative_exposure_values(self):
        """
        Tests :func:`colour.models.rgb.aces_it.
sd_to_aces_relative_exposure_values` definition.
        """

        shape = ACES_RICD.shape
        grey_reflector = sd_constant(0.18, shape)
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(grey_reflector),
            np.array([0.18, 0.18, 0.18]),
            decimal=7)

        perfect_reflector = sd_ones(shape)
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(perfect_reflector),
            np.array([0.97783784, 0.97783784, 0.97783784]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(dark_skin),
            np.array([0.11717855, 0.08663479, 0.05897071]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(dark_skin,
                                                ILLUMINANTS_SDS['A']),
            np.array([0.13584109, 0.09431910, 0.05928216]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(
                dark_skin, apply_chromatic_adaptation=True),
            np.array([0.11807662, 0.0869023, 0.05891045]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(
                dark_skin,
                apply_chromatic_adaptation=True,
                chromatic_adaptation_transform='Bradford'),
            np.array([0.11805856, 0.08688928, 0.05900204]),
            decimal=7)
Ejemplo n.º 3
0
    def test_spectral_to_aces_relative_exposure_values(self):
        """
        Tests :func:`colour.models.rgb.aces_it.
sd_to_aces_relative_exposure_values` definition.
        """

        shape = ACES_RICD.shape
        grey_reflector = sd_constant(0.18, shape)
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(grey_reflector),
            np.array([0.18, 0.18, 0.18]),
            decimal=7)

        perfect_reflector = sd_ones(shape)
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(perfect_reflector),
            np.array([0.97783784, 0.97783784, 0.97783784]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(dark_skin),
            np.array([0.11717855, 0.08663479, 0.05897071]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(dark_skin,
                                                ILLUMINANTS_SDS['A']),
            np.array([0.13584109, 0.09431910, 0.05928216]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(
                dark_skin, apply_chromatic_adaptation=True),
            np.array([0.11807662, 0.0869023, 0.05891045]),
            decimal=7)

        dark_skin = COLOURCHECKERS_SDS['ColorChecker N Ohta']['dark skin']
        np.testing.assert_almost_equal(
            sd_to_aces_relative_exposure_values(
                dark_skin,
                apply_chromatic_adaptation=True,
                chromatic_adaptation_transform='Bradford'),
            np.array([0.11805856, 0.08688928, 0.05900204]),
            decimal=7)
Ejemplo n.º 4
0
    def test_domain_range_scale_spectral_to_aces_relative_exposure_values(
            self):
        """
        Tests :func:`colour.models.rgb.aces_it.
sd_to_aces_relative_exposure_values`  definition domain and range scale
        support.
        """

        shape = ACES_RICD.shape
        grey_reflector = sd_constant(0.18, shape)
        RGB = sd_to_aces_relative_exposure_values(grey_reflector)

        d_r = (('reference', 1), (1, 1), (100, 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    sd_to_aces_relative_exposure_values(grey_reflector),
                    RGB * factor,
                    decimal=7)
Ejemplo n.º 5
0
    def test_domain_range_scale_spectral_to_aces_relative_exposure_values(
            self):
        """
        Tests :func:`colour.models.rgb.aces_it.
sd_to_aces_relative_exposure_values`  definition domain and range scale
        support.
        """

        shape = ACES_RICD.shape
        grey_reflector = sd_constant(0.18, shape)
        RGB = sd_to_aces_relative_exposure_values(grey_reflector)

        d_r = (('reference', 1), (1, 1), (100, 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    sd_to_aces_relative_exposure_values(grey_reflector),
                    RGB * factor,
                    decimal=7)
Ejemplo n.º 6
0
    def test_domain_range_scale_spectral_to_aces_relative_exposure_values(
        self, ):
        """
                Test :func:`colour.characterisation.aces_it.
        sd_to_aces_relative_exposure_values`  definition domain and range scale
                support.
        """

        shape = MSDS_ACES_RICD.shape
        grey_reflector = sd_constant(0.18, shape)
        RGB = sd_to_aces_relative_exposure_values(grey_reflector)

        d_r = (("reference", 1), ("1", 1), ("100", 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    sd_to_aces_relative_exposure_values(grey_reflector),
                    RGB * factor,
                    decimal=7,
                )