Nodes/opencv-comfyui/OpenCV drawChessboardCorners_1
ComfyUI Node

OpenCV drawChessboardCorners_1

The other chessboard-corner drawer — and why it's identical

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV drawChessboardCorners_1
  • image
  • corners
  • nparray
patternSize
patternWasFound

If you searched for this node because you saw drawChessboardCorners_1 in a workflow and wondered whether it's the "better" version, stop: it isn't. _1 is byte-for-byte the same wrapper as drawChessboardCorners_0, just the second overload. OpenCV ships most of its functions twice - cv2.typing.MatLike and cv2.UMat - and this pack's generator (which parses the type stubs and emits a node per signature) dutifully made one of each. Same inputs, same output, same behavior. You can use either and never notice the difference.

What it does, in case you landed here cold

It draws chessboard-calibration corners onto an image: green circles with connecting lines when patternWasFound is true, red when false. It's the "did my camera calibration detect correctly?" step, paired with findChessboardCorners from the same pack. The inputs:

  • image - the photo as an NPARRAY.
  • patternSize - a literal like (9, 6) giving the interior corner grid (columns, rows). Must match the detection node's setting.
  • corners - the detected corner points, straight from findChessboardCorners.
  • patternWasFound - that node's boolean return, which chooses green or red.

One nparray output - the annotated image - which you'll route through Nparrays2Image to view.

Installing it

Same pack, same drill: opencv-comfyui by 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; there are no weights to fetch.

The gotchas that still apply

The patternSize field is parsed as a Python literal, so (9, 6) works and a bare 9, 6 throws invalid syntax (<unknown>, line 0) - that error message is the pack's signature, and it's almost always a malformed literal. And every node here only accepts batch_size==1 images, so if Image2Nparray throws Only images with batch_size==1 are supported!, insert an ImageFromBatch node with length 1.

One more thing worth knowing: in OpenCV's C++ docs the color encoding is fixed - green means the pattern was found, red means it wasn't - and the corners get drawn in the image's own color space. Since this pack's NPARRAY pipeline is BGR (from Image2Nparray), the drawing is consistent; you don't need to do anything special. Just pick _0 or _1, wire it, and look at the result.

Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
imageNPARRAY
patternSizeSTRING
cornersNPARRAY
patternWasFoundBOOLEAN

Outputs (1)

NameTypeDescription
nparrayNPARRAY