An Improved and Secure Motion Detection Surveillance System in UNIX

Published 14 October 2013 Abstract. These days motion detection in surveillance technology has a trend to deploy to security sectors using radar motion detector, wireless sensors, Micro-Electro-Mechanical Systems (MEMS) Inertial Sensors etc in Unix system. This research focuses on motion detection using combination of optical flow and thresholding methods on Linux platform. Salient configurations, inevitable installation packages and libraries are discussed elaborately. Moreover, script with pseudo code for connecting with remote networking service application has been implemented. Results show a good and convenient security system suitably for home and offices.


Introduction
In surveillance applications with different types of cameras, motion detection performs very important role in image processing.There are two salient features in motion detection system [1] .One of them is region of interest and another one is region of awareness.The pivotal job of motion detection is to scrutiny a region of interest comprehended in a region of awareness.The region of awareness can be defined through camera geometry which is also significant to a location [2] .Motion detection technology is not only used in security surveillance system, human tracking [3] , pose estimation [4] , reorganization [5] , but also in detecting fast moving vehicles and physiological applications [6] such as detection of respiration, cardiac rhythms, knee osteoarthritis [7] and blood pressure.Human heart has different idiosyncrasies, for example effects of ischemia in heart motion.For this type of cases [8] proposed an LV motion detection that can differentiate between ischemic and normal heart condition.This method is also used to perform the nature of pathology.
The key idea of motion detection can be described.An image grabber grabs the images when a region of the image is changed in a certain level.In other word, the image is captured only when the pixels of a portion of the image exceeds a threshold according to system requirement [1] .To illustrate the basic concept, the idea of achieving foreground mask can be described using threshold.Thresholding is used to binarize different images.It performs operation between two consecutive frames.For example, Img (m−1,m) is given by (2) [10] .
Then do morphology to Img (m−1,m ) so as to resist the disturbance of the background.Morphology [11] is the process of converting gray scale image to binary image in which the image identification each pixel is restricted to a value of either 0 or 1.
There are a number of major issues that are related to motion detection such detection algorithm, image grabbing technique and overall running time.From all of these, motion detection algorithm is the most critical job of total procedure.A portion of section 2 is evaluated by three popular motion detection algorithms because motion detection has a great implication in industry, production and medical science.In spite of this, lots of shortcomings are seen in algorithms like entropy [12] , optical flow [13,14] and researchers are making efforts to overcome constraints and find out the optimal solutions.The challenge of motion detection system lies in secu-rity as secured system can be deployed in unmanned aircraft application.In this paper, an attempt is taken to improve security of the system for motion detection by suggesting an improved UNIX based method.The indispensible configuration procedure has also been described with appropriate command.Additionally, script for remote image files for micro-blogging application has been depicted with pseudo code.

Previous Research
According to [14], two types of motion detection are defined.These are region-based and pixel-based algorithms.Both types are widely used in motion detection although pixel-based type is often used in real time application.Huimin et al. [15] have proposed imitating uni-Gaussian and mixed thresholding methods to discriminate practical and proposed methods.The proposed algorithm has been experimented very well in case of very slow moving objects where as fast moving objects have been ignored.One of the major critical issues in fast moving object motion detection in real time is acquiring accurate current background image.Showing a traffic surveillance system, Ji et al. [16] have solved by color image difference model.Genetic algorithm is very useful in case of optimization problems.Since the algorithm runs on the basis of iteration steps, the complexity of the algorithm is exponential.Using genetic algorithm Bevilacqua [17] has shown motion detection system in terms of traffic monitoring application.In the experiment, it has been shown a good parameter optimization process albeit the complexity of the proposed algorithm has been totally ignored.Three categories have been described below for motion detection divided into three parts.Researches [15][16][17][18] have been going on these categories.

Background Subtraction Modeling
Background modeling is mostly used in moving objects detection [19][20][21] .It means segmentation of foreground objects from dynamic scenes.The base of this model is background subtraction and the pivotal point is background creation.The concept of this model can be defined like this [19] each point (n) of background is assumed as mean color and denoted as ∂ n and σ 2 n as the covariance of that point.Thus (∂ n , σ 2 n ) is stored as a color background.For each new frame f , P n ( f ) is the current color of pixel n.Then the background model is updated like pseudo code.
Lots of algorithms proposed in literature for ages presenting some common characteristics.Spagnolo et al. [22] proposed multilayer approach for small changes in the background where object is moving at foreground loca-tion.One of the major problems in background modeling is illumination changing in the environment.Huang et al. [20] presented a modified approach by using background training parameter into Gaussian Mixture to improve the adaptive background model.

Optical Flow Model
An optical flow is defined by patterns of motion objects, edges, surfaces in an aesthetic scene brought on by relative motion between the scenario and a camera [23] .A roll-out of optical flow on gradient is provided by Fleet and Weiss [24] .To describe more precisely of optical flow, it is first elaborated maximum one pixel displacement or its large movements.The optical flow for a pixel (i, j) is given for two successive images k and k + 1.Then the movements of (i, j) denoted as m k (i, j) has become like (3) and (4).
Brightness constancy is an inevitable part in optical flow technique [1,24] .Brightness constancy is presumed by most researchers and sometimes disrupted by its parent nature.That is why; the output of optical flow field is neglected for approximation to two dimensional motion image.Fig. 1,Fig. 2 and Fig. 3 have been depicted here for better understanding of optical flow Lambertian sphere.Lambertian reflection model has been shown in Fig. 1.The corresponding equations ( 5) and ( 6) have been derived from Fig. 1.In both equations, L(P) represents scene radiance, k is source brightness, γ is surface reflectance and γ is effective source brightness [25] .
Fig. 2 shows a Lambertian sphere that rotates concentrating to a motionless light source and generates static image.In Fig. 3, intensities of range and optical image Fig. 3(a) and their first derivatives Fig. 3

Gradient-Based Optical Flow
There are some approaches in optical flow in which gradient technique is the most renowned [14,24,28] one.The common idea of gradient-based optical flow is to estimation pixel intensities.It is assumed f (x) be a one dimensional grey level function for spatial position.This is decoded by d between time 1 and time 2 .Then generated shifted signal is expressed in (7).If it is applied Taylor expansion to (7), we can get like (8).After that, the difference between two signals of f t 2 (x) and f t 1 (x) is shown through (9).Finally, (10) presents first-order approximation with displacement which is denoted as d.In case of a linear signal (Fig. 4(a)), displacement is the difference in signal values at a point divided by the slope.For nonlinear signals (Fig. 4(b)), the difference divided by the slope gives an approximation to the displacement [24] .
Fig. 4. Displacement ( d) of (a) linear and (b) non-linear signal [24] 3 Method for Motion Detection We propose a novel method that follows both temporal change and optical flow detection implemented in UNIX system.The proposed method has been implemented in Linux operating system.The most important of this program is configuration file.The details description of the configuration file is discussed in this section.Before going to configuration file, step wise diagram of this method has been shown in 5.
The method is described in the following steps.
Step 1: Compute optical flow vectors for the highest level of the tree L (say we have a tree of L levels).
Step 2: The vector values are made double.

Experiment and Results
In this experiment, it has been used Ubuntu which is a Debian-based GNU/Linux distribution operating system [29] .To start the process of detecting motion, it is necessary to create an environment for running the program.The steps for configuration motion from sources are described in this section.

Configuration
Before starting the motion, it must be configured the motion.conffile according to the system capability, requirements etc. Table 1 describes necessary commands for Ubuntu system.
Besides these, there are copious options and all these need to be configured.Table 2 shows some of the options that we created according to our needs.

Alert Message
In Table 2, the option "on_picture_save" is used for uploading motion detected pictures to any social networking and micro-blogging service (Ex.Twitter is used) application by writing a scripting code.The pseudo code of the script for twitter is given as follow.

Results
experimental results have been shown in Fig. 6 and Fig. 7. Fig. 6(a) displays the 90 • rotated angel view of motion picture.Fig. 6(b) displaying the information while it the motion based picture is captured.Fig. 6(c) depicts the moving pixels of motion image.Finally, Fig. 6(d) unveils the pixel changing information of motion image.
On the other hand, Fig. 7(m-x) describes experimental result of motion detection of an object.The result explains that the camera can grab the object picture when it estimates any changes in both foreground and back- Comparing to the conventional system, this UNIX system ensures the security level for motion detection [30] .This will retain the intruders from hacking.However, one of the shortcomings can be notified in Fig. 7(q-r) that the program cannot detect any pixel change information when the object is reflected in a mirror.

Conclusion
In this work, a comprehensible motion detection method has been described with necessary tasks.Simply this motion detection system can grab images only when any object passes.So this is applicable for high speed vehicles to detect its speed, edges etc. choosing opt threshold and to trigger remote main server.Also the system can be convenient for counting number of vehicles in traffic signal point and set alarm to control room.However, enhanced research is needed on smoothness and choosing opt threshold.One promising area for future research can be applied different filter instead of Gaussian in case of smoothing.Overall, this UNIX based system is quite secured from hacking.

Fig. 1 .
Fig.1.Lambertian reflectance model[25] Fig.2shows a Lambertian sphere that rotates concentrating to a motionless light source and generates static image.In Fig.3, intensities of range and optical image Fig.3(a) and their first derivatives Fig.3(b) have been shown.Based on Cross-Section of Lambertian Sphere X-Axis is Range, Y-Axis is Optical.The Point Light Source (PLS) is moving from 180 • through 0 to −180 • , and then looping back.

Table 1 .
Some key commands for installing Motion

Table 2 .
Relevant Configuration of motion.conffile Fig. 7. Experimental results of detecting motion in different poses