Nodes/comfyui_cv/CV Find Homography (RANSAC)
ComfyUI Node

CV Find Homography (RANSAC)

Estimates the homography between two matched point sets (cv2.findHomography). Robust by design: with too few points or a degenerate configuration it does NOT fail the workflow - it returns found=false, an identity homography (safe to feed into perspectiveTransform/warpPerspective) and 0 inliers. 'found' is true only when the estimate has at least min_inliers RANSAC inliers - branch on it with a control-flow node (e.g. Basic data handling's 'if/else') to bypass drawing or compositing when nothing was found.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Find Homography (RANSAC)
  • points_a
  • points_b
  • homography
  • inlier_mask
  • inlier_count
  • found
methodRANSAC
reproj_threshold3.0
min_inliers10
Categoryimage/CV/features

Inputs (5)

NameTypeDefaultDescription
points_aNPARRAYSource points, Nx1x2 (from 'CV Match Features').
points_bNPARRAYDestination points, Nx1x2.
methodCOMBORANSACRobust estimator. RANSAC is the standard choice for feature matches (which always contain outliers).
reproj_thresholdFLOAT3.00.1–100Maximum reprojection error in pixels for a match to count as an inlier.
min_inliersINT104–10000Minimum RANSAC inliers for 'found' to be true. Raise it to reject false positives.

Outputs (4)

NameTypeDescription
homographyNPARRAY3x3 float64 matrix mapping points_a to points_b (identity if not found).
inlier_maskNPARRAYNx1 uint8: 1 = inlier. Feed into 'CV Draw Matches'.
inlier_countINT
foundBOOLEAN