def test_find_regions_variance_minimization(self):
        """
        Tests :func:`colour_hdri.sampling.variance_minimization.\
find_regions_variance_minimization` definition.
        """

        image = read_image(str(os.path.join(
            SAMPLING_DIRECTORY,
            'tests_light_probe_sampling_variance_minimization.exr')))

        Y = np.dot(image, DEFAULT_LUMINANCE_FACTORS)
        regions = find_regions_variance_minimization(Y, n=1)
        self.assertListEqual(
            regions,
            [(0, 256, 0, 156), (0, 256, 156, 256)])

        regions = find_regions_variance_minimization(Y, n=2)
        self.assertListEqual(
            regions,
            [(0, 97, 0, 156),
             (97, 256, 0, 156),
             (0, 100, 156, 256),
             (100, 256, 156, 256)])

        regions = find_regions_variance_minimization(Y, n=4)
        self.assertListEqual(
            regions,
            [(0, 39, 0, 91),
             (39, 97, 0, 91),
             (0, 39, 91, 156),
             (39, 97, 91, 156),
             (97, 159, 0, 92),
             (97, 159, 92, 156),
             (159, 256, 0, 93),
             (159, 256, 93, 156),
             (0, 42, 156, 216),
             (42, 100, 156, 216),
             (0, 44, 216, 256),
             (44, 100, 216, 256),
             (100, 163, 156, 215),
             (100, 163, 215, 256),
             (163, 256, 156, 216),
             (163, 256, 216, 256)])
    def test_highlight_regions_variance_minimization(self):
        """
        Tests :func:`colour_hdri.sampling.variance_minimization.\
highlight_regions_variance_minimization` definition.
        """

        image = read_image(str(os.path.join(
            SAMPLING_DIRECTORY,
            'tests_light_probe_sampling_variance_minimization.exr')))

        Y = np.dot(image, DEFAULT_LUMINANCE_FACTORS)
        regions = find_regions_variance_minimization(Y, n=4)
        np.testing.assert_almost_equal(
            highlight_regions_variance_minimization(image, regions),
            read_image(str(os.path.join(
                SAMPLING_DIRECTORY,
                'tests_highlight_regions_variance_minimization.exr'))),
            decimal=7)