mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-04 13:14:23 +08:00
FIX: added default identity matrix to SimilarityTransform to match AffineTransform
This commit is contained in:
@@ -298,10 +298,8 @@ class AffineTransform(ProjectiveTransform):
|
||||
])
|
||||
self._matrix[0:2, 2] = translation
|
||||
else:
|
||||
# -- Default to an identity transform
|
||||
self._matrix = np.asarray(
|
||||
[[1, 0, 0], [0, 1, 0], [0, 0, 0]],
|
||||
dtype='float64')
|
||||
# Default to an identity transform
|
||||
self._matrix = np.eye(3)
|
||||
|
||||
@property
|
||||
def scale(self):
|
||||
@@ -377,6 +375,9 @@ class SimilarityTransform(ProjectiveTransform):
|
||||
])
|
||||
self._matrix *= scale
|
||||
self._matrix[0:2, 2] = translation
|
||||
else:
|
||||
# Default to an identity transform
|
||||
self._matrix = np.eye(3)
|
||||
|
||||
def estimate(self, src, dst):
|
||||
"""Set the transformation matrix with the explicit parameters.
|
||||
|
||||
Reference in New Issue
Block a user