From 547fa2fc6cde995fb680a77900c28e7efee6e7b8 Mon Sep 17 00:00:00 2001 From: Matt Terry Date: Thu, 25 Jul 2013 15:17:30 -0700 Subject: [PATCH] test for rgb2lch roundtrip --- skimage/color/tests/test_colorconv.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/skimage/color/tests/test_colorconv.py b/skimage/color/tests/test_colorconv.py index a184f807..f2e99095 100644 --- a/skimage/color/tests/test_colorconv.py +++ b/skimage/color/tests/test_colorconv.py @@ -256,6 +256,14 @@ class TestColorconv(TestCase): lab2 = lch2lab(lab2lch(lab)) assert_array_almost_equal(lab2, lab) + def test_rgb_lch_roundtrip(self): + rgb = img_as_float(self.img_rgb) + lab = rgb2lab(rgb) + lch = lab2lch(lab) + lab2 = lch2lab(lch) + rgb2 = lab2rgb(lab2) + assert_array_almost_equal(rgb, rgb2) + def test_gray2rgb(): x = np.array([0, 0.5, 1])