System for Human Detection in Image Based on Intel Galileo

—The aim of this paper is a comparative analysis of methods for motion detection and human recognition in the image. Authors propose the own solution following the comparative analysis of current approaches. Then authors design and implement hardware and software solution for motion detection in the video with human recognition in the picture. The development board Intel Galileo serves as the basis for hardware implementation. Authors implement own software solution for motion detection and human recognition in the image, resulting in the evaluation of proposed implementation.


INTRODUCTION
Motion detection and objects recognition in the image is an active research being done as a part of computer science.The principal goal of intelligent systems for objects recognition and tracking is the use of these systems in various sectors of computer engineering, e.g.image processing, security, and robotics.People can focus on a specific object, and the aim of the research is to implement this ability in intelligent systems.
The object is in motion when it is compelled to change that state by force impressed on it.Detecting the motion is the object is done by [1]: sound, optical, vibration, geomagnetism, refection of transmitted energy and electromagnetic induction.Detection of motion by sound follows the principle that every object being in movement causes sound and detector can localize the source of sound in the area.
The most used methods for motion detection are optical methods compare frames from continuous video stream and detect moving objects.Video sequence source is in MJPEG and there are techniques to convert this stream into JPEG images.In this paper authors compare two frames images in bitmap image file which support RGB color model.Project consisted of both, hardware and software implementation.The first, utilize the Intel Galileo board and IP camera and the latter introduces and approach for detection of person directly by the proposed device.In the following sections, the well-known approaches in the area of detection are presented.

II. MOTION DETECTION METHODS IN VIDEO SEQUENCE
There is a great number of the algorithms for tracking objects in video sequence, most of them uses comparison of one frame from video to the previous one.Three common methods are used for motion detection in video sequence [1].These methods are background subtraction, optical flow and temporal differences.Systems for motion detection needs to handle a number of critical problems.The most common described in [2] are variations of the lighting conditions, small non-static movements such as tree branches in the wind, low image quality source making noise picture; movements in ghost regions in the image or sudden changes in the light conditions inside by presence of a light switch and outside by clouding.There is no system that would provide exact output and work without errors.The goal of every technique is to reach the best results without mistakes caused by described critical problems.It is recommended to combine two or more techniques to acquire better results.

A. Background Subtraction
There are a lot of algorithms for background subtraction methods and majority of them is based on principles described in [3] and shown on flow diagram in Fig. 1.Preprocessing is a process for setting videos properties.Video from camera is captured in real-time in required format with www.ijarai.thesai.orgimage processing.The video is divided to frames in this part of background subtraction process.The next part is background modeling.This is the main part of all process.There has been many researched towards the finding of robust background modeling techniques.The aim of these researches is described in [3] and it is to seek a balanced technique which is robust against environmental changes in background, but enough sensitive to identify all the moving object of interest.Foreground detection is part where are identified all pixels from image which are candidates for foreground pixels.The outputs of this part are objects in foreground.Subsequently there is a data validation part where candidates for foreground are identified and verified.
There are two different types of background modeling in background subtraction techniques: non-recursive and recursive techniques.
Non-recursive techniques use a buffer in a sliding-window which stores previous frame and estimates the background image based on temporal variations of each pixel in a buffer.These methods are adaptive, because they do not depend on history beyond those frames stored in the buffer.There is a large storage requirement depending on buffer size.In [3] the authors describe common non-recursive techniques for background modeling, i.e.: frame differencing, median filter, linear predictive filter and non-parametric model.
Recursive techniques do not use buffer for background estimation.They recursively updates background model in each input frame.Input frames from past could have an effect on new inputs.Recursive techniques do not need such storage.If an error occurs in recursive technique, it last more time to eliminate this error.Authors in [3] describe these recursive techniques for background modeling: approximated median filter, Kalman filter and mixture of Gaussians.

B. Optical flow
Method was described by Lucas and Kanade in [4] and based on this approaches there are three assumptions described in [5], these are: brightness constancy, temporal persistence and spatial coherence.

C. Temporal differences
This method is also called method of frame differences.Principles of this method are described by author in [6].Method compares two frames and uses special techniques for electing referral object for motion detection.This technique is based templates and it is called template matching.Author in [1] describes two template matching techniques: static, used in background subtraction and dynamic template matching (DTM).This study uses frame differences method by comparing each of RGB components: red, green and blue.Method in this study compares all pixels from two frames and based on this detects the motion.

III. METHODS FOR FACE AND HUMAN RECOGNITION
IN STATIC IMAGE The aim of methods for face detection is to find out if there is a face in a static picture.In positive case the face is localized and system returns face location and parameters.Also in face recognition there are many factors that influence the results.
These factors are described in [2] and [7].Face location may vary by camera position and angle of coverage.This can cause that faces are covered by other objects or are damaged.For example a nose may vary from any angle of coverage.Author in [8] described next factor.Presence or absence of structural components such as beards, mustaches or glasses which may or may not be present on face and there is a high variability of these components including shapes, color and size.Faces may vary by a person's facial expressions.Faces in picture may be occluded by other objects.There is also big possibility to damaging facing because of low image quality.Bed effect to face recognition is caused by lightning conditions that can vary very fast.
Author in [2] describes four common methods for face recognition in image: knowledge-based methods, feature invariant approaches, template matching methods and appearance-based methods.

A. Knowledge-based Methods
Knowledge-based methods use rules to define human faces properties.The rules describe relationships between parts of a face.These methods are used mainly for face localization in image.In general, it is simple to describe human face and relationships between each part of face.It is known that face is composed of one pair of eyes that are symmetric to each other, one nose, one mouth and other good known parts of face.Based on this information are created rules of relationship between each part.It is known that faces can be described with common rules.It is very important to set rules very effective.If relationships are described very exactly, there are a lot of mistakes in face recognition.On the other side, if rules are more benevolent, there are a lot of false positive.It is not difficult to find faces in image based on this technique and it is required to use verification process to find false results.The most important thing in this process is to set rules because of lot of variations of faces and poses.

B. Feature Invariant Approaches
Feature invariant approaches are looking for special morphological parts on face which do not change their position while movements, angles of view or lighting conditions.These methods are used mainly for locating faces in image.Feature invariant approaches are described in [7] and they are easier to implementation.

C. Template Matching Methods
Methods based on comparing templatestemplate matching methods need own database in which are described faces and parts of faces.Method is based on correlation between new frame and templates from local database.There is a need to update database with new faces to gain better results www.ijarai.thesai.organd databases require a lot of storage.These methods are easier to implement and they are used mainly for face location but authors in [7] describe these methods also for face detection in image.

D. Appearance-based Methods
Template based methods have own database with faces, on the other side appearance-based methods gain and build folder with faces by learning detected faces from image.There is a training set of faces and these methods learn based on this training set.Appearance-base methods are used mainly for face detection in image.Author described these methods for face detection in [7].

E. Human Detection with History of Oriented Gradients
Method History of Oriented Gradients (HOG) is used by authors in [9][10] for human detection in image.This method is not recommended to use in real-time because of high need of system resources.There are many approaches that describe HOG in combination with other method to detect human in real-time.Author in [10] describes combination of HOG witch optical flow method.Authors in [9] propose using HOG with Kalman filter to use it in real-time.

IV. PROPOSED METHOD FOR MOTION DETECTION AND HUMAN RECOGNITION
This section of paper describes method used for software motion detection and human recognition in image sequence.Motion detection based on analyzing each of pixels from reference image and comparing it with new image.In this paper authors use microcontroller Intel Galileo like a hardware solution.

A. Hardware Part of System
Hardware implementation is based on a development board.Authors proposed to use development board from Intel named Intel Galileo Gen 1.The device communicates with camera via IP protocol.IP camera is powered with POE 802.3af which makes it more able to move.In this implementation is used IP camera Vivotek FD7131 with resolution 640x480.
Development board Intel Galileo supports operating system Linux.Operating system is located on MicroSD card which is inserted in slot in development board.MicroSD is formatted on FAT or FAT32 and with maximum capacity of 32 GB.Fig. 3. Hardware part of system for motion detection and human recognition Fig. 3 depicts the hardware implementation of the proposed system.A computer device is used to control software and to start the program.This solution is designed to be accessible from the Internet.

B. Overall Software Implementation of Proposed System
The implementation part is based on analysis of methods for motion detection and human recognition in picture.Authors based on analysis carry out the implementation, which is composed of two parts: software motion detection and software human recognition.The main program has to be compiled directly on the device Intel Galileo and the program is written in programming language C. The program does not use any other libraries, only standard libraries from C. Software implementation is compiled on device using GNU compiler.The software part is divided to smaller following parts: 1) Installation of operating system on development board Intel Galileo using MicroSD card.
2) Configuration of IP camera and test connection between IP camera and development board.
3) Daemonize program to run in system like a process.4) Software motion detection based on comparing two following frames.
5) Software human recognition based on analyzing frames.
6) Create web interface to show results from program and gallery with pictures with positive detection.7) Automation of solution.

C. Implementation of Main Program
The main program has multiple parts and together they create complete solution.The main part is program to motion detection and human recognition implemented in C and compiled on development board.The main program has to serve to different parts which are: 1) Download first frame from camera which become reference image.
2) Program has cycle in which are downloaded images from camera.Program has to have access to two images in one moment.All images are saved on development board.
3) Program compare new image with reference image and all pixels are being compared.
4) If there is detected motion then system tries to recognize persons in image.If there is a person in image then image is saved and shown in gallery with positives detections.

5) Program is running as a daemon in operating system and results from motion detection and human recognition are logged in text file.
The program is running in cycle.There are two cycles.The first one is for downloading actual image from camera.The second one is used for motion detection and human recognition if needed.The main program has two parts: motion detection and human recognition.www.ijarai.thesai.org

E. Proposed Function for Human Recognition in Image
The second function in the main program is for human recognition in picture.Human is detecting in image only if the result of motion detection is positive, on the other side, program continues with motion detection on the next image.Human recognition works on principles that the program has location of changed pictures and their count.Changed pixels must be next to themselves.The human silhouette is described in invariant parameters and program tests if the square with pixels is in shape of person.Based on testing, program knows how many pixels on image create one silhouette.Program tries to eliminate object which are not persons with different restrictions for pixels location.Silhouette is described like a square m x n.The size of square was determined by testing in different locations and in different poses.Results of this method are logged into text file with timestamp and number of counted persons.The modified output from program is shown in the Fig. 5 with marked persons who were identified by method to human recognition.The aim of this paper was the implementation of the system for motion detection and human recognition in video frames using development board.The system proposed by authors of this paper satisfies requirements.Development board Intel Galileo and video source from IP camera are used as a basis for the hardware implementation.Operating system Linux on the Intel Galileo development board is a good solution.However, there are not enough system resources to implement better methods for motion detection and human recognition.Authors in this implementation show the way of realization system for motion detection and human recognition on the development board.Implemented solution was tested in two different scenes to gain better results.In each scene was program tested with three different values for sensitivity to change color value of a pixel.The results show that implemented method for human recognition works.The results from two different scenes summarize the following tables: Two types of scenes were considered, both indoors, the first scene was a computer networks laboratory.Camera in this case was attached to the ceiling of the room.Sun light had a great impact on the number of false positives.The second room was storeroom, same as for the first scene; camera was attached to the ceiling.Number of true positives was in this case better due to better lightning conditions and lesser complexity of the room.For both cases, presence of artificial light enhanced the overall results.

Fig. 1
Fig. 1 represents a simple flow diagram that describes generic algorithm for the background subtraction.It is composed of four main parts: preprocessing, background modeling, foreground detection and data validation.Preprocessing is a process for setting videos properties.Video from camera is captured in real-time in required format with

Fig. 4 .
Fig. 4. Lifecycle of proposed programD.Proposed Function for Motion Detection in the TwoFollowing Video Frames One of two major functions of the main program is motion detection.Reference image is created after program starts and it is converted from JPEG in to BMP format in which program can works witch pixels color scales.New image from camera is downloaded in cycle.Motion detection is implemented like comparison of color scale from each pixel in following image frames.Pixel has changes if value of one of color partred, blue or green has been changed.Value of sensitivity can be set on the start of the program.Right settings for sensitivity are very important for true motion detection in the picture.If value for sensitivity is too low, there are a lot of fake pixels detected like in a motion.On the other side, if the value is too high, pixels for detection must be changed more.One pixel has been changed if every color part has been changed in comparison with pixel from reference image in the same location.Motion is detected if there is a number of changed pixels in interval for motion detection.And based on previous function, the next function tries if there is a number of changed pixels which indicates motion detection in two following frames.

Fig. 5 .
Fig. 5. Modified output with marked persons V. RESULTS AND CONCLUSION