OpenCV recoverPose_5
The twin of the focal-length pose node
- E
- points1
- points2
- R
- t
- mask
- int
- nparray_1
- nparray_2
- nparray_3
recoverPose_5 is recoverPose_4's identical twin - same cv2.recoverPose call, same E + points + focal + pp signature, same outputs. This pack auto-generates a node per OpenCV overload stub, and for this overload the stubs were indistinguishable, so you get two copies that behave exactly the same. Read the _4 page; it all applies here.
Quick recap of the node itself: you feed it an essential matrix E, matched 2D points from two views, the camera's focal length in pixels, and the principal point pp (the image-center-ish pixel where the optical axis lands). It decomposes E into the rotation R and translation t between the two cameras, picking the geometrically valid pose from the four mathematical candidates. Outputs: int (consistent-point count), nparray_1 (R), nparray_2 (t), nparray_3 (inlier mask).
The two things that bite
ppis a string literal. It's parsed withast.literal_eval, so write it as a real Python tuple:(640, 360). Miss the parens or quote it and you getinvalid syntax (<unknown>, line 0)- the pack's signature error, and purely cosmetic to fix.- Garbage in, confident garbage out. If your
Eisn't a genuine essential matrix or your points aren't real matches, this node returns a tidy-lookingR/tthat means nothing. Theintoutput is your only sanity signal - a low inlier count means your inputs were bad, not that the camera just isn't moving.
The standing caveat for the whole recoverPose family also applies: it needs matched points and calibration you must source yourself. This is 3D-vision tooling in a ComfyUI wrapper, not an image filter. The _4/_5 overload is the friendliest of the four if your calibration is just focal length plus a roughly-centered principal point.
recoverPose_5 vs recoverPose_4 - genuinely no difference. Pick either; the graph won't know.
Install
No models, no downloads - OpenCV is the only real dependency:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python
Or search "OpenCV" in ComfyUI Manager, restart, find it under image/OpenCV. batch_size==1 only; a guidedFilter import error at load means conflicting OpenCV packages, with the fix linked in the README.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| E | NPARRAY | — | |
| points1 | NPARRAY | — | |
| points2 | NPARRAY | — | |
| focal | FLOAT | — | |
| pp | STRING | — | |
| Ropt | NPARRAY | — | |
| topt | NPARRAY | — | |
| maskopt | NPARRAY | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| int | INT | — |
| nparray_1 | NPARRAY | — |
| nparray_2 | NPARRAY | — |
| nparray_3 | NPARRAY | — |