draw detectedMarkers

This commit is contained in:
2025-11-24 21:53:21 +01:00
parent 92f55249b9
commit 4431f3a574
3 changed files with 12 additions and 3 deletions
+3 -2
View File
@@ -64,6 +64,9 @@ def process(detector: cv.aruco.ArucoDetector, board, img, mtx, dist): # Load pre
detector.refineDetectedMarkers(img, board, corners, ids, rejected, mtx, dist)
# Draw a square around the markers
cv.aruco.drawDetectedMarkers(img, corners)
if len(corners) > 0:
# Estimate pose of each marker and return the values rvec and tvec---(different from those of camera coefficients)
pose, rvec, tvec = cv.aruco.estimatePoseBoard(corners, ids, board, mtx, dist, None, None)
@@ -72,8 +75,6 @@ def process(detector: cv.aruco.ArucoDetector, board, img, mtx, dist): # Load pre
# Draw Axis
cv.drawFrameAxes(img, mtx, dist, rvec, tvec, 0.02)
# Draw a square around the markers
cv.aruco.drawDetectedMarkers(img, corners)
cv.imshow('img', img)