Motion detection
Motion detection overview The 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, that returns a global motion ratio, depending of the number of cells in which motion has been detected, and the level of motion in each cell.
If no 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 in a grid composed of lines and rows, that defines cell 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, the 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 Is it possible to detect if the video signal is present or not for each video frame, by invoking IsVideoSignalDetected.