From 21d1ba567ea1683a52329d0158c9712a406371b9 Mon Sep 17 00:00:00 2001 From: silo65 <97576250+silo65@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:06:02 -0500 Subject: [PATCH] Update perspective.py When setting perspectives, np.float on line 441 is called out as being depreciated. Switched to np.float64 to keep numpy scalar type float. If normal float is needed, use float instead of np.float64. --- superpaper/perspective.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superpaper/perspective.py b/superpaper/perspective.py index 55e09cc..8f625bc 100644 --- a/superpaper/perspective.py +++ b/superpaper/perspective.py @@ -438,7 +438,7 @@ def find_coeffs(source_coords, target_coords): for s, t in zip(source_coords, target_coords): matrix.append([t[0], t[1], 1, 0, 0, 0, -s[0]*t[0], -s[0]*t[1]]) matrix.append([0, 0, 0, t[0], t[1], 1, -s[1]*t[0], -s[1]*t[1]]) - A = np.matrix(matrix, dtype=np.float) + A = np.matrix(matrix, dtype=np.float64) B = np.array(source_coords).reshape(8) # res = np.dot(np.linalg.inv(A.T * A) * A.T, B) res = np.linalg.solve(A, B)