Blob Tracker

Track moving blobs and objects in video by connected-component analysis.

What it does

Blob Tracker finds contiguous regions in an image and tracks them frame to frame as stable IDs. A segmentation model pulls a mask out of the image, or a mask is fed in directly; the individual blobs in that mask are isolated, then matched against the previous frame to carry position, velocity and identity forward.

Each tracked blob carries a centroid, velocity, area, bounding box, orientation, an age and a stable ID that survives frame to frame. Bounding-box shapes come out ready to composite or to use as an analytic-shape input.

When to use it

ParameterTypeDefaultWhat it does
imageRaster—Image to detect and track blobs in (Camera, Video, Image, or pre-computed mask)
modelString"u2net_lite"Segmentation model. Use 'none' if input is already a mask. One of: u2net_lite, modnet, none.
thresholdNumber0.500Threshold for converting soft mask to binary (higher = stricter)
min_areaNumber0.001Minimum blob area as fraction of image (0.001 = 0.1%)
max_areaNumber0.900Maximum blob area as fraction of image
max_blobsNumber20Maximum number of blobs to track
sort_modeString"area"How to sort blobs (affects which survive max_blobs cutoff). One of: area, left_to_right, top_to_bottom, nearest_to_center.
max_distanceNumber0.150Maximum distance (normalized) a blob can move between frames
persistenceNumber15Frames to keep a lost blob alive before removing
process_noiseNumber0.010Kalman process noise (higher = more responsive, less smooth)
measurement_noiseNumber0.100Kalman measurement noise (higher = smoother, more lag)
distance_weightNumber1Weight for centroid distance in cost matrix (higher = prioritize position)
iou_weightNumber0.500Weight for bounding box IoU in cost matrix (higher = prioritize shape overlap)
area_weightNumber0.300Weight for area similarity in cost matrix (higher = prioritize size)
enabledBooleantrueEnable blob tracking

Gotchas

Persistence sets how many frames a blob is kept alive after it is lost (covered, off-screen, or momentarily undetected) before its ID is dropped. Too low and fast-moving or briefly-occluded blobs lose their identity and restart as new blobs; too high and stale blobs linger and can steal a match from a real new one.

Worked example

  1. Add a Blob Tracker and wire a Camera or Video node into Image.

  2. Leave Model at "u2net_lite" for general subjects, or switch to "modnet" for people. Raise Threshold if the mask is picking up background noise.

  3. Set Min Area to filter out small flecks, and Max Blobs to cap how many blobs are tracked at once.

  4. Read the blobs output for full per-blob data, or wire centroids / velocities directly into whatever should follow the motion.

See also

Point Tracker · Vision Tracker · Vision Segment · Points