Disable catch of all warnings, return nan params instead

This commit is contained in:
Johannes Schönberger
2015-01-22 06:49:16 -05:00
parent acf68c6d7c
commit ad85dfabd5
4 changed files with 71 additions and 78 deletions
+12 -4
View File
@@ -265,8 +265,12 @@ class ProjectiveTransform(GeometricTransform):
"""
src_matrix, src = _center_and_normalize_points(src)
dst_matrix, dst = _center_and_normalize_points(dst)
try:
src_matrix, src = _center_and_normalize_points(src)
dst_matrix, dst = _center_and_normalize_points(dst)
except ZeroDivisionError:
self.params = np.nan * np.empty((3, 3))
return
xs = src[:, 0]
ys = src[:, 1]
@@ -652,8 +656,12 @@ class SimilarityTransform(ProjectiveTransform):
"""
src_matrix, src = _center_and_normalize_points(src)
dst_matrix, dst = _center_and_normalize_points(dst)
try:
src_matrix, src = _center_and_normalize_points(src)
dst_matrix, dst = _center_and_normalize_points(dst)
except ZeroDivisionError:
self.params = np.nan * np.empty((3, 3))
return
xs = src[:, 0]
ys = src[:, 1]