Video Detection Zones

Watches up to 64 rectangular zones of the video, laid out as a grid or placed freely. For each zone it outputs the activity (the share of its pixels that moved, or that are brighter than a threshold), a presence held for a set time, the number of tracked points inside, and enter and exit events and counters. Use it for interactive floors and walls, trigger zones in front of a camera, counting passages at a door, or to drive sound and light from where the action is.

A train passing in front of a fixed camera, grid 4 x 3, mode motion: the four zones of the middle row are present, tinted and outlined, with their activity gauges.

A zone becomes present when its activity reaches on level (or when a point is inside it, see presence from) and stops being present once it has been inactive for hold. video out 1 is the input with the zones drawn over it: the present zones tinted and outlined in color, the others outlined in gray, and along the bottom of each zone a yellow gauge of its activity, half full at on level. In motion mode, use a fixed camera: a moving camera makes every zone active. During bypass nothing is measured and the present zones stay present. A frame costs about 1 ms at 1920 x 1080 and 4 ms at 3840 x 2160, up to 2 ms and 8 ms when every zone is present and tinted.

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).

video out

Video output flow(s).

process time

Total time used for the calculation of the module.

layout

How the zones are placed (default grid).

  • grid: columns x rows zones that tile the whole picture, numbered from 0 row by row from the top left.
  • custom: the rectangles given by zones x1, zones y1, zones x2 and zones y2.

columns

Number of columns of the grid, from 1 to 8 (default 4).

rows

Number of rows of the grid, from 1 to 8 (default 3).

zones x

Arrays of the x of the two opposite corners of the zones of the custom layout (zones x1 and zones x2), from 0 (left edge) to 1 (right edge) (defaults 0.25 and 0.75). Entry k of the four arrays makes zone k, and the corners may come in any order. The number of zones is the length of the longest array, at most 64: a shorter array starts again from its first entry. An empty array gives no zone. The parts of a zone outside the picture are ignored.

zones y

Arrays of the y of the two opposite corners of the zones (zones y1 and zones y2), from 0 (top edge) to 1 (bottom edge) (defaults 0.25 and 0.75). The defaults make one zone of half the width and half the height in the middle of the picture.

layout = custom
zones x1 = [0, 0.5]
zones y1 = [0, 0]
zones x2 = [0.5, 1]
zones y2 = [1, 1]
count = 2: the left half and the right half of the picture

mode

What makes a pixel count in the activity of its zone (default motion).

  • motion: its luma changed by more than threshold since the previous frame.
  • luma: its luma is above threshold.

threshold

Luma change (motion) or luma (luma) above which a pixel counts, from 0 to 1 (default 0.08, about 20 levels of 255).

on level

Activity at which a zone becomes present, from 0 to 1 (default 0.02, that is 2 % of its pixels).

hold

Time a zone stays present after its last activity, from 0 to 10000 ms (default 500). The time of a bypass is not counted: the hold of the present zones starts again when the measures resume.

presence from

What makes a zone present (default video).

  • video: its activity reaches on level.
  • points: at least one point of points x and points y is inside it.
  • video or points: either of them.

points x

Array of the x of tracked points, from 0 (left edge) to 1 (right edge) (default -1: no point), for example the X output of Video Detection Blob or the x output of Video Detection Template Match. Points outside 0 to 1 are ignored, and a point on the border of two grid zones counts in one of them only.

points y

Array of the y of the points, from 0 (top edge) to 1 (bottom edge) (default -1). When points x and points y differ in length, the shorter one sets the number of points.

points count

Number of points read from points x and points y, from their first entry, from -1 to 1024 (default -1: every entry). Wire the count output of Blob or Template Match here: their arrays are padded with zeros past their count, which would put points in the top left corner.

precision

Share of the pixels measured in the zones (default auto). Measuring fewer pixels costs less.

  • auto: every pixel up to 600,000 pixels, 1 pixel of 4 at 1280 x 720 and 1920 x 1080, 1 pixel of 16 at 3840 x 2160.
  • every pixel: every pixel, the most exact and the slowest.
  • 1 pixel of 4: one pixel in 4.
  • 1 pixel of 16: one pixel in 16.

reset

Sets every presence off, every enter count to 0 and last entered to -1, and starts the motion measure again. The zones that are still active then enter again.

overlay

When ON (default), draws the zones on video out 1. The outlines and the gauges grow with the picture so that they stay visible on a reduced view: 1 and 3 pixels up to 539 lines, 2 and 8 pixels at 1920 x 1080, 4 and 16 pixels at 3840 x 2160. When OFF, video out 1 is the input unchanged.

color

Color of the outline of the present zones and of their tint, a quarter of the color added to their pixels (default $FF00FF80, green).

count

Number of zones, from 0 to 64: the length of the arrays below.

activity

Array of one entry per zone, from 0 to 1: the share of the pixels of the zone that count (see mode).

level

Array of one entry per zone, from 0 to 1: the mean luma change (motion) or the mean luma (luma) of the zone.

presence

Array of one entry per zone: 1 while the zone is present, else 0.

points inside

Array of one entry per zone: the number of points inside the zone.

entered

Array of one entry per zone: 1 on the frame where the zone becomes present, else 0.

exited

Array of one entry per zone: 1 on the frame where the zone stops being present, else 0.

enter count

Array of one entry per zone: the number of times the zone became present since the last reset.

present zones

Number of zones present, from 0 to 64.

enter

Trigger sent when a zone becomes present.

exit

Trigger sent when a zone stops being present.

last entered

Index of the last zone that became present, from 0 to 63, or -1 when no zone has entered since the last reset.

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