Nodes/comfyui_cv/CV Detect Corners
ComfyUI Node

CV Detect Corners

Descriptor-free corner detectors: cv2.FastFeatureDetector and cv2.GFTTDetector (Shi-Tomasi or Harris scoring). These are cv2 CLASSES - the raw cv2_goodFeaturesToTrack wrapper returns bare points, while these return proper KEYPOINTS with a response, so they chain into 'CV Draw Keypoints', 'CV Compute Descriptors' and the matching nodes, and FAST has no function form at all. Use FAST when you need thousands of corners per millisecond (tracking, SLAM front-ends) and GFTT when you want a bounded, well-spread set (the classic KLT seed). Finding nothing is a valid result (count = 0).

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Detect Corners
  • image
  • keypoints
  • points
  • sizes
  • responses
  • count
detectorGFTT (Shi-Tomasi)
threshold10
non_max_suppressiontrue
max_features500
quality_level0.010
min_distance10
fast_type9/16 (default)
block_size3
harris_k0.04
Categoryimage/CV/features

Inputs (10)

NameTypeDefaultDescription
imageNPARRAY,IMAGEImage to search (converted to grayscale internally). Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
detectorCOMBOGFTT (Shi-Tomasi)FAST: very fast, unbounded count, driven by 'threshold'. GFTT Shi-Tomasi: bounded, evenly spread, driven by max_features/quality_level/min_distance. GFTT Harris: same but scored with the Harris measure (harris_k), which prefers sharper corners.
thresholdINT101–255FAST only: how much brighter/darker the arc of pixels around a candidate must be. Lower = many more corners.
non_max_suppressionBOOLEANtrueFAST only: keep only the locally strongest corner instead of every pixel that passes the test.
max_featuresINT5001–100000GFTT only: keep at most this many of the strongest corners.
quality_levelFLOAT0.0100.0001–1GFTT only: minimum corner score as a FRACTION of the best corner's score. 0.01 keeps everything within 1% of the best; raise it to keep only strong corners.
min_distanceFLOAT100–1000GFTT only: minimum spacing in pixels between kept corners - this is what spreads them over the image.
fast_typeoptCOMBO9/16 (default)FAST only: how many of the 16 ring pixels must agree. 9/16 is the standard; shorter arcs fire more often.
block_sizeoptINT31–31GFTT only: neighbourhood size used to compute the corner score (forced odd).
harris_koptFLOAT0.040.001–0.5GFTT Harris only: the free parameter k of the Harris response det(M) - k*trace(M)^2.

Outputs (5)

NameTypeDescription
keypointsCV_KEYPOINTScv2.KeyPoint list - draw with 'CV Draw Keypoints', or give them descriptors with 'CV Compute Descriptors' to feed 'CV Match Features'.
pointsNPARRAYNx2 float32 (x, y) centres - the point-set form for 'OpenCV Draw Points', k-means, polar conversion, ...
sizesNPARRAY(N,) float32 keypoint diameter in pixels.
responsesNPARRAY(N,) float32 detector strength per keypoint - threshold it to keep only the strong ones.
countINTHow many were found; 0 is a valid result, not an error.