Nodes/opencv-comfyui/OpenCV findFundamentalMat_2
ComfyUI Node

OpenCV findFundamentalMat_2

The older, simpler fundamental matrix — no maxIters knob

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV findFundamentalMat_2
  • points1
  • points2
  • mask
  • nparray_0
  • nparray_1
method
ransacReprojThreshold
confidence

OpenCV findFundamentalMat_2 is the older, shorter signature of the fundamental-matrix estimator. Where _0 takes six arguments, _2 drops the last one: its inputs are points1, points2, method, ransacReprojThreshold, confidence, and an optional mask. No maxIters. That's the entire difference - this overload corresponds to the classic OpenCV signature that predates the RANSAC iteration-cap parameter, and the pack generated a node for it because it found the old overload in the type stubs next to the new one.

Functionally it's the same math with one less knob. RANSAC's iteration cap gets a library default instead of one you set, and in practice for typical correspondence sets you won't notice. If a downloaded workflow uses _2, leave it - it works. If you're building fresh and have a preference, _0 gives you one more dial and is the newer API.

What it does

Computes the fundamental matrix F between two uncalibrated camera views from matched points in pixel coordinates - no intrinsics, no calibration. RANSAC (method = 8) is the sane default; 4 (LMEDS) and 2/1 (8-point/7-point) exist for the textbook cases. ransacReprojThreshold (3.0) sets how tolerant RANSAC is about point positions. Outputs are nparray_0 (the 3x3 matrix) and nparray_1 (inlier mask) - geometry, not images, so don't feed them to Nparrays2Image and expect a picture.

The usual caveats

Matching points are on you. This node estimates the matrix from correspondences you provide; it can't find them, and the pack skips feature-matcher classes (it only wraps top-level functions), so cross-view matching usually happens outside ComfyUI. Also remember the pack's data flow: everything enters as NPARRAY through Image2Nparray and leaves as NPARRAY, batch size 1 only. If your two views have different batch counts or you're feeding ComfyUI IMAGEs directly, nothing will connect - the sockets won't even match.

Install

Part of geroldmeisinger/opencv-comfyui. ComfyUI Manager → search opencv-comfyui → install → restart, or:

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

requirements.txt installs opencv-contrib-python, numpy, torch. A missing or duplicated cv2 install kills the pack at startup - the Cannot import name 'guidedFilter' error is the usual symptom of two OpenCV packages fighting.

findFundamentalMat_3 is the byte-identical UMat twin of _2 - same signature, same behavior, pick either. And _0/_1 are the newer-with-maxIters flavor of the same function if you want the extra knob.

Categoryimage/OpenCV

Inputs (6)

NameTypeDefaultDescription
points1NPARRAY
points2NPARRAY
methodINT
ransacReprojThresholdFLOAT
confidenceFLOAT
maskoptNPARRAY

Outputs (2)

NameTypeDescription
nparray_0NPARRAY
nparray_1NPARRAY