mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-29 11:26:57 +08:00
combination of two transformations of the same type result in this type again
This commit is contained in:
@@ -176,7 +176,13 @@ class ProjectiveTransform(GeometricTransform):
|
||||
|
||||
"""
|
||||
if isinstance(other, ProjectiveTransform):
|
||||
return ProjectiveTransform(np.dot(other._matrix, self._matrix))
|
||||
# combination of the same types result in a transformation of this
|
||||
# type again, otherwise use general projective transformation
|
||||
if type(self) == type(other):
|
||||
tform = self.__class__
|
||||
else:
|
||||
tform = ProjectiveTransform
|
||||
return tform(other._matrix.dot(self._matrix))
|
||||
else:
|
||||
raise TypeError("Cannot combine transformations of differing "
|
||||
"types.")
|
||||
|
||||
Reference in New Issue
Block a user