This example shows how to process surveillance video to select frames that contain motion. Security concerns mandate continuous monitoring of important locations using video cameras. To efficiently record, review, and archive this massive amount of data, you can either reduce the video frame size or reduce the total number of video frames you record. This example illustrates the latter approach. In it, motion in the camera's field of view triggers the capture of "interesting" video frames.
The following figure shows the Surveillance Recording model:
The example uses the Template Matching block to detect motion in the video sequence. When the Sum of Absolute Differences (SAD) value of a particular frame exceeds a threshold, the example records this video frame and displays it in the Motion Frames window.
The Motion Threshold window displays the threshold value in blue, and plots the SAD values for each frame in yellow. Any time the SAD value exceeds the threshold, the model records the video frame.
The Original frames window shows a frame of the original video.
The Motion frames window shows the last recorded video frame. In this window, the Source frame value steadily increases as the video runs and the Captured frame value indicates the total number of frames recorded by the model.