From bd240d9f92d0c5caced4b330fb9b169f8ce91b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 22 Nov 2013 11:43:08 +0100 Subject: [PATCH] Test scale determination for 0 rotation --- skimage/transform/tests/test_geometric.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/skimage/transform/tests/test_geometric.py b/skimage/transform/tests/test_geometric.py index 0af70fdd..4315029d 100644 --- a/skimage/transform/tests/test_geometric.py +++ b/skimage/transform/tests/test_geometric.py @@ -76,6 +76,16 @@ def test_similarity_init(): assert_array_almost_equal(tform2.rotation, rotation) assert_array_almost_equal(tform2.translation, translation) + # test special case for scale if rotation=0 + scale = 0.1 + rotation = 0 + translation = (1, 1) + tform = SimilarityTransform(scale=scale, rotation=rotation, + translation=translation) + assert_array_almost_equal(tform.scale, scale) + assert_array_almost_equal(tform.rotation, rotation) + assert_array_almost_equal(tform.translation, translation) + def test_affine_estimation(): # exact solution