Motion Detection Alert System using Beagle Bone Black

DOI : 10.17577/IJERTV3IS091070

Download Full-Text PDF Cite this Publication

Text Only Version

Motion Detection Alert System using Beagle Bone Black

Dr. S.A.K. Jilani, P. Mohammad Gouse Electronics and Communication Engineering, MITS, Madanapalle, India

Abstract: The security concerns have grown tremendously in todays competitive environment. Now-a-days Visual Sensor Networks have been attracting more and more research attention. Identifying moving objects from a video sequence in many computer- vision applications is a fundamental and critical task. In this paper one of the traditional background subtraction techniques, Frame Differencing algorithm which is implemented using Simulink model to detect moving objects in video sequences etc. Here we are using the hardware called BeagleBoneBlack which is a standalone minicomputer to which we employ a camera to capture the video and keep processing the Simulink model present in it, whenever it detects the motion it notifies the user with the sound Alarm.

Key Terms: Video capture, Frame differencing, Motion Detection BeagleBoneBlack, Alarm, MATLAB/Simulink.


Motion Detection System can be used in surveillance and security systems. The system that this project came up with will be useful for security in a fixed restriction area. Therefore, the background of the targeted area is assumed to be non-moving and considerations of sudden change in lightings are ignored as well. However, the considerations of other factors are taken into consideration. Basically, the initial plan was to use a technique called image segmentation to abstract the foreground image from the source image obtained and later processed to filter out noises or small images disturbance. To perform this, we would use Open Source Computer Vision Libraries from Mathworks to obtain contours from the foreground image subtracted.

An automatic visual surveillance is used by private companies, governments and public organizations to fight against terrorism and crime, public safety in airports, bus stand, railway station, town centers and hospitals. It has also find applications in traffic surveillance for efficient management of transport networks and road safety. Surveillance system include task such as motion detection, object classification, personal identification, tracking, and activity recognition. Out of the task mentioned above, detection of moving object is the first important step and successful segmentation of moving foreground object from the background ensures object classification, personal identification, tracking, and activity analysis, making these later steps more efficient. The problems encountered with background subtraction method are as follows must be corrected.

  • Motion in the background: The non moving backgrounds like moving leaves or branches, the waves in the water, the flying flag etc., must be identified.

  • Illumination changes: The background should adapt to the gradual changes in the illumination.

  • Shadows: Shadows of foreground objects should treat as background.

  • Memory: The background should use lesser memory

  • Camouflage: The foreground motion should be detected even there are similarities in the pixel characteristics to that of background.

  • Bootstrapping: Even in the absence of foreground, the background should be able to maintain background.

    The objective in this paper is to create simple, accurate and less complexity traditional background subtraction technique with post-processing to notify the user with sound alarm automatically when motion is detected.


    Here I am proposing the Real time Motion Detection, i.e., The USB camera will be capturing the Video continuously and gives the sound alert whenever it detects the motion in the capturing video. For this System I am using the main hardware part as the Beagle Bone Black which is the Standalone Minicomputer consists of USB port, Ethernet Port, micro HDMI port, Micro SD Slot, Mini USB port and the Processor. The main Objective of my project is to get the Automatic Sound Alert whenever the processor finds the Motion in the capturing Video so that we can reduce the manual work of keep watching the video whether anything happens in the live video capturing. Here the major part of the Hardware is the Beagle Bone Black which plays a vital role in this project and some of the components like USB camera and video cape and Speakers play their role in it.

    The Block diagram of the project will be as shown below:

    Power Supply



    Beagle Bone Black

    Speaker s

    Display Cape

    Figure: Block Diagram of proposed system

    The Real time project can be implemented in two major steps. They are

    1. Hardware Implementation

    2. Software Implementation

    I here discuss how to design the working part of a proposed system and how the system works. In the later chapters I discuss the both Hardware Implementation and Software Implementation.

    In this chapter I discuss how to convert a simple USB Camera with Beagle Bone Black to the Automatic sound Alert Motion Detector in a step by step Procedure.

    In this chapter I discuss the following thinks:

  • Video Input: How to take the Video Input from the Video Camera.

  • Video acquisition: How to design a software module in MATLAB/Simulink to access the video frames

  • Motion Detection Algorithm: An algorithm of Video Processing to detect and identify the Motion part of the live stream

  • Sound Alert System: A sound alert software module in the Simulink to notify the user that the motion is detected.

Video input:

Here I am using the simple USB Camera to capture the live stream and hence using the simple USB interface and the camera connecter. We can obtain a list of USB cameras from online and hence we can use any one of them which suits well with the Beagle Bone Black. It is easy to interface with the Beagle Bone Black which is the good advantage for me in this paper.

Figure: Simulink model of proposed system

Video Acquisition: A software Module:

In order to capture a live stream of video from the USB Camera that is connected to Beagle Bone Black we need to have compatible software. For that we are using a Hardware support package of Beagle Board in the Simulink. From the hardware support package we use the V4L2 block to capture the live stream of the video from the USB Camera.

V4L2 is the Video Capture block for Linux type devices. To capture the live video stream from the USB Camera, open a new Simulink model and add the V4L2 block into that new Model. It acquires the live video and gives the output as the frame data, at each sample time the output frames consists of three different matrices of different colors spaces. The default output frames will be in YCbCr format and we convert this to RGB format for the easy manipulations in further module.

Now add the new block, Colorspace conversion from the Simulink Library to the same model to convert the RGB frames to Intensity Frames for the easy manipulations.

Motion Detection Algorithm:

Here I use the frame difference method to detect the motion in steady live stream, it is the best suited and easy algorithm for my paper. In order to design this algorithm I need to use the Delay and Subtract block from the Simulink Library. Here Unit Delay delays the frame by one. We can also increase in a delay for the better performance as I am hoping only for the sound alert I am going with single frame delay in the stream of frames. Subtract Block takes the two inpt frames. If one is the Tth frame then another is the its delayed one (T-1)th frame. Here we are doing the Frame difference and hence, we get the difference here. If there is no motion in the live stream the difference we get is taken as Threshold value, if any motion is there it will gives the difference value.

Frame difference = Frame(T) Frame(T-1)

The detected motion can be viewed by the block supplied from Support Package called SDL Display. In order to view the noice free detected motion we need to add the some more Blocks called Data Type Conversion,

Mean and Abs etc., to find the threshold value we add the Display block. The threshold will be obtained when there is no motion detected. The below image shows the detected motion can be displayed by using the SDL Display. Here Display block helped me to find out the Threshold value. We need to run the above Simulink model with a steady camera without any motion detected. As there is no motion detected but still there may be slight differences in the consecutive frames is displayed as the Threshold value due to the shadows, lighting effect, or by the nonstop background like waving leaves or branches etc.

Calculate the Difference

We designed the Motion detection Algorithm and found out the Threshold value and now we need to expand that Simulink model in order to give sound alert automatically. So we need to add some more blocks to the above designed model.

Sound Alert System:

From the above Simulink model we can assume that what are the blocks involved in sound alert system. The IF block and its Subsystem blocks, Merge and ALSA Audio Playback are the blocks used in sound alert system. In this Paper IF block takes the mean value as the input and it compare with the Threshold Value. If the mean value it is getting in that instant is greater than the threshold value then the output of it connects to the IF ACTION port i.e., first subsystem block otherwise it connects with the ELSE port to execute the connected port. IF Action Subsystems: In these subsystems I uploaded the

Flow Chart:

Video Capture

Frame Difference Frame (t) Frame (t-1)


Display Threshold (Th)

View the Result in SDL Display

If (Th > Mean)

Give Alert

audio files that will be played by using the ALSA Audio block when the motion is detected. The Audio file Present in the IF subsystem will be played if the Mean value is greater than Threshold value, that means the system detected the motion from the video stream otherwise the audio file present in the ELSE subsystem will be played.

If(Mean> Threshold)= IF Subsystem Executes If(Mean<= Threshold)=ELSE Subsystem Executes

This completes the design of Simulink model for the proposed System. Here we discussed the working of all the blocks used in the Simulink model. Now I give a brief note about the working of this model.

First of all, the V4L2 Video Capture blocks captures the stream of Video from the USB Camera in the frame based format per sample time, the pixel format is RGB and the image size is 640*480 mode. This captured stream of vide is then converted from RGB to Intensity by using Color Space Conversion Block to ease for further manipulations. This input is then delayed by Delay block inorder to perform Frame Difference by subtracting consecutive frames one another by Subtract block to give detected Motion by subtracting Background. For better video we add Absolute and Data Type Conversion Block. Now we can see the detected motion by using SDL Video Display. We then take the mean value by using Mean block and display it using Display block and finds out the Threshold value. Then we give the mean value as input to IF Block to compare with Threshold Value. If the mean is greater than threshold value then IF Subsystem executes, i.e., the uploaded audio file in the IF Subsystem will plays using ALSA Audio Playback to give sound alert. If Threshold is greater than mean then ELSE Subsystem will plays to notify that no motion is detected. The working of the proposed system can be seen in the above Flow Chart.


The performance of the proposed frame differencing motion detection using Beagle Bone Black to notify the user with sound alarm will be illustrated over real video sequences using Simulink model.

The USB camera connected to Beagle Bone Black captures continuously the video sequence as the model is running continuously, the detected motion is displayed by the SDL Video display and when it detected the video the speakers play the alarm sound files that are uploaded in the Simulink model to notify the user. The detected foreground motion is as shown in the figure below.

Figure: Detected Motion in Foreground


    The Technology is stepped forward with the invention of Beagle Bone Black as it is compatible to run the Simulink models and it makes easier to implement the new security concerned systems with very low cost. The Motion Detection Alert System using Beagle Bone Black works efficiently with very low cost. The implemented device is very portable and hence anybody can employ this security device at any places within lesser area.



  2. Himanshu Goyal, Frame Differencing with Simulink model for Moving Object Detection, Volume 2, Issue 1, January 2013.

  3. ulink/index.html?/access/helpdesk/help/toolbox/simulink/slref/ embeddedmatlabfunction.html [website]

  4. Dr Xuewu Dai, Dr Fei Qin, Rapid Beagle Board Prototyping with MATLAB and Simulink.

  5. Rupali S.Rakibe, Bharati D.Patil, Background Subtraction Algorithm Based Human Motion Detection ,Volume 3, Issue 5, May 2013.

Leave a Reply