Test 90deg rotation for similarity transform

This commit is contained in:
Johannes Schönberger
2014-05-10 10:22:55 -04:00
parent c3e13a9754
commit 02e6ad6b71
2 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -620,9 +620,9 @@ class SimilarityTransform(ProjectiveTransform):
@property
def scale(self):
if math.cos(self.rotation) == 0:
if abs(math.cos(self.rotation)) < np.spacing(1):
# sin(self.rotation) == 1
scale = self.params[0, 1]
scale = self.params[1, 0]
else:
scale = self.params[0, 0] / math.cos(self.rotation)
return scale