GStreamer Motion Detection

From RidgeRun Developer Connection
Revision as of 13:29, 5 June 2020 by Dgarbanzo (talk | contribs)
Jump to: navigation, search

Introduction to GStreamer Motion Detection

Nowadays, thanks to the advances in the technology fields, smart electronic devices, automation, computer science, artificial intelligence (AI), and embedded systems, we are capable to build more and more complex systems that incorporate many different features. One important feature that a lot of new systems and products of different industry areas try to incorporate is the capability to detect motion.

Let us start by defining motion detection as the process of detecting a change in the position of an object relative to its surroundings or a change in the surroundings relative to an object. With the proliferation of low-cost digital cameras able to shoot video and the popularization of modern devices to incorporate cameras, it is possible to use the output of such a camera to detect motion in its field of view using software algorithms. This solution is particularly attractive when the intent is to record video triggered by motion detection or trigger an alarm, as no hardware beyond the camera and computer is needed.

One of the most important areas that require their systems to have motion detection capability is Video Surveillance. In video surveillance, motion detection refers to the capability of the surveillance system to detect motion and capture the events. Motion detection is usually a software-based monitoring algorithm that, when it detects motions will signal the surveillance camera to begin capturing the event. Modern motion detection surveillance systems with AI incorporated can analyze the type of motion to see if it warrants an alarm or not, for example by tracking the motion trajectory of the object or by identifying the object under movement.

RidgeRun has developed two different software solutions that allow you to easily and efficiently add video-based motion detection capability to your system or product. Both solutions are based in GStreamer and delivered as a GStreamer plugin. The solutions differ between them in the implemented algorithm, software capabilities, and system requirements, to fit a wide range of systems. GStreamer is a commonly used framework for multimedia applications, known to be popular due to its flexibility in the app features design, simplicity of usage, portability, and efficiency. If you want to read more about GStreamer advantages please follow this link: Why RidgeRun Loves GStreamer.

Below you will find a summary of the two Motion Detection solutions provided by RidgeRun:

  • GStreamer Background Subtraction Camera-Based Motion Detection Plugin
  • GStreamer DispTEC Motion Detection Plugin
Error creating thumbnail: Unable to save thumbnail to destination


GStreamer Background Subtraction Camera-Based Motion Detection Plugin

RidgeRun has developed a Motion Detection GStreamer element that is able to detect motion from an incoming video image of a steady camera that does not move. The element implements the approximate median method for background subtraction with an adapting background algorithm. This method matches other higher-complexity algorithms in performance while being resilient to constant noise or sudden light changes happening in the scene.

When the camera is steady and fixed in a position, a common motion detection video approach is to perform background subtraction. With background subtraction, a static scene model is built, which is called the background. Incoming frames are compared to the background in order to detect regions of movement. Motion detection algorithms generally work by comparing the incoming video image to a reference image. The reference image could be previous frames or a predefined background. Motion detection is accomplished by analyzing deviations from the reference and attributing the difference either to the presence of motion or due to noise, such as untended motion on the camera mount.

This motion detection GStreamer element has been developed for GStreamer 1.0 and 0.10 versions. The element runs in any platform (hardware independent) since the motion detection algorithm is executed by the general-purpose processor (CPU), and do not depend on external computer vision libraries. The gst-motion-detect element is optimized and highly configurable, both for controlling the approximate median algorithm, as well as for minimizing CPU load to obtain the best performance accordingly to the user needs, allowing it to be integrated into highly constrained embedded systems.

If you are interested in this solution please follow this link for detailed information:


Key features

Sample size and location: You can set a rectangular region equal or smaller than the full frame size and locate it everywhere in the frame. The motion detect analysis is only executed in the sample rectangle. The related element properties are: window-x1, window-x2, window-y1, window-y2, sample-width, sample-height. Interval frame analysis: Only analyze every nth frame. Related element property: interval.


GStreamer DispTEC Motion Detection Plugin

Key features