Nodes/opencv-comfyui/OpenCV calibrationMatrixValues_1
ComfyUI Node

OpenCV calibrationMatrixValues_1

The identical twin of the FOV node — and why that's normal for this pack

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV calibrationMatrixValues_1
  • cameraMatrix
  • float_0
  • float_1
  • float_2
  • literal
  • float_4
imageSize
apertureWidth
apertureHeight

Right up front: this node is functionally identical to calibrationMatrixValues_0, the other page you've probably just come from. Same inputs, same five outputs, same math. If you're deciding which to use, the answer is "whichever one you grabbed first." The pack that ships these nodes is auto-generated from OpenCV's type definitions, and OpenCV declares every function once for cv2.typing.MatLike and once for UMat - so the generator minted two near-identical nodes and numbered them _0 and _1. That's the whole story behind the suffix, and it repeats across this pack.

So what does it actually do? It takes a 3x3 camera intrinsic matrix, an image size, and sensor aperture dimensions, and recovers the camera's physical numbers: horizontal FOV (float_0), vertical FOV (float_1), focal length in mm (float_2), principal point (literal, a Point2d printed as a string), and image aspect ratio (float_4). Camera-calibration math, exposed in the graph so the values can feed other nodes rather than living in a Python script.

Where you'd use it: any pipeline that needs to know its camera geometry - matching a generated image to a real lens, doing 3D projection or depth-aware compositing, or sanity-checking a calibration result before you trust it downstream. For everything else it's a niche utility you'll never open.

Inputs to actually set: cameraMatrix (NPARRAY, a 3x3 float matrix), imageSize (STRING, as a Python literal like (640, 480) - the node parses composite types with literal_eval, so "640x480" throws an invalid syntax error), and apertureWidth / apertureHeight (FLOAT, in mm). The one real gotcha: with aperture values at 0, FOV and focal length silently return 0. Aspect ratio still computes. That's OpenCV's behavior, not a bug.

Install is the pack-wide story: ComfyUI Manager, search "OpenCV", or

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

then restart. No model downloads. The NPARRAY in/out means you bridge from ComfyUI's RGB IMAGE tensors with Image2Nparray (batch size 1 only), and it's BGR 0..255 uint8 on the OpenCV side.

If you already read the _0 article you know everything this one does. Keep it around for one reason: if _0 ever misbehaves on your OpenCV build, _1 exists to cross-check - but honestly, expect them to behave identically. The author's own sign-off on this pack is "expect dragons," and duplicate twins are the mildest dragon of the lot.

Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
cameraMatrixNPARRAY
imageSizeSTRING
apertureWidthFLOAT
apertureHeightFLOAT

Outputs (5)

NameTypeDescription
float_0FLOAT
float_1FLOAT
float_2FLOAT
literalSTRING
float_4FLOAT