ComfyUI Node
CV Detect Blobs
cv2.SimpleBlobDetector: finds compact bright-or-dark spots by thresholding the image at many levels and keeping the regions that stay stable across them, then filtering by SHAPE. That shape filtering is what a threshold + findContours chain does not give you: area, circularity (how round), convexity (how dented) and inertia ratio (how elongated) in one pass. Classic uses: counting cells, dots, holes, bubbles or calibration targets. SimpleBlobDetector is a cv2 class the raw wrappers cannot expose. It produces no descriptors - run 'CV Compute Descriptors' if the blobs must be matched. Finding nothing is a valid result (count = 0).
CV Detect Blobs
- image
- keypoints
- points
- sizes
- responses
- count
◄blob_colordark blobs on a light background►
◄min_area25►
◄max_area5000►
◄min_circularity0.00►
◄min_convexity0.00►
◄min_inertia0.00►
◄min_threshold50►
◄max_threshold220►
◄threshold_step10►
◄min_repeatability2►
◄min_distance10►
Categoryimage/CV/features
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | NPARRAY,IMAGE | Image 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. | |
| blob_color | COMBO | dark blobs on a light background | Polarity of the blobs. Pick the wrong one and the detector returns nothing - this is the first thing to flip when count is 0. |
| min_area | FLOAT | 250–10000000 | Smallest blob area in PIXELS. 0 disables the lower bound. Raise it to ignore speckle noise. |
| max_area | FLOAT | 50000–10000000 | Largest blob area in pixels. 0 means NO upper limit (the area filter is then one-sided). |
| min_circularity | FLOAT | 0.000–1 | Minimum 4*pi*area / perimeter^2: 1.0 is a perfect circle, ~0.79 a square. 0 disables the filter. |
| min_convexity | FLOAT | 0.000–1 | Minimum area / convex-hull area: 1.0 is fully convex, lower values allow dents and crescents. 0 disables the filter. |
| min_inertia | FLOAT | 0.000–1 | Minimum inertia ratio (short axis / long axis): 1.0 is a circle, near 0 is a thin streak. 0 disables the filter - raise it to reject elongated smears. |
| min_thresholdopt | FLOAT | 500–255 | First grayscale threshold of the sweep. |
| max_thresholdopt | FLOAT | 2200–255 | Last grayscale threshold of the sweep. |
| threshold_stepopt | FLOAT | 101–128 | Step between successive thresholds; smaller is more thorough and slower. |
| min_repeatabilityopt | INT | 21–100 | A blob must appear at this many consecutive thresholds to be reported - the stability test. |
| min_distanceopt | FLOAT | 100–10000 | Blobs closer together than this (pixels) are merged into one. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| keypoints | CV_KEYPOINTS | cv2.KeyPoint list - draw with 'CV Draw Keypoints', or give them descriptors with 'CV Compute Descriptors' to feed 'CV Match Features'. |
| points | NPARRAY | Nx2 float32 (x, y) centres - the point-set form for 'OpenCV Draw Points', k-means, polar conversion, ... |
| sizes | NPARRAY | (N,) float32 keypoint diameter in pixels. |
| responses | NPARRAY | (N,) float32 detector strength per keypoint - threshold it to keep only the strong ones. |
| count | INT | How many were found; 0 is a valid result, not an error. |