Motion Detection and Analysis with Four Different Detectors
Ching Yee Yong, Rubita Sudirman
Faculty of Electrical Engineering
Universiti Teknologi Malaysia
Kim Mey Chew
Faculty of Computer Science and Information System
Universiti Teknologi Malaysia
Abstract— A change in measurement of speed or vector of an
object or objects in the field of view is called motion. Detection
of motion can be achieved by electronic devices or mechanical
devices that interact or quantify the changes in the given
environment. In this paper, a monitoring system is being
enhanced utilizes motion detection technology with modified
internationally recognized algorithms, implemented in C sharp
and Matlab programming language. The result of this study is
expected to be beneficial and able to assist users on effective
motion detection and analysis. Four different motion detectors
are being compared. The assessment includes three trials in
three different speeds of motion and Morph filter has given a
better and smooth detection. In conclusion, an effective motion
assessment and monitoring system has been developed for the
improvement of the motion detection ability.
Keywords- Motion; motion detection; morph; motion
Motion can be detected by: sound (acoustic sensors),
opacity (optical and infrared sensors and video image
processors), geomagnetism (magnetic sensors,
magnetometers), reflection of transmitted energy (infrared
laser radar, ultrasonic sensors, and microwave radar sensors),
electromagnetic induction (inductive-loop detectors) and
vibration (triboelectric, seismic, and inertia-switch sensors)
There are many approaches for motion detection in a
continuous video stream. All of them are based on
comparing of the current video frame with one from the
previous frames or with something that called as
background. In this paper, there are four approaches are used
and comparison is made to find out a best detector for an
effective motion detection.
The system supports the AVI files, JPEG from internet
cameras, MJPEG (motion JPEG) stream, local capture
device and webcam.
This paper is divided into six sections. The first section
mainly introduces the whole study. It provides the general
overview of the motion and analysis system. The second
section includes the objectives of this study, which describes
the aims that needed to be achieved. The third section
discusses the background studies, literature review and the
study implementation. A specification list of the computer
environment and thorough discussion on the developmental
tool or assessment and analysis on various motions will be
explained in section 4. Finally, the last section contains the
conclusions, future developments and possible enhancement
and improvement on this study.
II. PROBLEM FORMULATION
The hypothesized function of this monitoring system is to
provide the users with information about the detection of an
object’s movement in order to deliver useful information
about the motion with connection to the theory of motion
through movement. The subjective experience of motion is
simple hypothesized as the feedback from tiny movement
and differences between two frames. In this study, the
practice item of motion was focused on comparison among
The objectives of the fundamental studies are as follows:
To implement the algorithm for motion detection analysis
in a newly developed monitoring system.
To compare and analysis among four detectors used
(Current and Previous, Pixellate, Blob Counter and
Counterbalancing should be instituted to control for order
effects and efforts made to ensure that all subjects complete
objectives. New task need to be developed drawing on the
best features of existing tasks.
A wide variety of human-machine interactions learning
techniques have been used in human monitoring approaches
for motion analysis. This employs a large number of visual
and physiological features, a fact which usually impedes the
training process .
In this paper, an effective monitoring system for motion
assessment is presented. Several aspects for example the
speed of the subject are considered while the assessment is
being done. This monitoring system does not only serves
motion movement as assessment, but also important in
managing the subject data effectively and providing
scientific information about object’s movement.
2011 Third International Conference on Computational Intelligence, Modelling & Simulation
978-0-7695-4562-2/11 $26.00 © 2011 IEEE
III. LITERATURE REVIEW
A. Current Frame vs. Previous Frame
One of the common approaches for a motion detector is
to compare the current frame of a streaming video with the
previous frame. It is very useful in video compression
especially in estimation of changes, writing only the
changes and not the whole frame.
Firstly, Difference and Threshold filters are used to
distinguish the difference regions between an original gray
scaled frame and the previous video gray scaled frame. An
image with white pixel on the difference regions is obtained
on the specified threshold value. A motion event can be
signaled if the value is greater than a predefined alarm level
Then, erosion filter is used to remove random noisy
pixels since mostly of cameras produce a noisy image. The
Erosion filter is a morphological filter that changes the
shape of objects in an image by eroding (reducing) the
boundaries of bright objects and enlarging the boundaries of
dark ones. It is often used to reduce or eliminate small
bright objects .
This filter assigns minimum value of surrounding pixels
to each pixel of the result image. Surrounding pixels, which
should be processed, are specified by structuring element: 1
to process the neighbour or -1 to skip it. It is very useful for
binary image processing, where it removes pixels, which are
not surrounded by specified amount of neighbours. It gives
ability to remove noisy pixels or shrink objects .
At this stage, an actual motion is obtained since mostly
only the interest regions are being detected. From the below
picture, the disadvantages of the approach had been
discovered. If the object is moving smoothly, small changes
from frame to frame was received. Hence, it is a problem and
difficulty to get the whole moving object. Things become
worse when the object is moving so slowly and the
algorithms will not give any result at all.
B. Current Frame vs. First Frame
Another approach is to compare the current frame with
the first frame in the video sequence. Comparison between
these two frames were resulting the whole moving object
independently of its motion speed.
At the beginning, the first frame of video sequence is set
as background frame. The upcoming frames are always
comparing with this background frame. The most important
approach here is to “move” the background frame slightly in
the direction of the current frame on the specified amount
for example used one level per frame. Then, the colours of
pixels in the background frame are changed by one level per
The most efficient algorithms in detection motion are
building the scene or background frame as a reference to
make comparison with the current frame. Some approaches
listed below are rather simple if compared with the most
which are too complex.
C. Pixellate Filter
Pixel art scaling algorithms are image scaling algorithms
specifically designed to upsample (enlarge) low-resolution
pixel and line art that contains thin lines, solid areas of
colour rather than gradient fills or shading and has not been
It is a simple pixellation algorithm that takes the median
of the saturation over each square and the mean of the
luminescence. The main idea of this filter is to replace
pixels in some rectangular area with their average value and
produces a nicely graduated luminescence by taking the
mean of the hue is prone to error since adjacent hue indices
can be radically different colours .
Hence, the pixellated versions of the current and
background frames are produced. The next step is to move
the background frame towards the current frames and the rest
is only the main processing step .
D. Blob Counter
The idea of blob detection is to turn an image of pixels
into a collection of “super pixels”. Blob detection works by
grouping sets of pixels that fall within a particular range of
colours. The rest of the image can then be discarded and the
resulting superpixels can either be highlighted on the image
or sent for further processing. This creates very specific
areas of interest, which can be processed further, as each
region has a set of coordinates.
This approach has a great possibility for performance
optimization. It provides the number of objects, position and
dimension on a binary image. Blob counter is a very useful
feature and can be applied in many different applications. It
can count objects on a binary image and extract them. The
idea comes from “Connected components labeling,” a filter
that colors each separate object with a different color .
Blob extraction is also very useful because once the super
pixels have been identified, a simple calculation can be
performed to see if the blob meets per determined conditions,
such as height, width or shape .
In this section, the procedures and the methods used for
the monitoring system will be described. C Sharp and Matlab
software are used in all the programming section. Generally,
the flow of the motion monitoring system is as in Figure 1.
First, a short motion of hand waving with a ring on the
last finger as reference is recorded real-time with a laptop
webcam. The data is then fed into system for analysis using
four different detectors. Result of motion detection is
generated parallel with the data input. All the detected
motions are highlighted with red colour.
Motion alarm is added into the motion detection system
by calculate the amount of white pixels on the difference
image between current frame and background frame.
Figure 1. Block diagram for motion assessment and training monitoring
A. Proposed Approach
Morphing is a special effect in 2D images that changes
(or morphs) one image into another through a seamless
transition. Most often it is used to depict one person turning
into another through technological means or as part of a
fantasy or surreal sequence. Traditionally such a depiction
would be achieved through cross-fading techniques on film.
Since the early 1990s, this has been replaced by computer
software to create more realistic transitions .
The idea of the filter is to preserve specified percentage
of the source filter and to add missing percentage from
overlay image. So, if the filter was applied to source image
with percent value equal to 60%, then the result image will
contain 60% of source image and 40% of overlay image.
Applying the filter with percent values around 90% makes
background image changing continuously to current frame.
This new filter has two benefits that it is much simpler
to understand and produce better performance due to the
efficiency of implementation of filter.
Figure 2. Result image (from left) using Current vs. Previous Frame, Pixellate Filter, Blob Counter and Morph Filter with increasing motion speed.
Figure 3. Result image (from left) using Current vs. Previous Frame, Pixellate Filter, Blob Counter and Morph Filter for a small table tennis ball detection.
The advantage of this monitoring system over other is the
ability of this monitoring system to provide an effective and
easy method for user. It is important to consider the
assessment in all the aspects including speed and
The most appropriate monitoring available is this system
able to monitor a progress in a long time. Result is presented
in Figure 2. Four different detectors are used in the system
starts from left is comparing current frame with previous,
pixellate filter, blob counter and morph. All these detectors
are working smoothly with high efficiency during slow
motion about 6.40 frames per second (fps).
On the other hand, when the system is applied on very
fast motion around 36 fps, morph filter is able to detect the
object’s motion clearly with a tiny lagging rather than the
previous three detectors but there is an interesting finding
that pixellate detector is unable to detect a very fast
movement. It will automatically decrease the motion to
become slow motion for an analysis due to its characteristic
of enlarge low resolution image and it takes longer time to
process the mean for detection. Some sections of the trial
motion like subject’s palm center and subject’s ring on the
last finger were successfully detected by the last detector.
Another motion video was analyzed using this four
detectors and the result showed that morph filter able to
detect the fast movement of table tennis ball effectively for
a long period. The detector can detect, recognize and coping
out a zone of interest of every moving object in a frame.
The result indicates that morph filter is better in motion
detection for the monitoring system. The detection is
running smoothly and available in fast motion detection.
This monitoring system also could be revised to make
them more user-friendly, with a focus on issues such as
layout, illustrations, message, information, and cultural
appropriateness. It provides full functionality for the entire
assessment cycle: authoring, scheduling, administering and
rating. A non-technical rationale for using the procedure,
including the type of information and what we can do with
this information will be provided. It is a premier and
affordable personal computer-based assessment system for
academia, government and business users.
The monitoring system is designed around four essential
qualities: validity, reliability, impact and practicality.
Validity is normally taken to be extent to which an
assessment can be shown to produce scores which are an
accurate reflection of a human’s motion true level.
Reliability concerns the extent to which assessment results
are stable, consistent and accurate, and therefore the extent
to which they can be depended on for making decisions
about the motion. Impact concerns the effects, beneficial or
otherwise, which an examination has on the motion.
Practically can be defined as the extent to which an
assessment is practicable in terms of the resources needed to
produce and administer it.
There is a lot to do with this motion detection monitoring
system depending on the imagination. One but not the only
one straight forward application for this system is video
surveillance. It also can be applied on the incredible thing
likes gesture recognition, behavioral analysis and gait
In conclusion, an effective monitoring system for motion
detection and assessment tool has been developed. The level
of motion is used as the input for the monitoring system to
generate assessment to the motion detection to the particular
person specifically. Results and findings show that the
monitoring system is effective and consistent in producing
relevant results to the detected motion. This monitoring
system can be developed in the algorithm for speech
recognition system in order to obtain more accurate and
reliable voice input.
In future, this system will be upgraded to mobilize
resources to provide the necessary infrastructure, supplies
and materials needed to ensure every assessment is
achieving the motion analysis potential. This is important to
increase the reliability and effectiveness of this monitoring
A more detailed concept of motion detection will be
more useful in later processing stages. As in image flow
algorithm, all the information is need to be incorporated on
the direction of motion. Optimization in realization is very
important for a optimize solution from the beginning.
The authors are deeply indebted and would like to
express our gratitude to the Universiti Teknologi Malaysia
and Ministry of Higher Education (MOHE) for supporting
and funding this study under Research University Grant
(QJ13000.7123.00H44) and Zamalah Scholarship Scheme.
Our appreciation also goes to the Electronics and Biomedical
Instrumentation (bMIE) for their cooperation in the research
 Randal, C. N. (1991). “Qualitative Detection of Motion by a Moving
Observer”, Proc. IEEE Conference on Computer Vision and Pattern
Recognition, Maui Hawaii, 173-178.
 Loui et al. (1990). “High-Speed Architectures for Morphological
Image Processing”, Nonlinear Image Processing, pp. 145-156.
 Sternberg, S. R. (1983). IEEE Computer, Biomedical Image
Processing, CytoSystems Corporation.
 Heijmans, H. J. and Ronse, C. (1990). The algebraic basis of
mathematical morphological-I: Dilations and erosions, J. Comput
Vision, Graphic, Image Process, Vol. 50.
 Ramprasad, P. and Randal, C. N. (1994). “Recognition of Activities”,
Proc. International Conference on Pattern Recognition, Jerusulem,
 Tetsuya, M., Makoto, N., Tomohiro, Y. and Shinji, T. (2010).
“Comparison of Color Space in Extraction of a Hand Region
for Computer Human Interface Using Color Image
Processing”, Technical report of IEICE. PRMU 98(528).
 Thomas, K. (1999). “Fast Blit Strategies: A Mac Programmer's
 “Eagle (idea)”. Everything2. 2007-01-18.
 Stepin, M. (2007). “hq3x Magnification Filter”.
 AForge.NET. (2009, 03 27). BlobCounter.cs.
Retrieved 03 01, 2010, from code.google.com:
 Amit, Y. (2002). 2D Object Detection and Recognition: Models,
Algorithms, and Networks. Chicago: Cambridge, Mass. MIT Press,
 Kalman, R. E. (1960). A new approach to linear filtering and
prediction problems, Transactions of the ASME -- Journal of Basic
Engineering, Series D, pp. 35-45.