Skip to content

Commit

Permalink
Convert points to float before cv2.undistortPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
roomrys committed Nov 27, 2024
1 parent 6240f0d commit 250a8c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sleap_io/model/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 250a8c5

Please sign in to comment.