Nodes/comfyui_cv/CV ArUco Board Pose (Average)
ComfyUI Node

CV ArUco Board Pose (Average)

Estimates the pose (rotation + translation) of a planar ArUco board by solving each marker's pose independently (cv2.solvePnP, IPPE_SQUARE - exact for a coplanar square) and AVERAGING them: the rotation matrices are meaned then re-orthonormalized via SVD (a valid rotation), the translations meaned to the board centroid. Because every marker lies in the same plane its individual pose already carries the board orientation; averaging cancels per-marker detection noise. The two-fold planar-pose ambiguity is resolved per marker by keeping the solution whose normal faces the camera, so a stray flipped marker cannot corrupt the mean. Feed the rvec/tvec into cv2.projectPoints + 'Draw Polygon' to overlay a 3D object (see the ArUco cube workflow). Zero markers returns found=false with a zero pose instead of erroring - branch on 'found' with a control-flow node.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV ArUco Board Pose (Average)
  • corners
  • camera_matrix
  • dist_coeffs
  • rvec
  • tvec
  • found
marker_length1.00
Categoryimage/CV/features

Inputs (4)

NameTypeDefaultDescription
cornersNPARRAYMarker corners from 'CV ArUco Detect Markers', (N, 4, 2).
camera_matrixNPARRAY3x3 intrinsic matrix K ('CV Camera Matrix' or 'Calibrate Camera').
marker_lengthFLOAT1.000.0001–1000000Physical edge length of one marker; it sets the world unit. The returned tvec and any object you project are in these units (e.g. length 1 -> a cube of size 3 spans three markers).
dist_coeffsoptNPARRAYLens distortion coefficients; leave unconnected for an ideal pinhole camera.

Outputs (3)

NameTypeDescription
rvecNPARRAY3x1 Rodrigues rotation of the board (zeros if none found). Pass to cv2.projectPoints / drawFrameAxes.
tvecNPARRAY3x1 translation to the board centroid (zeros if none found).
foundBOOLEAN