Vous êtes sur la page 1sur 5

2008 Congress on Image and Signal Processing

A J2ME-Based Wireless Intelligent Video Surveillance System


Using Moving Object Recognition Technology
Lizhong Xu , Zhong Wang , Huibin Wang , Aiye Shi , Chenming Li
College of Computer and Information Engineering
Hohai University
Nanjing, P. R. China 210098
lzhxu@hhu.edu.cn / wz1980@gmail.com

Abstract Intelligent surveillance system has been evolution to


third generation, known as automated wide-area video
A low-cost intelligent mobile phone-based wireless surveillance system [1]. Combined computer vision
video surveillance solution using moving object technology, the distributed system is autonomic, which
recognition technology is proposed in this paper. The can also be controlled by remote terminals.
proposed solution can be applied not only to various A low-cost intelligent wireless security and
security systems, but also to environmental monitoring solution using moving object recognition
surveillance. Firstly, the basic principle of moving technology is presented in this paper. The system has
object detecting is given. Limited by the memory good mobility, which makes it a useful supplement of
consuming and computing capacity of a mobile phone, traditional monitoring system. It can also perform
a background subtraction algorithm is presented for independent surveillance mission and can be extended
adaptation. Then, a self-adaptive background model to a distributed surveillance system.
that can update automatically and timely to adapt to Limited by the memory consuming and computing
the slow and slight changes of natural environment is capacity in a mobile phone, background subtraction
detailed. When the subtraction of the current captured algorithm [1-6] is presented to be adopted in mobile
image and the background reaches a certain threshold, phones. In order to be adapted to the slow and slight
a moving object is considered to be in the current view, changes of the natural environment, a self-adaptive
and the mobile phone will automatically notify the background model updated automatically and timely is
central control unit or the user through phone call, detailed. When the subtraction of the current captured
SMS (Short Message System) or other means. The image and the background reaches a certain threshold,
proposed algorithm can be implemented in an a moving object is thought to be in the current view,
embedded system with little memory consumption and and the mobile phone will automatically notify the
storage space, so it’s feasible for mobile phones and central control unit or the user through phone call,
other embedded platforms, and the proposed solution SMS, or other means.
can be used in constructing mobile security monitoring Based on J2ME technology, we use JSR135 and
system with low-cost hardware and equipments. Based JSR120 to implement a prototype.
on J2ME (Java2 Micro Edition) technology, a
prototype system was developed using JSR135 (Java 2. Background Subtraction Technology
Specification Requests 135: Mobile Media API) and
JSR120 (Java Specification Requests 120: Wireless Background subtraction is a commonly used class
Messaging API) and the test results show the of techniques for segmenting out moving objects of
effectiveness of proposed solution. interest in a scene for applications such as surveillance.
It involves comparing an observed image with an
1. Introduction estimate of the image if it contained no objects of
interest. The areas of the image plane where there is a
The increasing need for intelligent video significant difference between the observed and
surveillance in public, commercial and family estimated images indicate the location of the objects of
applications makes automated video surveillance interest. The term “background subtraction" comes
systems one of the main current application domains in from the simple technique of subtracting the timely-
computer vision. Intelligent video surveillance systems updated background template from the observed image
deal with the real-time monitoring of persistent and and then thresholding the result to generate the objects
transient objects within a specific environment. of interest [6].

978-0-7695-3119-9/08 $25.00 © 2008 IEEE 281


DOI 10.1109/CISP.2008.235
The flow chart is shown in Figure 1.
In case of some random disturbances, each pixel
will fluctuate in a small range even there is no
expected moving objects in the scene. So there must be
a strategy to judge it. A threshold is defined in the
system. If the difference of one pixel between real time
frame and template is more than 10, then add 1 to the
threshold. When differences of all pixels in the frame
are all calculated, moving objects is thought to appear
Figure 1: Background Subtraction Algorithm if the threshold is more then 3 percent of the total
number of pixels in the frame.
2.1. Background Template Construction
2.3 Background Template Update
Before the moving objects can be identified, a
background template must be built. Due to the sun light changing very slowly, the
Generally, background and foreground (moving background template must be updated timely.
objects) are mixed together such as waving leaves in Otherwise the foreground can not be correctly
the garden and running automobiles on high way. The identified anymore. Add 1 to the pixels value in the
foreground can not be removed so the ideal background template if the corresponding pixels value
background image can not be retrieved. But the is more than it in the template, or subtract 1 if it is less.
moving objects do not exist in the same location in This algorithm is more efficient than “Moving Average
each frame of a real-time video sequence. An Algorithm” because it only uses addition and
“average” frame of the video sequence can be retrieved subtraction operation, and do not need much memory
to approach the ideal background image. The gray storage.
values of pixels which have the same location in each The algorithm is presented as follow:
frame of the video sequence are averaged to represent
the gray value of the pixel which located in the same For each pixel in Frame j:
place in the approximate background. An average If ( Pixel k > Pixel background k )
value of pixels in the same location of each frame in a
then {Pixelbackground k + +};
video sequence is calculated. To simplify, the (3)
approximate background is also called “background elseIf ( Pixel k < Pixel background k )
template”, “background” or “template” in the then {Pixelbackground k − −};
following contents.
Pixelk is a pixel in frame j, and Pixelbackground k is the
Frame1 + Frame2 + ... + Framei corresponding pixel in background template. These
Background first = two pixels have the same location in their frames.
i
(1)
With such method, the background template can
adjust automatically according to environment change.
In our prototype, the first 10 frames are captured to
calculate the background template (i=10). Moving
objects can not be identified in these frames. If the 3. J2ME Technology
moving objects move too slowly, i should be increased
to reduce the tolerance. In this article, we have implemented a prototype on
mobile telephones based on J2ME technology.
2.2 Moving Object Recognition Java™ Platform, Micro Edition (Java ME) is the
most ubiquitous application platform for mobile
After the background template has been devices across the globe. It provides a robust, flexible
constructed, the background image can be subtracted environment for applications running on a broad range
from the observed image. The result is foreground of other embedded devices, such as mobile phones,
(moving objects). Actually, the background is timely- PDAs, TV set-top boxes, and printers. Applications
updated. The update algorithm is detailed in the next based on Java ME software are portable across a wide
section. range of devices, yet leveraging each device's native
capabilities.
Foreground j =| Frame j − Background j | (j>i) (2)

282
3.1 Mobile Media API (JSR-135) already be set by the implementation (the address is
taken from the URL that was passed when the client
The Mobile Media API (MMAPI) extends the connection was created). Before sending the text
functionality of the J2ME platform by providing audio, message, the method populates the outgoing message
video and other time-based multimedia support to by calling setPayloadText().
resource-constrained devices [7] [9]. TextMessage tmsg
=(TextMessage)mc.newMessage(MessageConnection.
3.1.1 Getting a Video Capture Player The first step TEXT_MESSAGE);
in taking pictures (officially called video capture) in a tmsg.setPayloadText(msg);
MIDlet is obtaining a Player from the Manager. mc.send(tmsg);
Player mPlayer =
Manager.createPlayer("capture://video"); The main title (on the first page) should begin 1-3/8
The Player needs to be realized to obtain the inches (3.49 cm) from the top edge of the page,
resources that are needed to take pictures. centered, and in Times 14-point, boldface type.
mPlayer.realize(); Capitalize the first letter of nouns, pronouns, verbs,
adjectives, and adverbs; do not capitalize articles,
3.1.2 Showing the Camera Video The video coming coordinate conjunctions, or prepositions (unless the
from the camera can be displayed on the screen either title begins with such a word). Leave two 12-point
as an Item in a Form or as part of a Canvas. A blank lines after the title.
VideoControl makes this possible. To get a
VideoControl, just ask the Player for it: 4. Prototype
VideoControl mVideoControl =
(VideoControl)mPlayer.getControl("VideoControl"); The system architecture is shown in Figure 2.

3.1.3 Capturing an Image Once the camera video is


shown on the device, capturing an image is easy. All
you need to do is call VideoControl's getSnapshot()
method. The getSnapshot() method returns an array of
bytes, which is the image data in the format you Figure 2: System Architecture
requested. The default image format is PNG (Portable
Network Graphic). In the prototype system, if the difference between
byte[] raw = mVideoControl.getSnapshot(null); real-time frame and template reaches a predefined
Image image = Image.createImage(raw, 0, threshold, moving objects are considered to appear.
raw.length); Then the handset will send out an alert SMS.
Since the device has good mobility, it can be put
3.2 Wireless Message API (JSR-120) anywhere including those area not covered by other
surveillance system. And it can be deployed rapidly in
The J2ME Wireless Toolkit supports the Wireless emergency.
Messaging API (WMA) with a sophisticated
simulation environment. WMA 1.1 (JSR 120) enables
MIDlets to send and receive Short Message Service
5. Experiment
(SMS) or Cell Broadcast Service (CBS) messages.
The prototype has been implemented on Motorola
WMA 2.0 (JSR 205) includes support for MMS
E680 GSM phone and Motorola ic902 CDMA1X
messages as well [8] [10].
phone. The phone fact sheet is listed below.
3.2.1 Creating a MessageConnection To create a
client MessageConnection just call Connector.open(), Table 1: Phone Fact Sheet
passing a URL that specifies a valid WMA messaging E680 IC902
protocol. CPU Intel xScale™ Qualcomm MSM6550
MessageConnection mc = 300 MHz 225 MHz ARM9™
(MessageConnection)Connector.open(addr); OS Linux CDMA Brew
Screen 240*320 65K colors
3.2.2 Creating and Sending a TextMessage The Camera 0.3 Mega pixel 2.0 Mega pixel
connection is a client, the destination address will Java MIDP 2.0 JSR135 JSR120 etc.

283
Data GPRS Class 10 CDMA1X of several frame time. The “Template time” is the total
Service 32-48kbps 400-700kbps time to construct the background template.
In this instance, the “Snapshot time” , ”DIP time”
Figure 3 is the UI (User Interface) of the prototype and “Frame time” of the 100th frame are presented.
application. The first picture in the form is real time And the “Frame time Average” of the 100 frames and
frame, which is got from the camera originally. The “Template time” are also given.
second image is the template image. If there are some
moving objects being detected, the third picture will be Table 2: Performance (“ms” is millisecond)
displayed on the form. And some real time information
E680 IC902
is displayed below the pictures.
Image size 192*192 160*120
Snapshot time (100th frame) 1213 ms 1565 ms
DIP (digital image process) 278 ms 296 ms
time (100th frame)
Frame time (100th frame) 1491 ms 1861 ms
Frame time Average (100 1542 ms 1792 ms
frames)
Template Time (first 10 20422 ms 25639 ms
frames)

As shown in Table 2, the background template can


be built in less than half a minute. And the total time to
Figure 3: Java Demo calculate a frame is around one and a half seconds. It
meets the requirements to be a family security
Since the first several frames must be stored to monitoring system and an anti-theft system. The
calculate the template, a big memory heap size is experiment demonstrates the feasibility of the proposed
needed. For E680, the image size is 192*192.The Java system.
Virtual Machine heap is big enough to store the Some frames are magnified to be seen more clearly
frames. But for ic902, the image size is 640*480.The (See Figures 4 - 6). Figure 4 is the self-adaptive
JVM heap can’t provide so much memory. There are background template. As shown in Figure 5 and 6, a
two methods to solve this problem. First, the frames person run into the scene was identified immediately.
can be stored to the EFS (Embedded File System).
Second, the image size can be reduced. The first
method can provide high resolution image data, which
contains more detailed image features. But storing to
EFS will take a much longer time than storing to
memory, and much longer time is need in the
following calculating processes. The second method
will lost some detailed image features, but it can fully
operated in memory and reduce much processing time.
Considered the requirements of the real time ability,
the second method is adopted. The image size is
reduced to 160*120, which is still enough to be used to
identify the moving objects.
The performance for 100 frames is detailed in Table
2. The term “Snapshot time” is the time length to get
the image though J2ME MMA API. It mainly depends
on the capability of Hardware, Operating System and Figure 4: Background Template
Java VM. The “DIP (digital image process) time” is
the time length to perform the background subtraction
algorithm, including images compare and template
update. The “Frame time” is the total time to process a
frame which equals to the sum of “Snapshot time” and
“DIP time”. The “Frame time Average” is an average

284
Also, the system can be extended to a distributed
wireless network system. Many terminals work
together, reporting to a control center and receiving
commands from the center. Thus, a low-cost wide-area
intelligent video surveillance system can be built.
Further more, with the development of embedded
hardware, more complex digital image process
algorithms can be used to give more kinds of
applications in the future.

7. Acknowledgements
This work was supported by the National High
Technology Research and Development Program of
China (863 Program) (2007AA11Z227).
Figure 5: Real Time Frame
8. References
[1] M Valera, SA Velastin, Intelligent distributed
surveillance systems: a review. IEE Proceedings on Visual
Image Signal Processing, April. 2005, vol. 152, vo.2, pp.192-
204.
[2] M. Piccardi, Background subtraction techniques: a
review, IEEE International Conference on Systems, Man and
Cybernetics, Oct. 2004, vol. 4, pp. 3099–3104.
[3] T. Horprasert, D. Harwood and L.S. Davis, A Robust
Background Subtraction and Shadow Detection, Proc.
Proceedings of the Fourth Asian Conference on Computer
Vision, January 2000, vol. 1, pp. 983-988.
[4] Y Ivanov, A Bobick, J Liu, Fast Lighting Independent
Background Subtraction, International Journal of Computer
Vision, Jun. 2000, vol. 37, no. 2, pp. 199–207.
[5] A Elgammal, D Harwood, L Davis, Non-parametric
Figure 6: Foregrounds (Moving Object) Model for Background Subtraction, Proceedings of the 6th
European Conference on Computer Vision-Part II, 2000, pp.
6. Conclusion 751-767
[6] Alan, M. McIvor, Background Subtraction Techniques,
The moving object recognition technology led to Proceedings of Image & Vision Computing New Zealand
the development of autonomous systems, which also 2000 IVCNZ’00, Reveal Limited, Auckland, New Zealan,
2000.
minimize the network traffic. [7] C. Enrique Ortiz, The Wireless Messaging API
With good mobile ability, the system can be developers.sun.com, 2002
deployed rapidly in emergency. And can be a useful [8] Jonathan Knudsen, Taking Pictures with MMAPI
supplement of traditional monitoring system. developers.sun.com, 2003.
With the help of J2ME technology, the differences [9] Sun Microsystems, Inc., Nokia Corporation., JSR135
of various hardware platforms are minimized. All MMAPI 1.2 (Final Version) Specification, 2006.
embedded platforms with camera equipped and [10] Sun Microsystems, Inc., JSR 120 Wireless Messaging
JSR135/JSR120 supported can install this system API (WMA) specification, 2002.
without making any changes to the application.

285

Vous aimerez peut-être aussi