Nodes/opencv-comfyui/OpenCV SVBackSubst_1
ComfyUI Node

OpenCV SVBackSubst_1

SVBackSubst_1 — same SVD solve, second overload

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV SVBackSubst_1
  • w
  • u
  • vt
  • rhs
  • dst
  • nparray

Straight to it: SVBackSubst_1 is a byte-for-byte twin of SVBackSubst_0. Same generated wrapper, same cv2.SVBackSubst call, same four inputs and same output. The suffix is just the overload counter from OpenCV's type stubs, and this pack ships the duplicates instead of deduplicating. Use whichever; nothing changes.

What it does is solve a linear system from a precomputed SVD: feed it the singular values w, the left singular vectors u, the transposed right singular vectors vt, and a right-hand side rhs, and it returns x where A·x = rhs. It's the numerically stable way to solve - far more robust than inverting A blindly when the matrix is near-singular - and it pairs naturally with SVDecomp_0 (also in this pack), which produces the w, u, vt factors in the first place.

Realistic use in a ComfyUI workflow: you're doing actual matrix math. Least-squares fitting, pseudo-inverse computation, solving systems built from point correspondences, or the A·x = b step after a stereo or homography computation. All inputs are NPARRAY hand-built in numpy; there's no image content, no friendly widgets, and no tensor support - the whole node is raw cv2 with zero polish, which is exactly what the pack promises ("Expect dragons!" is the author's own line). If you're not already comfortable with SVD, this node will feel like homework; if you are, it's the cleanest way to get a stable solve into a graph.

Inputs and output. w, u, vt, rhs (all NPARRAY) and an optional dst you can ignore. Output is a single nparray, the solution. Shape mismatches throw cv2 assertion errors - this node validates nothing for you.

Install. ComfyUI Manager → search "opencv-comfyui", or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

restart. Needs opencv-contrib-python, numpy, torch; if startup throws Cannot import name 'guidedFilter' from 'cv2.ximgproc', fix the conflicting OpenCV installs first.

Categoryimage/OpenCV

Inputs (5)

NameTypeDefaultDescription
wNPARRAY
uNPARRAY
vtNPARRAY
rhsNPARRAY
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY