Nodes/opencv-comfyui/OpenCV estimateAffine3D_1
ComfyUI Node

OpenCV estimateAffine3D_1

EstimateAffine3D_1 — the twin you can safely ignore

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV estimateAffine3D_1
  • src
  • dst
  • out
  • inliers
  • int
  • nparray_1
  • nparray_2
ransacThreshold
confidence

estimateAffine3D_1 is the exact same node as estimateAffine3D_0. Same inputs, same outputs, same generated code. This is the overload-numbering artifact of opencv-comfyui (geroldmeisinger/opencv-comfyui): the pack parses OpenCV's type stubs, sees cv2.estimateAffine3D declared with a couple of near-identical signatures, and emits one node per overload - hence _0 and _1. Use _0. This page exists so you don't spend ten minutes trying to figure out what's different.

What it does

Finds the 3D affine transform (rotation, translation, scale) that aligns one set of 3D points onto a matching set, using RANSAC to throw out bad correspondences. The domain is 3D geometry - camera pose estimation, point-cloud registration, reconstruction work - not image art. Deterministic math, no model involved.

Inputs and outputs

  • src (NPARRAY) - source 3D points, N×3.
  • dst (NPARRAY) - matching destination 3D points, N×3.
  • ransacThreshold (FLOAT) - inlier tolerance for RANSAC; ~3.0 default, scale it to your point units.
  • confidence (FLOAT) - RANSAC confidence, 0.99 default.
  • out (NPARRAY, optional), inliers (NPARRAY, optional) - out-parameters; leave them unconnected.
  • Outputs: int - success flag (1 = fit succeeded, 0 = failed); nparray_1 - the 3×4 affine transform; nparray_2 - inlier mask.

Wiring it up

Same as _0: you construct N×3 point arrays and feed them in as nparrays. None of the outputs are displayable images - don't run them into Nparrays2Image or you'll hit the pack's 'NoneType' object has no attribute 'shape' error, which fires when you treat a non-image nparray (like a 1-D mask or a matrix) as an image. If you don't already have 3D point data in your workflow, this node (and its whole family) is skippable. For 2D image alignment, estimateAffine2D_0 is the more useful sibling.

Install

Via ComfyUI Manager (search "opencv-comfyui") or git clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, then restart. Requires opencv-contrib-python (plus numpy and torch in the pack's requirements); no model files to download. Standard pack gotchas apply - batch_size-1 images only, Python-literal strings for composite params, and the author's own "Expect dragons!" warning about the auto-generated, raw-enum UI.

Categoryimage/OpenCV

Inputs (6)

NameTypeDefaultDescription
srcNPARRAY
dstNPARRAY
ransacThresholdFLOAT
confidenceFLOAT
outoptNPARRAY
inliersoptNPARRAY

Outputs (3)

NameTypeDescription
intINT
nparray_1NPARRAY
nparray_2NPARRAY