From 3e6e6905903319cea7ce2e6d37c951b48dabaa27 Mon Sep 17 00:00:00 2001 From: spotter Date: Fri, 1 Mar 2013 11:50:10 +0100 Subject: [PATCH] ENH: Added a short test to validate rgb2hed and hed2rgb conversion --- skimage/color/tests/test_colorconv.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/skimage/color/tests/test_colorconv.py b/skimage/color/tests/test_colorconv.py index 962fa9fc..e49443fc 100644 --- a/skimage/color/tests/test_colorconv.py +++ b/skimage/color/tests/test_colorconv.py @@ -121,6 +121,19 @@ class TestColorconv(TestCase): img_rgb = img_as_float(self.img_rgb) assert_array_almost_equal(xyz2rgb(rgb2xyz(img_rgb)), img_rgb) + # RGB<->HED roundtrip + def test_hed_rgb_roundtrip(self): + test = np.array([[[97, 105, 152], + [217, 187, 225], + [117, 107, 168]], + [[217, 187, 225], + [176, 135, 83], + [234, 144, 205]], + [[97, 105, 152], + [117, 107, 168], + [217, 187, 225]]], dtype=np.uint8) + assert_array_almost_equal(hed2rgb(rgb2hed(img_rgb)), img_rgb) + # RGB to RGB CIE def test_rgb2rgbcie_conversion(self): gt = np.array([[[ 0.1488856 , 0.18288098, 0.19277574],