From 298abe1ac0b4fe67495dd01bec58d62abf109a2a Mon Sep 17 00:00:00 2001 From: Christos Psaltis Date: Mon, 3 Dec 2012 15:54:26 +0200 Subject: [PATCH] Add test for resize option in rotate --- skimage/transform/tests/test_warps.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/skimage/transform/tests/test_warps.py b/skimage/transform/tests/test_warps.py index 1993f932..2cdda001 100644 --- a/skimage/transform/tests/test_warps.py +++ b/skimage/transform/tests/test_warps.py @@ -85,6 +85,17 @@ def test_rotate(): assert_array_almost_equal(x90, np.rot90(x)) +def test_rotate_resize(): + x = np.zeros((10, 10), dtype=np.double) + + x45 = rotate(x, 45, resize=False) + assert x45.shape == (10, 10) + + x45 = rotate(x, 45, resize=True) + # new dimension should be d = sqrt(2 * (10/2)^2) + assert x45.shape == (14, 14) + + def test_rescale(): # same scale factor x = np.zeros((5, 5), dtype=np.double)