Skip to content

Motion detection

Motion detection overview
Motion detection is enabled when MotionDetector_Enabled is true. The frame grabber must be enabled to use this feature.

When motion detection is enabled, TVideoGrabber compares the last video frame received to the previous one, unless a reference sample has been specified with MotionDetector_UseThisReferenceSample

For each video frame, if motion is detected, the OnMotionDetected event occurs, which returns a global motion ratio, depending on the number of cells in which motion has been detected, and the level of motion in each cell.

If no motion is detected, the OnMotionNotDetected event occurs.

Areas in which motion can be detected

To make it possible to limit the areas of the video frames in which motion will be detected, the video frame is divided into a grid composed of rows and columns, which defines cells, each having a motion level.

In each cell, the motion level can be set in a range from 1 (minimal motion sensitivity) to 9 (maximal motion sensitivity).

A value of 0 disables motion detection in the cell.

This is explained in the Grid structure / grid sensitivity chapter.

Triggered motion detection
By default, motion detection occurs for each video frame.

To trigger the motion detection manually, enable the MotionDetector_Triggered property.

Then, invoke MotionDetector_TriggerNow during preview, recording or playback to trigger the motion detection one time, until the next MotionDetector_TriggerNow call.

Detection of the video signal
It is possible to detect whether the video signal is present or not for each video frame, by invoking IsVideoSignalDetected.