test for rgb2lch roundtrip

This commit is contained in:
Matt Terry
2013-07-25 15:17:30 -07:00
parent e848ba1e61
commit 547fa2fc6c
+8
View File
@@ -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])