Video Detection Blob Tracker

Finds the bright (or dark) regions of the video, the blobs, and follows each one from frame to frame with a stable id. Outputs the position, size, velocity and age of each blob, and triggers when one enters or leaves. Use it for interactive floors and to follow several people: attach a sound, a light or a 3D object to each id.

A night street, threshold 0.85, min size 0.05 %: one box per light, its color given by its id.

A dancer followed through the mask of a Background Subtraction wired into mask, min size 0.3 %.

A new blob gets an id once it has been seen on confirm frames in a row. A blob that disappears keeps its id for persistence frames, moving on along its velocity, then loses it. An id is never given twice before a reset: a blob that leaves and comes back gets a new one. The frames are those the module processes: one per frame of the clip behind a Video Player, but about 80 to 115 per second behind an image player or a generator, which send their picture again and again. A frame costs about 1.5 ms at 1920 x 1080 and 6.5 ms at 3840 x 2160.

Settings

bypass

Bypasses the module processing when activated (ON).

  • OFF (0): Module processes normally
  • ON (1): Input passes directly to output without processing

video in

Video input flow(s).

mask

Optional source of the blobs, such as the mask of Video Detection Background Subtraction or a keyed video. When it is connected, the blobs are found in it instead of in video in 1, at its own size. The boxes are still drawn on video in 1: the positions are relative to the frame, so a 320 x 180 mask fits a 1280 x 720 picture.

video out

Video output flow(s).

process time

Total time used for the calculation of the module.

source

Channel of the blob source compared with threshold (default luma).

  • luma: the brightness.
  • red: the red channel.
  • green: the green channel.
  • blue: the blue channel.
  • alpha: the transparency, for a keyed video.

threshold

Level of the source from which a pixel belongs to a blob, from 0 to 1 (default 0.5). At 0 the whole frame is one blob, unless max size excludes it.

invert

When ON, the dark regions, below threshold, are tracked instead of the bright ones.

analysis size

Resolution at which the blobs are searched (default auto). A smaller one costs less and ignores the smallest details; the outputs stay relative to the whole frame.

  • auto: the frame halved until its width is 1280 pixels or less (960 x 540 for 1920 x 1080 and for 3840 x 2160).
  • full: the size of the frame.
  • 1/2: half its width and height.
  • 1/4: a quarter of its width and height.

connectivity

Which neighbor pixels join into one blob (default 8).

  • 4: pixels touching by a side only.
  • 8: pixels touching by a side or by a corner.

min size

Smallest blob, from 0 to 25 % of the frame area (default 0.2 %): smaller regions are ignored.

max size

Largest blob, from 0 to 100 % of the frame area (default 100 %, no limit): larger regions are ignored, such as the background with invert ON.

max blobs

Largest number of blobs found and tracked, from 1 to 64 (default 16): the largest regions are kept. Lowering it below the number of tracked blobs removes the newest ones, whose ids go to left ids.

max distance

Largest move of a blob from one frame to the next that keeps its id, from 0 to 50 % of the frame width (default 10 %), measured from the position its velocity predicts. A faster blob is taken for a new one. At 0 no blob is followed: nothing gets an id, unless confirm is 1, which then gives a new id to every blob on every frame.

persistence

Number of frames a tracked blob may be missing, from 0 to 120 frames (default 10), for example hidden behind an obstacle: meanwhile it moves on along its velocity and keeps its id. Beyond, it is removed and its id goes to left ids.

confirm

Number of frames in a row a new blob must be seen before it gets an id, from 1 to 30 frames (default 3). A flicker shorter than that takes no id. At 1 a blob gets its id at once.

smooth

Smoothing of the positions, sizes and velocities, from 0 to 0.95 (default 0.5). At 0 the outputs follow the detection exactly; higher values are steadier and react more slowly.

reset

Forgets every blob: the ids start again at 1. Activating the patch does the same.

view

Picture of video out 1 (default video).

  • video: the picture of video in 1.
  • mask: in white the pixels that can belong to a blob, after source, threshold and invert; the others in black.

draw

When ON (default), draws each tracked blob on video out 1: its box, a square on its center and a line showing its move over 10 frames, in a color given by its id. The marks grow with the frame, so that they stay visible on a screen: the box is 2 pixels thick up to 1920 x 1080 and 4 at 3840 x 2160, the square 5 pixels wide up to 1280 x 720, 9 at 1920 x 1080 and 17 at 3840 x 2160.

count

Number of tracked blobs, from 0 to 64: the length of the arrays below, except entered ids and left ids.

input = one white disc of diameter 0.1 (in frame widths) at (0.3, 0.5) on a black 1280 x 720 frame
count = 1
ids = [1]
x = [0.3]
y = [0.5]
width = [0.1]
height = [0.1778]
area = [0.014]

ids

Array of the id of each blob, in increasing order. The ids start at 1 (after 99,999,999 they go back to 1).

x

Array of the x of the center of each blob (the center of mass of its pixels), from 0 (left edge) to 1 (right edge), in the order of ids.

y

Array of the y of the center of each blob, from 0 (top edge) to 1 (bottom edge).

width

Array of the width of the box of each blob, from 0 to 1, in frame widths.

height

Array of the height of the box of each blob, from 0 to 1, in frame heights.

area

Array of the number of pixels of each blob, as a fraction of the frame area, from 0 to 1.

velocity x

Array of the smoothed move of each blob along x per frame, from -1 to 1 in frame widths: positive to the right.

velocity y

Array of the smoothed move of each blob along y per frame, from -1 to 1 in frame heights: positive downward.

age

Array of the number of frames since each blob got its id.

entered

Trigger, fired on a frame where at least one blob gets an id.

entered ids

Array of the ids given on this frame (empty on the other frames).

left

Trigger, fired on a frame where at least one blob loses its id: missing for more than persistence frames, or removed by max blobs.

left ids

Array of the ids removed on this frame (empty on the other frames).

Common Settings

info

show manual

Button. Opens the manual page of the selected object (or of its parent module for a control) in the web browser. If no page exists for this object, an error is traced in the trace panel.

For more details about information/help creation, see create-help-file.

description

Free multi-line text attached to the module, saved with the patch. When it is not empty, it is shown as the hint of the module (mouse over the module header in the patch) in place of the default module hint, even when the module hints are disabled.

ID's

visible only in god mode, see setup-panel-tab-expert.

unique ID

Read-only, not saved. Current private numeric ID of the object, used internally to identify it (for example as the target of a bind ID).

preset ID

Read-only, not saved. Private ID used to store and recall the values of this control in presets.

recreate ID

Button. Generates a new unique ID, original ID and preset ID for the object. Use it if you experience difficulties in Polyphonic mode or if two objects share the same ID. Preset values and binds referring to the old IDs are lost.

Object Remote Address

absolute

Read-only, not saved. Absolute address of the object in the Usine objects tree, built from the workspace root. This is the address to use to reach the object from scripts, the objects panel or remote messages. Only shown for objects that are registered in the objects list. See objects-address.

local

Read-only, not saved. Address of the object relative to the current patch, valid inside that patch only. See objects-address.

user addr

Free user-defined address for the object (empty by default). When set, the object is also registered in the objects tree under this name, so it can be reached independently of its position in the workspace (the value is also reported in the mouse-over and mouse-down chunks). Changing it rebuilds the objects list. Only available on objects that support a user address. See objects-address.

See also

version 7.0.250921

Edit All Pages