OpenCV findHomography_1
FindHomography_0's twin — perspective warp, pick your sticker
- srcPoints
- dstPoints
- mask
- nparray_0
- nparray_1
OpenCV findHomography_1 is findHomography_0 with a different number and nothing else. Same inputs - srcPoints, dstPoints, method, ransacReprojThreshold, maxIters, confidence, optional mask - same cv2.findHomography call, same outputs: nparray_0 is the 3x3 homography matrix, nparray_1 the inlier mask. OpenCV declares each function twice in its type stubs (MatLike and UMat), and this pack auto-generates a node for every overload, so you get pairs. Functionally identical, both ways.
So the real content here is the same as _0: estimate a perspective transform between two views of a planar scene from matched points, RANSAC (method = 8) if there are wrong matches, ransacReprojThreshold at 3.0 for the tolerance. Then feed the resulting matrix into this pack's warpPerspective to actually apply the warp.
Why the duplicate matters for your sanity
The _0/_1 twin pattern is everywhere in this pack, and once you know it, duplicate node numbers stop being scary. If a downloaded workflow references findHomography_1 and you only see _0, wire in _0 and don't think twice. The pack's README is honest that these nodes are auto-generated, ugly, and "expect dragons" - the duplicates are a side effect of that pipeline, not hidden features.
The practical notes
- The homography only works for coplanar scenes. Two photos of the same flat surface (document, facade, screen) map cleanly; anything with real depth between the views will come out wrong, and that's geometry, not a bug.
srcPoints/dstPointsmust be matched correspondences, at least four of them. This node estimates the matrix; it doesn't find the points.- Both outputs are
NPARRAYs of geometry. Trying to preview the matrix throughNparrays2Imagethrows the pack's signature'NoneType' object has no attribute 'shape'error - the output isn't a picture, it's a transform.
Install
Same pack as always. 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. If the pack fails to load at startup, the cause is almost always a broken cv2 import - conflicting OpenCV installs (the guidedFilter error is the tell) or none at all.
Reach for _0 or _1, your choice; then point warpPerspective at the matrix and watch your skewed photo straighten out.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| srcPoints | NPARRAY | — | |
| dstPoints | NPARRAY | — | |
| method | INT | — | |
| ransacReprojThreshold | FLOAT | — | |
| maxIters | INT | — | |
| confidence | FLOAT | — | |
| maskopt | NPARRAY | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| nparray_0 | NPARRAY | — |
| nparray_1 | NPARRAY | — |