From 452fcdaba82b8c624626a5951e4577c29a64adf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Sun, 16 Mar 2014 15:15:42 -0400 Subject: [PATCH 1/2] DOC: typo --- skimage/transform/_geometric.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/skimage/transform/_geometric.py b/skimage/transform/_geometric.py index d5b25b6d..88cbd0da 100644 --- a/skimage/transform/_geometric.py +++ b/skimage/transform/_geometric.py @@ -489,11 +489,11 @@ class PiecewiseAffineTransform(GeometricTransform): class SimilarityTransform(ProjectiveTransform): """2D similarity transformation of the form:: - X = a0*x - b0*y + a1 = - = m*x*cos(rotation) + m*y*sin(rotation) + a1 + X = a0 * x - b0 * y + a1 = + = m * x * cos(rotation) - m * y * sin(rotation) + a1 - Y = b0*x + a0*y + b1 = - = m*x*sin(rotation) + m*y*cos(rotation) + b1 + Y = b0 * x + a0 * y + b1 = + = m * x * sin(rotation) + m * y * cos(rotation) + b1 where ``m`` is a zoom factor and the homogeneous transformation matrix is:: @@ -560,13 +560,13 @@ class SimilarityTransform(ProjectiveTransform): The transformation is defined as:: - X = a0*x - b0*y + a1 - Y = b0*x + a0*y + b1 + X = a0 * x - b0 * y + a1 + Y = b0 * x + a0 * y + b1 These equations can be transformed to the following form:: - 0 = a0*x - b0*y + a1 - X - 0 = b0*x + a0*y + b1 - Y + 0 = a0 * x - b0 * y + a1 - X + 0 = b0 * x + a0 * y + b1 - Y which exist for each set of corresponding points, so we have a set of N * 2 equations. The coefficients appear linearly so we can write From 11725c93964f66030d1acd646c842fc76209c827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Sun, 16 Mar 2014 15:16:35 -0400 Subject: [PATCH 2/2] PEP8 --- skimage/transform/_geometric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/transform/_geometric.py b/skimage/transform/_geometric.py index 88cbd0da..883aa88d 100644 --- a/skimage/transform/_geometric.py +++ b/skimage/transform/_geometric.py @@ -615,8 +615,8 @@ class SimilarityTransform(ProjectiveTransform): a0, a1, b0, b1 = - V[-1, :-1] / V[-1, -1] self.params = np.array([[a0, -b0, a1], - [b0, a0, b1], - [ 0, 0, 1]]) + [b0, a0, b1], + [ 0, 0, 1]]) @property def scale(self):