From 8ca068ed19fe2808a13e9cc5973ef8b31564e666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 5 Oct 2012 06:21:28 +0200 Subject: [PATCH] Add test case for separate scale factors --- skimage/transform/tests/test_warps.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/skimage/transform/tests/test_warps.py b/skimage/transform/tests/test_warps.py index e0a768e8..51a62e55 100644 --- a/skimage/transform/tests/test_warps.py +++ b/skimage/transform/tests/test_warps.py @@ -95,6 +95,7 @@ def test_resize(): def test_scale(): + # same scale factor x = np.zeros((5, 5), dtype=np.double) x[1, 1] = 1 scaled = scale(x, 2, order=0) @@ -102,6 +103,14 @@ def test_scale(): ref[2:4, 2:4] = 1 assert_array_almost_equal(scaled, ref) + # different scale factors + x = np.zeros((5, 5), dtype=np.double) + x[1, 1] = 1 + scaled = scale(x, (2, 1), order=0) + ref = np.zeros((10, 5)) + ref[2:4, 1] = 1 + assert_array_almost_equal(scaled, ref) + def test_swirl(): image = img_as_float(data.checkerboard())