From f2878eb337b9af6c89544a2dc6cff47277b73844 Mon Sep 17 00:00:00 2001 From: Alberto Zurini Date: Wed, 1 Jan 2025 21:13:40 +0100 Subject: [PATCH] fix: cast coordinates to int32 for compatibility with line function --- doc/py_tutorials/py_calib3d/py_pose/py_pose.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/py_tutorials/py_calib3d/py_pose/py_pose.markdown b/doc/py_tutorials/py_calib3d/py_pose/py_pose.markdown index cc06da6902..e4d93d2717 100644 --- a/doc/py_tutorials/py_calib3d/py_pose/py_pose.markdown +++ b/doc/py_tutorials/py_calib3d/py_pose/py_pose.markdown @@ -36,7 +36,8 @@ Now let's create a function, draw which takes the corners in the chessboard (obt **cv.findChessboardCorners()**) and **axis points** to draw a 3D axis. @code{.py} def draw(img, corners, imgpts): - corner = tuple(corners[0].ravel()) + corner = tuple(corners[0].ravel().astype("int32")) + imgpts = imgpts.astype("int32") img = cv.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5) img = cv.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5) img = cv.line(img, corner, tuple(imgpts[2].ravel()), (0,0,255), 5)