Nodes/comfyui_cv/CV Match Features
ComfyUI Node

CV Match Features

Matches two descriptor sets with BFMatcher or FLANN. Outputs matches sorted by distance and matched point coordinates as Nx1x2 float32 arrays, ready for 'CV Find Homography (RANSAC)' / cv2.findFundamentalMat / cv2.estimateAffine2D. Zero matches is a valid result, not an error - check the count (or the homography node's 'found' flag) downstream.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Match Features
  • keypoints_a
  • descriptors_a
  • keypoints_b
  • descriptors_b
  • matches
  • points_a
  • points_b
  • count
matcherBFMatcher
norm_typeauto
match_moderatio test (Lowe)
ratio0.75
k2
radius0.0
flann_algorithmauto
flann_trees5
flann_checks50
flann_table_number6
flann_key_size12
flann_multi_probe_level1
Categoryimage/CV/features

Inputs (16)

NameTypeDefaultDescription
keypoints_aCV_KEYPOINTSKeypoints of image A (from 'CV Detect Features').
descriptors_aNPARRAYDescriptors of image A, paired with keypoints_a. Must use the same detector as image B.
keypoints_bCV_KEYPOINTSKeypoints of image B (from 'CV Detect Features').
descriptors_bNPARRAYDescriptors of image B, paired with keypoints_b.
matcherCOMBOBFMatcherBFMatcher: brute-force, exact, fast for small/mid descriptor sets. FLANN: approximate nearest neighbors, faster for large sets (10k+ descriptors).
norm_typeCOMBOautoDistance norm. 'auto' = HAMMING for uint8 (ORB/BRISK/AKAZE), L2 for float32 (SIFT). Override only if you know what you are doing.
match_modeCOMBOratio test (Lowe)Ratio test: keep matches clearly better than the runner-up (robust default). Cross-check: keep only mutual best matches (BFMatcher only). Radius: keep all matches within max distance (all matchers).
ratioFLOAT0.750.1–1Lowe ratio threshold; lower = stricter. Ignored for cross-check and radius modes.
koptINT22–32k for kNN matching. 2 = Lowe's ratio test (standard). Higher k considers more candidates but is slower. Ignored for cross-check mode.
radiusoptFLOAT0.0Max distance for radius matching. 0 = no limit (returns all matches). Only used when mode = radius.
flann_algorithmoptCOMBOautoFLANN index algorithm. 'auto' = KDTREE for float32 descriptors, LSH for binary (uint8). Override to force a specific algorithm.
flann_treesoptINT51–16FLANN KDTREE: number of randomized trees. More = better accuracy, slower build.
flann_checksoptINT501–1000FLANN search: number of leaves to check. Higher = more accurate but slower.
flann_table_numberoptINT61–30FLANN LSH: number of hash tables. Only used for binary descriptors.
flann_key_sizeoptINT124–32FLANN LSH: key bits per table. Only used for binary descriptors.
flann_multi_probe_leveloptINT10–5FLANN LSH: extra search probes per table. 0 = standard LSH, higher = more accurate.

Outputs (4)

NameTypeDescription
matchesCV_MATCHES
points_aNPARRAYMatched keypoint coordinates in image A, Nx1x2 float32.
points_bNPARRAYMatched keypoint coordinates in image B, Nx1x2 float32.
countINT