Nodes/comfyui_cv/CV Recover Pose (Essential Matrix)
ComfyUI Node

CV Recover Pose (Essential Matrix)

Recovers the relative pose (rotation + translation DIRECTION) between two CALIBRATED views of a static scene from matched points and the camera matrix - the core step of two-view structure-from-motion and monocular visual odometry. It estimates the essential matrix (cv2.findEssentialMat, RANSAC) and decomposes it with the cheirality check (cv2.recoverPose), keeping the rotation/translation for which the inliers lie in FRONT of both cameras. Translation is a UNIT vector: monocular geometry fixes direction, not absolute scale. Same failure-tolerant contract as 'CV Find Fundamental Matrix': fewer than 5 points, a degenerate configuration or too few inliers returns found=false, an identity rotation and a zero translation instead of halting - branch on 'found' with a control-flow node. Note: a pure rotation (no camera translation) or a single plane is degenerate; use views with depth and a translated camera. Feed rotation + translation into 'CV Triangulate Points (Two-View)'.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Recover Pose (Essential Matrix)
  • points_a
  • points_b
  • camera_matrix
  • rotation
  • translation
  • inlier_mask
  • inlier_count
  • found
methodRANSAC
threshold1.0
confidence0.999
min_inliers15
Categoryimage/CV/features

Inputs (7)

NameTypeDefaultDescription
points_aNPARRAYPoints in view 1, Nx1x2 (from 'CV Match Features').
points_bNPARRAYCorresponding points in view 2, Nx1x2.
camera_matrixNPARRAY3x3 intrinsic matrix K shared by both views ('CV Camera Matrix' or 'Calibrate Camera').
methodCOMBORANSACRobust estimator for the essential matrix. RANSAC is the standard choice for feature matches.
thresholdFLOAT1.00.1–100Max distance in pixels from a point to its epipolar line to count as an inlier (RANSAC).
confidenceFLOAT0.9990.5–1Desired probability that the estimate is correct (RANSAC/LMedS).
min_inliersINT155–10000Minimum cheirality-consistent inliers for 'found' to be true. Raise it to reject accidental fits.

Outputs (5)

NameTypeDescription
rotationNPARRAY3x3 float64 rotation R mapping view-1 directions into view 2 (identity if not found).
translationNPARRAY3x1 float64 UNIT translation (camera-2 origin in view-1 frame, up to scale; zero if not found).
inlier_maskNPARRAYNx1 uint8: 1 = point used in the recovered pose. Feed into 'CV Filter Points By Mask' / 'Draw Matches'.
inlier_countINT
foundBOOLEAN