fix: cast coordinates to int32 for compatibility with line function

This commit is contained in:
Alberto Zurini 2025-01-01 21:13:40 +01:00
parent 4d26e16af8
commit f2878eb337

View File

@ -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)