def test_rgbcie2rgb_conversion(self, channel_axis):
     rgb = np.moveaxis(self.colbars_array,
                       source=-1,
                       destination=channel_axis)
     round_trip = rgbcie2rgb(rgb2rgbcie(rgb, channel_axis=channel_axis),
                             channel_axis=channel_axis)
     # only roundtrip test, we checked rgb2rgbcie above already
     assert_almost_equal(round_trip, rgb)
 def trans(self, img1, img2, img3):
     rst = np.maximum((img1.T, img2.T, img3.T), 0, dtype=np.float64)
     rst /= 255 / 50 * 255
     rst = color.rgbcie2rgb(rst.T)
     rst *= 255
     return (rst).astype(np.uint8)
Beispiel #3
0
    def test_rgbcie2rgb_dtype(self):
        img = rgb2rgbcie(self.colbars_array).astype('float64')
        img32 = img.astype('float32')

        assert rgbcie2rgb(img).dtype == img.dtype
        assert rgbcie2rgb(img32).dtype == img32.dtype
Beispiel #4
0
 def test_rgbcie2rgb_conversion(self):
     # only roundtrip test, we checked rgb2rgbcie above already
     assert_almost_equal(rgbcie2rgb(rgb2rgbcie(self.colbars_array)),
                         self.colbars_array)
Beispiel #5
0
 def test_rgbcie2rgb_conversion(self):
     # only roundtrip test, we checked rgb2rgbcie above already
     assert_almost_equal(rgbcie2rgb(rgb2rgbcie(self.colbars_array)),
                         self.colbars_array)
 def rgbcie2rgb(self, imageArray):
     return color.rgbcie2rgb(imageArray)