Nodes/opencv-comfyui/OpenCV undistortImagePoints_1
ComfyUI Node

OpenCV undistortImagePoints_1

UndistortImagePoints_1 — the points-image twin, for calibration completists

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV undistortImagePoints_1
  • src
  • cameraMatrix
  • distCoeffs
  • dst
  • nparray
arg1

undistortImagePoints_1 is the numbered twin of undistortImagePoints_0, and the two are the same node: same cv2.undistortImagePoints function, expanded twice by the pack's overload generator. Same inputs, same output, nothing to choose between them. The number is an artifact of OpenCV's type stubs declaring multiple overloads; it doesn't select different behavior here.

So what is the function, and should you care? It corrects lens distortion on an image whose pixels are point coordinates rather than brightness values - a dense grid of feature positions gets the whole camera's distortion applied or removed in one operation. That's a calibration-pipeline tool, useful when you've encoded a sampling grid as an image and want the lens math done vectorized instead of point-by-point. It is emphatically not for photographs. Real images get the ordinary undistort node; lists of coordinates get undistortPoints. This one sits between them and serves a narrow audience.

Inputs and outputs that matter

  • src (NPARRAY) - the points-image.
  • cameraMatrix (NPARRAY) - 3×3 intrinsics.
  • distCoeffs (NPARRAY) - distortion coefficients.
  • arg1 (STRING) - the generator's name for the extra composite argument, parsed with ast.literal_eval. Passing None (valid Python literal) falls back to defaults; anything malformed throws the pack-wide invalid syntax (<unknown>, line 0).

Optional dst is the out-parameter - leave it unwired. Output is one nparray.

Installation

The pack installs once and covers both twins: ComfyUI Manager (search "OpenCV"), or git clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, restart. Needs opencv-contrib-python (pip install opencv-contrib-python). No models to download.

Common issues

Beyond the usual pack rules (NPARRAY, batch size 1, Image2Nparray/Nparrays2Image at the edges), the two real gotchas are the literal string (arg1 must parse as Python, so None or a proper tuple - a typo means invalid syntax) and the fundamental scope mismatch: feed it a normal image and you'll get back numbers-as-colors nonsense. This node and its twin are the definition of "present because the pack generates everything" - skip them unless a calibration pipeline actually needs them.

Categoryimage/OpenCV

Inputs (5)

NameTypeDefaultDescription
srcNPARRAY
cameraMatrixNPARRAY
distCoeffsNPARRAY
arg1STRING
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY