Пример #1
0
    def test_mosaicing_CFA_Bayer(self):
        """
        Tests :func:`colour_demosaicing.bayer.mosaicing.mosaicing_CFA_Bayer`
        definition.
        """

        image = read_image(str(os.path.join(BAYER_DIRECTORY,
                                            'Lighthouse.exr')))

        for pattern in ('RGGB', 'BGGR', 'GRBG', 'GBRG'):
            CFA = os.path.join(BAYER_DIRECTORY, 'Lighthouse_CFA_{0}.exr')
            np.testing.assert_almost_equal(mosaicing_CFA_Bayer(image, pattern),
                                           read_image(str(
                                               CFA.format(pattern))),
                                           decimal=7)
    def test_mosaicing_CFA_Bayer(self):
        """
        Tests :func:`colour_demosaicing.bayer.mosaicing.mosaicing_CFA_Bayer`
        definition.
        """

        image = colour.read_image(
            str(os.path.join(BAYER_DIRECTORY, 'Lighthouse.exr')))

        for pattern in ('RGGB', 'BGGR', 'GRBG', 'GBRG'):
            np.testing.assert_almost_equal(
                mosaicing_CFA_Bayer(image, pattern),
                colour.read_image(
                    str(os.path.join(
                        BAYER_DIRECTORY,
                        'Lighthouse_CFA_{0}.exr'.format(pattern)))),
                decimal=7)