Nodes/opencv-comfyui/OpenCV recoverPose_5
ComfyUI Node

OpenCV recoverPose_5

The twin of the focal-length pose node

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV recoverPose_5
  • E
  • points1
  • points2
  • R
  • t
  • mask
  • int
  • nparray_1
  • nparray_2
  • nparray_3
focal
pp

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

  1. pp is a string literal. It's parsed with ast.literal_eval, so write it as a real Python tuple: (640, 360). Miss the parens or quote it and you get invalid syntax (<unknown>, line 0) - the pack's signature error, and purely cosmetic to fix.
  2. Garbage in, confident garbage out. If your E isn't a genuine essential matrix or your points aren't real matches, this node returns a tidy-looking R/t that means nothing. The int output 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.

Categoryimage/OpenCV

Inputs (8)

NameTypeDefaultDescription
ENPARRAY
points1NPARRAY
points2NPARRAY
focalFLOAT
ppSTRING
RoptNPARRAY
toptNPARRAY
maskoptNPARRAY

Outputs (4)

NameTypeDescription
intINT
nparray_1NPARRAY
nparray_2NPARRAY
nparray_3NPARRAY