Nodes/opencv-comfyui/OpenCV drawFrameAxes_0
ComfyUI Node

OpenCV drawFrameAxes_0

Draw a 3D axis frame onto a photo — the pose checker

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV drawFrameAxes_0
  • image
  • cameraMatrix
  • distCoeffs
  • rvec
  • tvec
  • nparray
length
thickness

drawFrameAxes_0 is the node that makes camera-pose estimation legible. It takes a photo, the camera's intrinsics, and the rotation and translation vectors that solvePnP produced for some object in the scene - then draws the object's 3D coordinate frame right onto the image: red X axis, green Y axis, blue Z axis. That's how you look at a pose estimate instead of squinting at four numbers.

When you'd actually use this

This is a calibration / AR / robot-vision primitive, not a post-processing effect. The workflow it belongs to is the classic OpenCV pose pipeline: detect known points in an image (findChessboardCorners or ArUco markers), call solvePnP with a known 3D model to get rvec and tvec, and then draw the frame to sanity-check that the pose is plausible before doing anything with it. If your ComfyUI graph is doing camera calibration or pose estimation, this node is the "show me it worked" step. If it isn't, you'll never touch it - and that's fine.

The inputs map straight onto cv2.drawFrameAxes:

  • image - the frame as an NPARRAY.
  • cameraMatrix - the 3x3 intrinsics matrix (fx, 0, cx / 0, fy, cy / 0, 0, 1) as an NPARRAY.
  • distCoeffs - the distortion coefficients vector (a single-row array; zeros [[0,0,0,0,0]] if you're assuming an ideal lens).
  • rvec and tvec - the rotation and translation vectors from solvePnP.
  • length - how long the axes are, in the same units as your 3D points. This one's fiddly: too small and the frame vanishes into the scene, too big and it pins the frame to the lens.
  • thickness - line thickness in pixels.

Output is a single nparray - the annotated image - which you view through Nparrays2Image.

Install and the _0 thing

It's in opencv-comfyui (geroldmeisinger). ComfyUI Manager → search OpenCV, or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib

Restart ComfyUI. requirements.txt is opencv-contrib-python, numpy, torch - no model files.

_0/_1 are the usual MatLike/UMat overload twins and are interchangeable.

Gotchas

Every node in this pack needs its images as NPARRAY via Image2Nparray (RGB 0..1 → BGR 0..255), supports only batch_size==1, and expects composite arguments as valid Python literals - so a malformed input string shows up as invalid syntax (<unknown>, line 0). If your frame looks like garbage, check cameraMatrix first: transposing it (row vs. column-major confusion from whatever node produced it) is the classic cause of axes pointing nowhere near the object.

Honest verdict: niche, but it's the right tool for its niche. If you're doing pose work in ComfyUI, this is the visualization you'll reach for; otherwise file it under "exists."

Categoryimage/OpenCV

Inputs (7)

NameTypeDefaultDescription
imageNPARRAY
cameraMatrixNPARRAY
distCoeffsNPARRAY
rvecNPARRAY
tvecNPARRAY
lengthFLOAT
thicknessINT

Outputs (1)

NameTypeDescription
nparrayNPARRAY