Merge pull request #26695 from albertoZurini:py_pose_coordinates

fix: cast coordinates to int32 for compatibility with line function
This commit is contained in:
Alexander Smorkalov 2025-01-03 11:43:30 +03:00 committed by GitHub
commit 9e8b9a0ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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. **cv.findChessboardCorners()**) and **axis points** to draw a 3D axis.
@code{.py} @code{.py}
def draw(img, corners, imgpts): 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[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[1].ravel()), (0,255,0), 5)
img = cv.line(img, corner, tuple(imgpts[2].ravel()), (0,0,255), 5) img = cv.line(img, corner, tuple(imgpts[2].ravel()), (0,0,255), 5)