OpenCV findFundamentalMat_0
Relate two camera views with zero calibration — the fundamental matrix
- points1
- points2
- mask
- nparray_0
- nparray_1
The fundamental matrix is the essential matrix's uncalibrated cousin, and it's the one you can actually use without knowing anything about your camera. Given matching points in two views, cv2.findFundamentalMat computes the 3x3 matrix F that relates them purely in pixel coordinates - no intrinsics, no focal length, no calibration session with a checkerboard. If you've got two frames of the same scene and nothing but raw pixel correspondences, this node is where you start.
OpenCV findFundamentalMat_0 is that function wrapped for ComfyUI, in its full-signature form: (points1, points2, method, ransacReprojThreshold, confidence, maxIters, mask).
Inputs
points1/points2- matching points across the two views,NPARRAY(Nx1x2orNx2). The matching is on you - this node estimates the matrix, it doesn't find correspondences.method- the estimation method, as an int.8= RANSAC (your default; it tolerates wrong matches),4= LMEDS (robust, slower),2= 8-point,1= 7-point (least points but very sensitive to noise). For anything real, use8.ransacReprojThreshold- how far (in pixels) a match can be off and still count as an inlier. Default3.0is a sane starting point.confidence- RANSAC confidence,0.99+ default. Leave it.maxIters- RANSAC iteration cap; 1000 is plenty for a few hundred points.
Outputs: nparray_0 is the 3x3 fundamental matrix F, nparray_1 is the inlier mask. Neither is an image - this is the pack's classic trap, and you'll know it when you try to preview the output and hit 'NoneType' object has no attribute 'shape'.
What you'd use it for
Epipolar geometry, mostly: F lets you constrain where a point in one view must appear in the other (the epipolar line), which powers stereo rectification, dense matching, and structure-from-motion. In a ComfyUI workflow you're most likely to reach for it when you want to check whether two frames were shot from the same viewpoint, or when you're building the correspondence stage of a 3D-ish pipeline and need a robust model of the two-view relationship.
One honest caveat: this pack has near-zero community footprint - nobody is posting polished workflows built on the geometry nodes, because assembling the matched-point arrays by hand is real work. Treat it as a raw tool, not a drag-and-drop magic box. If you just need to align or warp an image, findHomography is the friendlier choice; F is about relationships between views, not warping one onto the other.
Install
ComfyUI Manager → search opencv-comfyui → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
requirements.txt installs opencv-contrib-python, numpy, torch. The pack imports cv2 at load, so a broken OpenCV install nukes the whole pack at startup - duplicate-package conflicts show up as Cannot import name 'guidedFilter' from 'cv2.ximgproc'. And remember the Image2Nparray/Nparrays2Image dance: this node speaks numpy NPARRAY, not ComfyUI IMAGE, and it only handles batch_size == 1.
findFundamentalMat_1 is this node's byte-identical UMat twin; pick either. The _2/_3 pair is the same math without the maxIters parameter, from an older OpenCV signature - _0 here is the one to prefer.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| points1 | NPARRAY | — | |
| points2 | NPARRAY | — | |
| method | INT | — | |
| ransacReprojThreshold | FLOAT | — | |
| confidence | FLOAT | — | |
| maxIters | INT | — | |
| maskopt | NPARRAY | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| nparray_0 | NPARRAY | — |
| nparray_1 | NPARRAY | — |