Build a Real-Time Home Security Alarm System Using a Kinect Sensor

Surveillance camera systems have been widely used in homes, businesses and other places of work. These systems with its all capabilities and features provide protection to people who uses them. In this work, a home security alarm system was designed and implemented based on the Microsoft Kinect sensor. The introduced system can detect intrusion and respond to it in real-time. If the intrusion is detected, the system sends SMS as a notification to the authorized user. Moreover, as soon as the intrusion is detected, pictures will be taken using the RGB camera of the Kinect. These pictures will be sent to the authorized user via email, and saved on the local drive. Simultaneously, the proposed system emits a loud sound to frighten away intruders. The proposed system could be used in homes, offices, warehouses, banks, hospitals, etc..


Introduction
Homes are easy targets of crime. Therefore, home security systems have become very popular, and many people have already started using different kinds of home security system. The main purpose of the home alarm and security systems is to alert the homeowners to trespassing attempts into houses.
Different approaches and algorithms have been developed and used to build home security alarm systems. These approaches could be divided into two main categories based on the technology they use: non-vision based and vision-based. On the other hand, vision-based systems could also be divided into two sub categories: regular RGB camera, and depth camera. Since the depth vision-based approach has the ability to overcome the limitations of other approaches, this work utilize the Kinect depth camera to implement the proposed system.

Motivation
In the market, there are already some professional systems that are expensive and most users cannot afford to pay for them. On the other hand, most inexpensive home security systems are ineffective [3]. Therefore, the main aim of this work is to design and implement an efficient system with low cost and low computational complexity.

Related Works
A number of home security systems have been proposed for different purpose based on different techniques. In [2], a PIR (Passive Infra-Red] sensor was used for motion detection. In [8], PIR sensors were also used to build a home security system. The main drawback of using non-imaging sensors -such as PIRis the difficulty of distinguishing between human and animals (pets).
In addition, some of the previous work used image matching techniques for intrusion detection. Authors of [5] implemented a color image comparison algorithm which is a very simple algorithm and not very reliable. The main drawback of using such algorithms is that they are not very reliable, and changing lighting conditions could affect the result.
In this work, a Kinect sensor was used as an input sensor to detect motions. Problems that may appear using non-imaging sensor are solved using the Kinect sensor. Moreover, traditionally home security systems are based on the computer vision technique which is slow to track normal human motion [9]. The Kinect, which provides coordinates of 20 joints 30 times a second, could be used to overcome some of the drawback of the traditional systems.
Compared to some of the classical approaches and algorithms which use regular RGB cameras, using of depth cameras improves performance. In addition, changing lighting conditions will not affect the results.

Technological Background 3.1 The Kinect Sensor
A Kinect, is a video gaming input device from Microsoft that was originally developed for the Xbox 360. The main feature of the Kinect is its ability to track human body movements. This feature makes it possible to interact with Xbox games without using any controller. Instead, the player's body is the controller [4]. To develop applications for Kinect devices, the Kinect for Windows SDK (Software Development Kit) is needed. Microsoft has developed a special SDK with a set of libraries to interact with the Kinect programmatically. The SDK provides three main streams: color stream, depth stream, and audio stream. In addition, the SDK provides a skeleton-tracking feature which allows programmers to track people with their actions. Up to six players can be recognized by the Kinect; two of the recognized players can be tracked in detail with twenty joints points. Each point is measured in a three dimensional (X, Y, Z) plane. [7]. The twenty joint points are shown in Fig.2.

AT Commands
AT (ATtention) commands can be used to implement a PC-based application that controls mobile phones. AT commands are instructions that are used to control mobile phones and modems. Table 1 show examples of the AT commands [1].  Fig.3. shows the main parts and features of the proposed system.

Setup and Initialize the Kinect Sensor
The first step of the proposed system is to connect to the Kinect sensor, and ensure that the device is ready to use.

Detect the Intruder
The feature of detecting and tracking people intruders was implemented based on the skeleton stream of the Kinect. A skeleton event was registered to track and listen skeleton frames. Once an intruder is detected, the introduced system's algorithm starts processing the skeletal frame data.

Take Pictures
The color stream from the RGB camera of the Kinect sensor was used to take pictures. A color event was registered to track and listen color frames. Once an intruder is detected, introduced system's algorithm starts capture images. Captured images will be saved automatically, and they will be automatically sent to the user email.

Store Pictures on the Local Hard Disk
The pictures from step 3 will be saved on the local hard disk. Name and location of the folder where all the captured images will be saved are determined by the user (as will be explained in step 7). To ensure that the name of each picture is unique, pictures file names will be appended with a timestamp so that every file will have a unique file name.

Connect and Control the Attached Mobile Phone
In the proposed system, AT commands have been used to control the mobile phone device. Specifically, AT+CMGS command was used to send an SMS. The following algorithm shows the procedure of sending the SMS:

Send Emails with an Attachment
Once the intrusion is detected and the pictures are saved on the local hard disk, the pictures will be also sent to the authorized user via email. Gmail account was used to achieve this feature.

Save Users' Preferences
The proposed system preferences could be changed by the user. The proposed system preferences are: phone number, email address, pictures' path, and sound's file. An XML file was used to save and restore all the preferences.

Display Pictures
The user of the proposed system has an option to display pictures that have already been taken. The user will be asked to determine the path of the pictures' directory.

Implementation And Results
C# Language of the Visual Studio 2010 was used to develop the proposed system. To implement the Kinect processing section, the Kinect Windows was used.
The Windows Presentation Foundation (WPF) was used to build the user interface of the proposed system. The main user interface is shown in Figure 5. The RGB video sequence is displayed on the screen.     In addition, to control a mobile phone from a computer, a mobile phone must be connected to the computer using USB cable. The proposed application can use the attached mobile phone to send an SMS notification to the homeowner when a intrusion is detected.
Experiments were conducted in a real indoor environment under different light conditions. Due to the Kinect hardware limitations, the proposed system cannot be run in the case of over 4m. A human subject experiment was conducted to test the accuracy of the proposed system. Some of the experiments were conducted in a fully dark environment. The results have shown that the proposed system is able to detect intrusion under different light conditions. The results have also shown that all the proposed system features work perfectly. Once an intrusion is detected, an SMS will be sent; images will be captured, saved and sent via an email (as shown in Fig.11). Alarm will also be raised. Results are summerized in Table2.

Conclusion
Home monitoring systems are widely used nowadays. This project focuses on the design and implementation of a low cost, smart and compact real-time monitoring home security system using the Kinect sensor and the Kinect SDK. Instead of developing new methods to detect and track humans, this work focuses on developing a high-level approach based on the Kinect Windows SDK. The results have shown the use of the Kinect device to build the introduced system as efficient with a low computational complexity.
Although the proposed system's algorithm presents a promising method to build home security systems, further development may be added. For example, the system performance can be improved by applying multithreading techniques. In addition, video-recording feature may be added to the proposed system.