Nodes/opencv-comfyui/OpenCV estimateAffine3D_3
ComfyUI Node

OpenCV estimateAffine3D_3

EstimateAffine3D_3 — the twin of _2, same rigid alignment, same output

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV estimateAffine3D_3
  • src
  • dst
  • nparray
  • float
force_rotation

Short version: estimateAffine3D_3 is a duplicate of estimateAffine3D_2. Same inputs, same outputs, same code. In the opencv-comfyui (geroldmeisinger/opencv-comfyui) pack, nodes are auto-generated per OpenCV function overload and numbered _0, _1, etc. - and when two stub overloads are near-identical, you get two identical nodes. There's nothing to choose between; grab _2 and ignore this page's twin.

What it does

Estimates a 3D similarity transform - rotation, translation, and one uniform scale - that aligns one set of 3D points onto another. This is the force_rotation overload of cv2.estimateAffine3D, and its distinguishing feature is that it reports the scale as a separate float output. Real use cases: fitting a 3D model to a scan, registering point clouds captured at different scales, camera pose problems. Deterministic geometry, no model involved - and honestly niche for ComfyUI.

Inputs and outputs

  • src (NPARRAY) - source 3D points, N×3.
  • dst (NPARRAY) - matching destination 3D points, N×3.
  • force_rotation (BOOLEAN) - True requires a proper rotation (no reflection); False allows reflection when a strict rotation can't align the sets. Keep it True if you know the motion is a real rotation.
  • Outputs: nparray - the 3×4 transform (rotation + translation); float - the estimated uniform scale.

Wiring it up

Same as _2: you supply N×3 point arrays as nparrays, and you get a matrix plus a number. Neither output is a displayable image - running them into Nparrays2Image triggers the pack's 'NoneType' object has no attribute 'shape' error, which is what happens when you treat a non-image nparray as an image. If you don't already have 3D point data, skip this family; for 2D work the estimateAffine2D nodes are the practical choice.

Install and gotchas

Via ComfyUI Manager (search "opencv-comfyui") or git clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, then restart. Requirements: opencv-contrib-python, numpy, torch; no model files. Standard pack traps: Image2Nparray is batch_size-1 only, string composite params are Python literals, and the author's "Expect dragons!" warning covers the whole auto-generated pack. Full detail lives on the estimateAffine3D_2 page.

Categoryimage/OpenCV

Inputs (3)

NameTypeDefaultDescription
srcNPARRAY
dstNPARRAY
force_rotationBOOLEAN

Outputs (2)

NameTypeDescription
nparrayNPARRAY
floatFLOAT