Nodes/opencv-comfyui/OpenCV goodFeaturesToTrack_1
ComfyUI Node

OpenCV goodFeaturesToTrack_1

The identical twin of the corner detector

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV goodFeaturesToTrack_1
  • image
  • corners
  • mask
  • nparray
maxCorners
qualityLevel
minDistance
blockSize
useHarrisDetector
k

goodFeaturesToTrack_1 is exactly the same node as goodFeaturesToTrack_0. Same inputs, same output, same algorithm. If you load both into a workflow you get the identical corner list for the identical image. There is no scenario where one gives you a better result than the other. Before you think you're missing something, let's explain why this happens - it's the most instructive quirk in the whole pack.

Why the pack has duplicates

opencv-comfyui is auto-generated: the author parsed OpenCV's Python type-stub files and generated a node for every overload of every function. cv2.goodFeaturesToTrack is declared with multiple overloads in the stub - variants that differ in their optional arguments - and the generator dutifully numbered them _0, _1, _2, _3. _0 and _1 turned out to be structurally identical overloads (they differ only in argument ordering in the stub, which collapses to the same node after wrapping). So you get twins. It's a byproduct of the method, not a feature - the README's "Expect dragons" in action.

Which to use

Pick either one. The practical advice: use goodFeaturesToTrack_0 and ignore _1, because _0 is the "canonical" first overload, and _2/_3 are the variants that add mask and gradientSize as required inputs. Keep the naming consistent in your workflows so you don't confuse yourself later - and when you share a workflow, other users will see whichever you used, so _0 is the least surprising choice.

Everything else about using it is the _0 story, in short: feed it an NPARRAY (BGR, from Image2Nparray), set maxCorners to a sane cap, qualityLevel around 0.01, minDistance in pixels, and keep useHarrisDetector off for Shi-Tomasi. The output is an N×1×2 float32 array of (x, y) corner coordinates - a point list, not an image, so don't feed it to Nparrays2Image (that's the 'NoneType' object has no attribute 'shape' error). Draw the points with the pack's circle node if you want to see them.

Install

Same pack, obviously:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

or ComfyUI Manager (search "opencv-comfyui"), then restart. Needs opencv-contrib-python; numpy/torch come with ComfyUI. No models, no keys.

The take

Don't lose sleep over which twin to grab. The duplicate is a window into how this pack was built - a generator that values completeness over curation. It also means you should expect a few other _N twins scattered around (look at goodFeaturesToTrack_2 vs _3, and the WithQuality pair). The genuinely different variants in this family are goodFeaturesToTrack_2, which adds a required mask and gradientSize, and goodFeaturesToTrackWithQuality_0, which also returns per-corner quality scores. Start with _0; only move to those when you need the extra controls.

Categoryimage/OpenCV

Inputs (9)

NameTypeDefaultDescription
imageNPARRAY
maxCornersINT
qualityLevelFLOAT
minDistanceFLOAT
blockSizeINT
useHarrisDetectorBOOLEAN
kFLOAT
cornersoptNPARRAY
maskoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY