ComfyUI Node
CV Track Features (KLT)
Tracks corner features from frame_a into frame_b with pyramidal Lucas-Kanade optical flow (cv2.goodFeaturesToTrack + cv2.calcOpticalFlowPyrLK) - the sparse tracker behind monocular visual odometry. Both frames are grayscaled, corners are detected in frame_a and tracked into frame_b, and only confidently-tracked pairs are kept: the optical-flow status flag must be set AND (forward-backward check) re-tracking the point back into frame_a must land within fb_threshold pixels of where it started. Outputs the matched points in both frames (Nx1x2, same order), ready for 'OpenCV Recover Pose'. Finding zero trackable corners is a valid result (count = 0, empty arrays), not an error - so a VO pipeline never halts on a textureless or blank frame.
CV Track Features (KLT)
- frame_a
- frame_b
- mask
- points_a
- points_b
- count
◄max_features500►
◄quality0.010►
◄min_distance7.00►
◄win_size21►
◄max_level3►
◄fb_threshold1.0►
Categoryimage/CV/features
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_a | NPARRAY,IMAGE | Earlier frame; corners are detected here. 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. | |
| frame_b | NPARRAY,IMAGE | Later frame; resized to frame_a if sizes differ. 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. | |
| max_features | INT | 5000–10000 | Maximum corners to detect in frame_a (goodFeaturesToTrack); 0 = return all detected corners. |
| quality | FLOAT | 0.0100.0001–1 | Minimum corner quality relative to the strongest corner (qualityLevel); lower keeps weaker corners. |
| min_distance | FLOAT | 7.001–100 | Minimum spacing in pixels between detected corners. |
| win_size | INT | 213–101 | Lucas-Kanade search window (forced odd); larger tolerates bigger motion but blurs fine detail. |
| max_level | INT | 30–8 | Pyramid levels (0 = no pyramid); more levels track larger displacements. |
| fb_thresholdopt | FLOAT | 1.00–30 | Forward-backward consistency gate in pixels: a track is dropped if re-tracking it back misses its origin by more than this. 0 disables the check. |
| maskopt | NPARRAY,MASK | Optional mask: detect corners only where mask > 0. 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. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| points_a | NPARRAY | Tracked corners in frame_a, Nx1x2 float32. |
| points_b | NPARRAY | Their tracked positions in frame_b, Nx1x2 float32 (same order). |
| count | INT | — |