From 250a8c545aca6ddfba37a4d672c810f7c3e37341 Mon Sep 17 00:00:00 2001 From: roomrys <38435167+roomrys@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:34:48 -0800 Subject: [PATCH] Convert points to float before cv2.undistortPoints --- sleap_io/model/camera.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sleap_io/model/camera.py b/sleap_io/model/camera.py index 896bc4e5..530939f3 100644 --- a/sleap_io/model/camera.py +++ b/sleap_io/model/camera.py @@ -248,7 +248,7 @@ def undistort_points(self, points: np.ndarray) -> np.ndarray: """ shape = points.shape points = points.reshape(-1, 1, 2) - out = cv2.undistortPoints(points, self.matrix, self.dist) + out = cv2.undistortPoints(points.astype("float64"), self.matrix, self.dist) return out.reshape(shape) def project(self, points: np.ndarray) -> np.ndarray: