Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2019 International Conference on Computer Communication and Informatics (ICCCI -2019), Jan.

23-25, 2019, Coimbatore, INDIA

Motion Detection and Object Tracking Based


on Frame Comparison
Anuradha K, Jebin Matthew J and Balaji J
Department of Electronics and Communication Engineering, School of Electrical & Electronics Engineering,
SASTRA Deemed to be University, Thanjavur, Tamil Nadu, India. 613401
kanuradha@ece.sastra.edu

Abstract---”Walls have ears” is a wise saying. Due to this rapid Most of the conventional methods detect moving objects by
technological growth, ears were not enough, so we also needed performing image processing on the frames [2], filtering the
the walls to have eyes. Then came the surveillance cameras, the objects and continuing the process on the following frames
“Electronic eyes” which helped to prevent many crimes and put [9]. Like this proposed algorithm there exists frame
a check to criminals. Now these electronic eyes present in places differencing method which uses image differencing followed
with high significances such as ATMs, Banks, Hospitals,
by morphological filtering [1] and moving vehicle detection
Government organizations and crowded streets. Blooming up
cloud surveillance and remote surveillance techniques have made using frame differencing [6]. When it comes to differencing,
it very easy for beginners to implement the full surveillance the basic operation is subtraction [8], which is a light
system in mere couple of days. So there requires a system to operation, the proposed algorithm uses even lighter operation
detect motion and track moving object so that it can prevent with noise being handled in a special way [7].
crimes and avoid surprise “storage full” issues. This algorithm
deals on detecting motion of object with very less computational II. PROPOSED ALGORITHM
complexity possible and tracking it. The proposed object detection and tracking algorithm is based
on the idea of emphasizing the property of video and not on
Keywords: Differencing, XOR, Pixel, Grayscale the Image. This method works by comparing the pixel
changes by overlapping a frame with the next frame. i.e.,
I. INTRODUCTION bitwise XOR of a frame with the next frame. This operation
Object Tracking has been a widely discussed topic in the has lower computational complexity, and even very basic
arena of computer vision. This object tracking has helped in processors can perform this task with ease. Further, noise
identifying suspicious activities, used in rovers to detect filtering techniques are added to fine tune the output as shown
obstacles and even it has helped in detecting natural calamities in Fig.1.
such as landslides and illegal mining activities [4]. Now it is
in huge demand because of the increase in number of
surveillance systems and anti – burglary systems [3]. Each Frame Frame
i+1 i
surveillance system has its monitoring sinks from which
everything is being watched [5]. This is the part where
humans are present and they cannot always be present and be
alert to detect the ‘Smoke before flame’. Gray Scale Gray Scale
Color format Color format
format format

Although the storage density of hard disk drives are increasing


at a good pace. The content to be written is very huge. When
considering the option of data compression, the quality of
record gets questioned. The idea of “Record when required” is
the main motto behind object detection, i.e. to command
“When” to start or stop recording, thus preventing a lot of
storage exhaustion. Low storage surveillance systems resulted
in many robbers being unidentified even when they have been
detected. On the other hand in reality, the ratio of suspicious
record to conventional record in a footage is very low.
Further, it’s the conventional part of the footage consuming
very high storage and there exists method to detect static
(conventional) entries [10].
Fig.1: Workflow of proposed model

978-1-5386-8260-9/19/$31.00 ©2019 IEEE


2019 International Conference on Computer Communication and Informatics (ICCCI -2019), Jan. 23-25, 2019, Coimbatore, INDIA

1) Detect video and read the first frame:


The video reader is opened and presence of video frames are
detected first. If video frames are detected, the first frame is
taken and this frame can also converted to grayscale

2) Read the second frame:


If video frames are present, the next frame is taken and this
frame can also converted to grayscale

3) XOR the acquired frame with previous frame:


The acquired frame is Bit-XORed with the previous frame
which results in an image in which there exist a white mask or
boundary in the place where the moving object was present. The
property of the output is such that when a pixel in frame (i) at Fig.2: A frame from video
position x has displaced to a new position x+x in the frame
(i+n), where n is a natural number. Bit-XORing of these two
frames results in a 3D pixel array of dimensions same as that of
the parent image in which the pixels corresponding to the
position x and x+x will be in white in colour whereas the
pixels remaining stationary will be black. It can be observed
that, the pixels that changed due to minor effects such as jerks,
aberrations and environmental uncertainties results in intrusion
of colour noises in the output around the detection area in case
of colour Bit-XORing and Salt and pepper noises of various
intensity in case of grey scale Bit-XORing.
Fig.3: Bit-XORed and noise removed output
4) Colour Noise Filtering:
6) Motion Tracking:
The colour noise can be identified easily by approximating
pixels that has at most 2 colour plane values lesser than the The motion tracking can be performed by using the output
from previous step, which is the white pixels making a rough
average of all the three colour planes (R, G and B). Thus, the
boundary. A boundary of desired shape and fill can be laid
threshold value is chosen to be half of the average of the three
around the white pixels with some offsets for clarity. After
colour plane values. So, when more than one colour plane has a
laying out the boundary, it can be directly mapped on to the
value less than half the average, we conclude that this pixel
contributes to the colour noise and is replaced by (0, 0, 0). This instantaneous image frame. The following figure Fig.4 from
another example is another frame of a video, Fig.5 is the result
method proves effective in removing the environmental
instabilities and helps in separation of the object to be detected. of Bit-XORing of this frame with its next frame and Fig.6 is
the output frame with bounding box developed with help of
It should be noted that Bit-XORing over colour frames is much
Fig.4 processed with the following frame
better than Bit-XORing over grayscale frames due to the fact
that in Bit-XORing of colour frames, the instabilities are
distributed over colour pixels which are easy to filter, whereas
in Bit-XORing of grayscale frames the instabilities interpolate
as intensity variations in a single plane which is hard to filter
and results in a false positive detection. This improved output
can be pipelined as input to motion detection or tracking
algorithm.

5) Motion Detection:
The detection algorithm is less complicated and motion is said
to be detected if there exits some percentage of white pixels
greater than a particular threshold value. The following figure
Fig.2 from a video gives the output which is Bit-XORing of
frame i and frame i+1 followed by colour noise removal as
Fig.3. Fig.4: A frame from another video
2019 International Conference on Computer Communication and Informatics (ICCCI -2019), Jan. 23-25, 2019, Coimbatore, INDIA

Fig.5: Bit-XORed and noise removed output


Fig.8: Detected part from video

2) High rate of true positive detection:


“When object moves, the detection is
guaranteed” proves its reliability in detecting. The Fig.10
shows how this algorithm could detect even a smallest
motion. In this image, the smallest waving of the plants were
also detected by removing all filters and preferences of the
object to be detected.

Fig.6: Filled Rectangle laid over previous output

Thus the minimal object detection and tracking techniques have


been performed on various sample videos using both Python
and MATLAB®

III. RESULTS AND DISCUSSION

This algorithm proves to be effective in detecting moving


object in static background, fine tuning the algorithm can help
in using this algorithm for dynamic background also. Several
Fig.9: A frame with waving plants
advantage of this algorithm is listed as follows.

1) Boundlessness:
This algorithm works independent of the type of the input video
provided. So it’s versatile and easy to design programs out of it.
Fig.8 shows how the detection and tracking is successful in
focussing only on moving part and not on stationary objects i.e.
the man moves whereas the bench remains stationary on this
game of gymnastics Fig.7.

Fig.10: Waving of plants being detected

3) Faster and tuneable detection:


Since very few steps are needed for motion detection. This
algorithm performs much faster and very easy to implement in
embedded systems. There is a flexibility in choosing the most
prominent detection out of other detections, for example in the
previously shown sample Fig.9. The most prominent detection
i.e. the man alone can be highlighted and tracked from the
Fig.7: A frame from video of gymnastics video as shown in Fig.12. By further adjustments, the area of
2019 International Conference on Computer Communication and Informatics (ICCCI -2019), Jan. 23-25, 2019, Coimbatore, INDIA

interest of the user can be extracted easily. The performance


[2]. Parekh, Himani S., Darshak G. Thakore, and Udesang K. Jaliya. "A
of algorithm is tested with some widely used video and it is
survey on object detection and tracking methods." International
tested and timings are tabulated in Table 1. Journal of Innovative Research in Computer and Communication
Engineering 2, no. 2 (2014): 2970-2978.

[3]. Nieto, M., L. Varona, O. Senderos, P. Leskovsky, and J. Garcia.


"Real-time video analytics for petty crime detection." (2016): 23-6.

[4]. Singh, Akash Deep, Abhishek Kumar Annamraju, Devprakash


Harihar Satpathy, and Adhesh Shrivastava. "A Novel System to
Monitor Illegal Sand Mining using Contour Mapping and Color
based Image Segmentation." International Journal of Image
Processing (IJIP) 9, no. 3 (2015): 175.

[5]. Cao, Jiandong. "Research on Urban Intelligent Traffic Monitoring


System Based on Video Image Processing." International Journal of
Fig.11: Frame from same source of Fig.9 Signal Processing, Image Processing and Pattern Recognition 9, no.
6 (2016): 393-406.

[6]. Zhang, Haiying, and Kun Wu. "A vehicle detection algorithm based
on three-frame differencing and background subtraction." In
Computational Intelligence and Design (ISCID), 2012 Fifth
International Symposium on, vol. 1, pp. 148-151. IEEE, 2012

[7]. Evangelio, R. H., Ptzold, M. and Sikora, T.:’Splitting Gaussians in


mixture models’, Proc. Int. Conf.9th IEEE International Conference
on Advanced Video and Signal-Based Surveillance, AVSS’2012,
New York,2012, pp. 300–305.

[8]. Van Droogenbroeck, M. and Paquot, O. :’Background


Fig.12: Only the Region of Interest is tracked subtraction:experiments and improvements for ViBe’, Proc. Int.
Conf. IEEE Computer Society Conference on Computer Vision and
Pattern Recognition (CVPR)Workshops, New York, 2012, pp. 32–
Table 1: Average detection time from videos 37.

Video Average detection time (ms) [9]. Hofmann, M., Tiefenbacher, P. and Rigoll, G.:‘Background
Segmentation with feedback: the pixel-based adaptive segmenter’,
CDNET1 33.6 Proc. Int. Conf. IEEE Conference on Computer Vision and Pattern
KTH 17.6 Recognition—Change Detection Workshop, New York, 2012, pp.
38–43.
WEIZZMAN 39.2
[10]. Evangelio, R. H., Ptzold, M. and Sikora.:’Detection of static objects
for the task of video surveillance’, Proc. Int. Conf. IEEE Workshop
IV. CONCLUSION on Applications of Computer Vision, WACV’11, Washington,DC
,2011, pp.534–540.
Thus the moving object detection and tracking can be
effectively done using this algorithm. Due to its versatility, it
can be developed in prototyping boards such as nodeMCU and
integrated with camera and run as a standalone wireless
surveillance system. This algorithm changes the way that people
look video to process information out of it. As this algorithm
filters out the area of interest, enormous amount of storage can
be saved which is caused due to recording of stationary
instances. Due to the introduction of wide range surveillance
cameras, this algorithm is very effective in developing systems
which trigger alarm during time of detection. These systems can
be deployed on places of human absence

REFERENCE
[1]. Nishu Singla.:’Motion detection based on frame difference method’,
Proc. International Journal of Information & Computation
Technology,2014, pp.1559-1565

You might also like