Вы находитесь на странице: 1из 4

©ELECTRON

Department of ECE, Amrita Vishwa Vidyapeetham, Coimbatore

A J2ME-Based Wireless Automated Video


Surveillance System
Using Motion Detection Method
Ashwin S, Sathiya Sethuram A, Varun A, Vasanth P
AMRITA School of Engineering,AMRITA VISHWA VIDAPEETHAM ,
Coimbatore- 641105
sashwinamrita@gmail.com s_sethuram2004@yahoo.co.in varun007amrita@gmail.com
vasanthrpjan1@yahoo.co.in

Abstract remote terminals. A low-cost intelligent wireless security


A low-cost automated mobile phone-based wireless Video and monitoring solution using motion detection
surveillance solution using motion detection method is technology is presented in this paper. The system has
proposed in this paper. The proposed solution can be good mobility, which makes it a useful supplement of
applied not only to various security systems, but also to traditional monitoring system. Limited by the memory
environmental surveillance. Firstly, the basic principle of consuming and computing capacity in a mobile phone,
motion detection is given. Limited by the memory cross correlation technique is presented to be adopted in
Consuming and computing capacity of a mobile phone, a mobile phones. In order to be adapted to the slow and
cross-correlation technique is presented for adaptation. slight changes of the natural environment, a self-adaptive
Then, a self-adaptive background model that can update background model updated automatically and timely is
automatically and timely to adapt to the slow and slight detailed.
changes of natural environment is detailed. Divide the
current captured image into four quadrants and When the 2. Motion Detection Method
cross correlation of one or more quadrant reaches a The mobile-phone’s camera is switched on and the
certain threshold, a moving object is considered to be in images are captured after every 0.25 seconds. A
the current view, and the mobile phone will automatically background template is constructed first and is updated
notify the user by sending the particular image through periodically with respect to weather changes. The
MMS (Multimedia Message Service). The proposed acquired images are compared with the template using
method can be implemented in an embedded system with cross correlation method and if any suspicious movement
little memory consumption and storage space, so it’s is found, the user is notified by MMS of the motion
feasible for mobile phones and the proposed solution can detected image.
be used in constructing mobile security monitoring system
with low-cost hardware and equipments. Based on J2ME
(Java2 Micro Edition) technology, a prototype system was
developed using JSR135 (Java Specification Requests
135: Mobile Media API) and JSR120 (Java Specification
Requests 120: Wireless Messaging API) and the test
results show the effectiveness of proposed solution.

1. Introduction
The increasing need for intelligent video surveillance in
public, commercial and family applications makes
automated video surveillance systems one of the main
current application domains in computer vision. Figure 1: Motion Detection method
Intelligent video surveillance systems deal with the real-
time monitoring of persistent and transient objects within
a specific environment. Intelligent surveillance system
has been evolution to third generation, known as 2.1 Background Template Construction
automated wide-area video surveillance system. Before the moving objects can be identified, a
Combined computer vision technology, the distributed background template must be built. The foreground
system is autonomic, which can also be controlled by cannot be removed so the ideal background image cannot

Conference Proceedings RTCSP’09 87


©ELECTRON
Department of ECE, Amrita Vishwa Vidyapeetham, Coimbatore

be retrieved. But the moving objects do not exist in the two images will be divided into 4 equal quadrants. First
same location in each image of a real-time video quadrant of the first image with the corresponding
sequence. The gray values of pixels which have the same quadrant of the second image is compared. The pixel
location in each frame of the video sequence are averaged values of these two quadrants are used to obtain the
to represent the gray value of the pixel which located in correlation value. Similarly the other three quadrants are
the same place in the approximate background. An compared and the formula is applied to get the remaining
average value of pixels in the same location of each frame three values. These four values are checked with the
in a video sequence is calculated. To simplify, the correlation value (r =1).If it is less than 1, depending upon
approximate background is also called “background the range, the type of the motion is detected. Among the
template”. four values obtained, the minimum value represents
In our prototype, the first 10 images are captured to maximum motion. This entire process is repeated for all
calculate the background template. remaining consecutive images and the value of “r” is
calculated for all cases.
2.2 Correlation Technique
In this technique, the captured images are Sub- divided
into four equal parts. A two dimensional cross correlation
is calculated using the formula given below between each
sub image with its corresponding part in the Background
template.

r = Correlation value
A = matrix representing pixel values of first image
B = matrix representing pixel values of second image
Such that
Size (A) = Size (B)
A = Average of (A)
B = Average of (B)

This process produces four values ranging from -1 to


1depending on the difference of the two correlated
images. The value is 1 if there is no motion and this value Figure 2: Basic Steps of Correlation Network
keeps on decreasing as the level of motion increases. The
goal of this division is to achieve more sensitivity so the
2.3 Background Template Update
minimum value of correlation can be used as variance
Due to the sun light changing very slowly, the
value which shows maximum motion. If the value lies
background template must be updated timely. Otherwise
between the ranges 0.9 to 0.8 then it is low level motion
the foreground cannot be correctly identified anymore.
,if it is nearer to 0.5 then it is medium level motion else it
Add 1 to the pixels value in the background template if
is high level motion.
the corresponding pixels value is more than it in the
For the purpose of correlating, the first two images are
template, or subtract 1 if it is less. This algorithm is more
considered. These images are resized to get equal ordered
efficient than “Moving Average Algorithm” because it
matrices for the purpose of ease in quadrant division.
only uses addition and subtraction operation, and do not
Comparing the pixel values when they are in RGB form,
need much memory storage.
it is quite difficult and complex as each pixel consists of
three values (Red intensity, Green intensity and Blue
intensity at that point). So they are converted to gray
images where the pixel comparison is flexible. Then these

Conference Proceedings RTCSP’09 88


©ELECTRON
Department of ECE, Amrita Vishwa Vidyapeetham, Coimbatore

The first step in taking pictures (officially called video


capture) in a MIDlet is obtaining a Player from the
Manager.
Player mPlayer =
Manager.createPlayer("capture://video");

The Player needs to be realized to obtain the resources


that are needed to take pictures.
mPlayer.realize();
Pixel k is a pixel in frame j, and Pixel background k is the
corresponding pixel in background template. These two 3.1.2 Showing the Camera Video
pixels have the same location in their frames. With this The video coming from the camera can be displayed on
method, the background template can adjust automatically the screen either as an Item in a Form or as part of a
according to environment change. Canvas. A VideoControl makes this possible. To get a
VideoControl, just ask the Player for it:
VideoControl mVideoControl =
(VideoControl)mPlayer.getControl("VideoControl");

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 requested. The default image format is
PNG (Portable Network Graphic).
byte[] raw = mVideoControl.getSnapshot(null);
Figure 3: Background Template/Captured Image Image image = Image.createImage(raw, 0,
raw.length);
3. J2ME Technology
In this paper, we have implemented a prototype on 3.2 Wireless Message API (JSR-120)
Mobile phones based on J2ME technology. Java™ The J2ME Wireless Toolkit supports the Wireless
Platform, Micro Edition (Java ME) is the most ubiquitous Messaging API(WMA) with a sophisticated simulation
application platform for mobile devices across the globe. environment. WMA 1.1 (JSR 120) enables MIDlets to
It provides a robust, flexible environment for applications send and receive Short Message Service (SMS) or Cell
running on a broad range of other embedded devices, such Broadcast Service (CBS) messages. WMA 2.0 (JSR 205)
as mobile phones, PDAs, TV set-top boxes, and printers. includes support for MMS messages as well.
Applications based on Java ME software are portable
across a wide range of devices. 3.2.1 Creating a Message Connection
To create a client Message Connection just call
Connector.open(), passing a URL that specifies a valid
3.1 Mobile Media API (JSR-135)
WMA messaging protocol.
The Mobile Media API (MMAPI) is an API
MessageConnection mc =
specification for the Java ME platform CDC and CLDC
(MessageConnection)Connector.open(addr);
devices such as mobile phones. Depending on how it's
implemented, the APIs allow applications to play and
3.2.2 Creating and Sending a Text Message
record sounds and video, and to capture still images.
The connection is a client, the destination address will
MMAPI was developed under the Java Community
already be set by the implementation (the address is taken
Process as JSR 135. The Multimedia Java API is based
from the URL that was passed when the client connection
around four main types of classes in the
was created). Before sending the text message, the
javax.microedition.media package-the Manager, the
method populates the outgoing message by calling
Player, the PlayerListener and various types of Control.
setPayloadText().

TextMessagetmsg=(TextMessage)mc.newMessage(Messa
3.1.1 Getting a Video Capture Player
geConnection.

Conference Proceedings RTCSP’09 89


©ELECTRON
Department of ECE, Amrita Vishwa Vidyapeetham, Coimbatore

TEXT_MESSAGE); supported can install this system without making any


tmsg.setPayloadText(msg); changes to the application. Also, the system can be
mc.send(tmsg); extended to a distributed wireless network system. Many
terminals work together, reporting to a control center and
4. Prototype receiving commands from the center. Thus, a low-cost
In the prototype system, if the difference between wide-area intelligent video surveillance system can be
real- time image and template reaches a predefined built. Further more, with the development of embedded
hardware, more complex digital image process algorithms
can be used to give more kinds of application in the
future.

8. Acknowledgements
We would like to thank the Authors Renzo Perfetti,
Figure 4: System Architecture Daniele Casali and our tutors Smitha H and Karthi R for
giving many helpful suggestions.
Correlation value, moving objects are considered to
appear. Then the handset will send out an alert MMS.
Since the device has good mobility, it can be put 9. References
anywhere including those area not covered by other
surveillance system. And it can be deployed rapidly in 1. An Efficient Moving Object Detection and
emergency. Description Tao Xia1, Chaoqiang Liu2, Hui Li2
Centre for Wavelets, Approximation and Information
5. System Requirements Processing, National University of Singapore
Temasek Laboratories and Centre for Wavelets,
Approximation and Information Processing, National
 Java enabled Mobile phones with minimum 1.3 MP University of Singapore
Camera. 2. A J2ME-Based Wireless Intelligent Video
 Mobile phone with Video capturing facility. Surveillance System Using Moving Object
 All embedded platforms with camera equipped and Recognition Technology Lizhong Xu , Zhong
JSR135(MMAPI)/JSR120(WMA) supported can Wang , Huibin Wang , Aiye Shi , Chenming Li
install this system. College of Computer and Information Engineering
 MMS functionality enabled SIM card. Hohai University Nanjing, P. R. China 210098
3. Detection of Moving Images Using Neural
6. Expected Results Network P. Latha, L. Ganesan, N. Ramaraj, and P.
The proposed system can be implemented in any java V. Hari Venkatesh
enabled phones using SUN JAVA Wireless Tool kit 4. Moving object detection Renzo Perfetti, Daniele
2.5 and JAVA ME (Micro Edition) SDK 3.0. The Java Casali, Giovanni Costantini
application created using the environment mentioned 5. Javed, O. and Shah, M., “Tracking and Object
above is installed in the mobile phone to be used for Classification for Automated Surveillance,” Proc
surveillance purpose. The owner has another mobile with European Conf. on Computer Vision (ECCV), 2002.
MMS activated network on the other hand. When a 6. M Valera, SA Velastin, Intelligent distributed
suspicious object is detected, the corresponding image is surveillance systems: a review. IEE Proceedings on
sent to the owner mobile through MMS. The owner’s Visual Image Signal Processing, April. 2005, vol.
mobile number is stored in the surveillance mobile. 152, vo.2, pp.192-204.
7. M. Piccardi, Background subtraction techniques: a
7. Conclusion review, IEEE International Conference on Systems,
The motion detection method using cross correlation Man and Cybernetics, Oct. 2004, vol. 4, pp. 3099–
led to the development of autonomous systems, which 3104.
also minimize the network traffic. With good mobile
ability, the system can be deployed rapidly in emergency.
And can be a useful supplement of traditional monitoring
system. With
the help of J2ME technology, the differences of various
hardware platforms are minimized. All embedded
platforms with camera equipped and JSR135/JSR120
Conference Proceedings RTCSP’09 90

Вам также может понравиться