44
Motion Detection Security Camera Introduction This text tries to clear out the mystery of how to make motion detection using web cam with security using VB.NET. All business wants to capture video to his office by a web cam for 24 hrs, but the problem is that the space required on hard-disk is very extreme. So, to make a way to save disk space. Valid proposed to make a motion-detection circuit (IR, Ultra sonic) and connect it to the PC serial port and check for input every period of time. If there is any input then run the record program and start to capture video. But I replied that its a bad way because the thief will run away before the slow computer requests a web cam to start capturing video. Project Concept So my idea was to take a position from a web cam on the product (Safer, locker) every period of time the camera focus to the product, in any movement before the camera, the security system alert sounds, take pictures and dial to particular cell or phone number via com port. 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 we'll call background. To describe some of the most common approaches. One of the most common approaches is to compare the current frame with the previous one. It's useful in video compression when you need to estimate changes and to write

Motion Detection Sceurity Camera

Embed Size (px)

DESCRIPTION

VB.NET

Citation preview

Page 1: Motion Detection Sceurity Camera

Motion Detection Security Camera

Introduction

This text tries to clear out the mystery of how to make motion detection using web

cam with security using VB.NET. All business wants to capture video to his office by a

web cam for 24 hrs, but the problem is that the space required on hard-disk is very

extreme. So, to make a way to save disk space. Valid proposed to make a motion-

detection circuit (IR, Ultra sonic) and connect it to the PC serial port and check for input

every period of time. If there is any input then run the record program and start to capture

video. But I replied that its a bad way because the thief will run away before the slow

computer requests a web cam to start capturing video.

Project Concept

So my idea was to take a position from a web cam on the product (Safer, locker)

every period of time the camera focus to the product, in any movement before the camera,

the security system alert sounds, take pictures and dial to particular cell or phone number

via com port.

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 we'll call background. To describe some of the most

common approaches.

One of the most common approaches is to compare the current frame with the

previous one. It's useful in video compression when you need to estimate changes and to

write only the changes, not the whole frame. But it is not the best one for motion

detection applications. So, let me describe the idea more closely.

Assume that we have an original 24 bpp RGB image called current frame (image), a

grayscale copy of it (currentFrame) and previous video frame also gray scaled

(backgroundFrame). First of all, let's find the regions where these two frames are

differing a bit. For the purpose we can use Difference and Threshold filters.

Project : Motion Detection Security Camera

Language : VB.NET

Version : 2005

Page 2: Motion Detection Sceurity Camera

1. Introduction

Ambient intelligence is a digital environment that is responsive and adaptive to

human presence. Within a home environment ambient intelligence can improve the

quality of life by creating a functional, inter-connected, personalized systems and

services. Ambient intelligence technologies are expected to combine concepts of

ubiquitous computing and intelligent systems putting humans in the centre of

technological developments.

Today’s many intelligent systems utilize forms of inputs from video cameras. The

basic usage of such computer vision based systems is motion tracking, for our project

namely human motion tracking and fire detection or locker watcher with a pan-tilt web

camera. Additionally, our system is capable of sending a warning message in case of an

unexpected situation (fire detection or it can be non entrance area)

Some examples of applications with reliable human motion detection and tracking are:

· Automated surveillance for security-conscious venues such as airports, casinos,

museums, and government installations: Intelligent software could monitor security

cameras and detect suspicious behavior. Automated surveillance increases the

productivity of the human operator and coverage of the surveillance.

· Human interaction with mobile robotics: Autonomous mobile robots in the workplace

or home could interact with the humans around them if they could reliably detect their

presence.

For example, robots can assist to the elderly or disabled people when assistance is needed

Based on the motion of a person.

· Safety devices for pedestrian detection on motor vehicles: Intelligent software on a

camera-equipped car could distinguish pedestrians and warn the driver.

Page 3: Motion Detection Sceurity Camera

· Other applications include athlete training, clinical gait analysis, traffic monitoring.

What would be useful in real life applications is a camera that can track a person of

interest on a dynamic and realistic background. The purpose of using a pan-tilt camera is

so that the system can acquire moving person from a broader field of view.

Additionally, some important considerations, when designing a system like above,

include the need for fast processing speeds, as the system is a hard real time system. Also,

accuracy must be maintained throughout all the components of the design, since the

reliability of the system depends on the weakest component. The rest of this document

describes our solution for how this can be achieved.

2. System Description

The real time human tracking and fire detection system consists of a camera, a PC,

power supplies, two servo motors, and a tripod for the web camera. The camera is capable

of panning and tilting and is controlled via the commands from the serial port of the

computer and the servos. The servos receive instructions from one of the PC’s USB ports

to manipulate direction. The autonomous decisions are made by the main intelligence

software on the PC.

Motion Detection

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 we'll call background. In this article, I'll try to describe

some of the most common approaches.

Algorithms

One of the most common approaches is to compare the current frame with the previous

one. It's useful in video compression when you need to estimate changes and to write only

the changes, not the whole frame. But it is not the best one for motion detection

applications. So, let me describe the idea more closely.

Page 4: Motion Detection Sceurity Camera

Assume that we have an original 24 bpp RGB image called current frame (image), a

grayscale copy of it (currentFrame) and previous video frame also gray scaled

(backgroundFrame). First of all, let's find the regions where these two frames are

differing a bit. For the purpose we can use Difference and Threshold filters.

Collapse | Copy Code

// create filters

Difference differenceFilter = new Difference( );

IFilter thresholdFilter = new Threshold( 15 );

// set backgroud frame as an overlay for difference filter

differenceFilter.OverlayImage = backgroundFrame;

// apply the filters

Bitmap tmp1 = differenceFilter.Apply( currentFrame );

Bitmap tmp2 = thresholdFilter.Apply( tmp1 );

On this step we'll get an image with white pixels on the place where the current frame is

different from the previous frame on the specified threshold value. It's already possible to

count the pixels, and if the amount of it will be greater than a predefined alarm level we

can signal about a motion event.

But most cameras produce a noisy image, so we'll get motion in such places, where there

is no motion at all. To remove random noisy pixels, we can use an Erosion filter, for

example. So, we'll get now mostly only the regions where the actual motion was.

Collapse | Copy Code

// create filter

IFilter erosionFilter = new Erosion( );

// apply the filter

Bitmap tmp3 = erosionFilter.Apply( tmp2 );

Page 5: Motion Detection Sceurity Camera

The simplest motion detector is ready! We can highlight the motion regions if needed.

Collapse | Copy Code

// extract red channel from the original image

IFilter extrachChannel = new ExtractChannel( RGB.R );

Bitmap redChannel = extrachChannel.Apply( image );

// merge red channel with motion regions

Merge mergeFilter = new Merge( );

mergeFilter.OverlayImage = tmp3;

Bitmap tmp4 = mergeFilter.Apply( redChannel );

// replace red channel in the original image

ReplaceChannel replaceChannel = new ReplaceChannel( RGB.R );

replaceChannel.ChannelImage = tmp4;

Bitmap tmp5 = replaceChannel.Apply( image );

Here is the result of it:

Page 6: Motion Detection Sceurity Camera

From the above picture we can see the disadvantages of the approach. If the object is

moving smoothly we'll receive small changes from frame to frame. So, it's impossible to

get the whole moving object. Things become worse, when the object is moving so slowly,

when the algorithms will not give any result at all.

There is another approach. It's possible to compare the current frame not with the

previous one but with the first frame in the video sequence. So, if there were no objects in

the initial frame, comparison of the current frame with the first one will give us the whole

moving object independently of its motion speed. But, the approach has a big

disadvantage - what will happen, if there was, for example, a car on the first frame, but

then it is gone? Yes, we'll always have motion detected on the place, where the car was.

Of course, we can renew the initial frame sometimes, but still it will not give us good

results in the cases where we can not guarantee that the first frame will contain only static

background. But, there can be an inverse situation. If I'll put a picture on the wall in the

room? I'll get motion detected until the initial frame will be renewed.

The most efficient algorithms are based on building the so called background of the scene

and comparing each current frame with the background. There are many approaches to

build the scene, but most of them are too complex. I'll describe here my approach for

building the background. It's rather simple and can be realized very quickly.

Page 7: Motion Detection Sceurity Camera

As in the previous case, let's assume that we have an original 24 bpp RGB image called

current frame (image), a grayscale copy of it (currentFrame) and a background frame also

gray scaled (backgroundFrame). At the beginning, we get the first frame of the video

sequence as the background frame. And then we'll always compare the current frame with

the background one. But it will give us the result I've described above, which we

obviously don't want very much. Our approach is to "move" the background frame to the

current frame on the specified amount (I've used 1 level per frame). We move the

background frame slightly in the direction of the current frame - we are changing colors

of pixels in the background frame by one level per frame.

Motion Alarm

It is pretty easy to add motion alarm feature to all these motion detection algorithms. Each

algorithm calculates a binary image containing difference between current frame and the

background one. So, the only we need is to just calculate the amount of white pixels on

this difference image.

Another possible way to detect moving objects is by investigating the optical flow which

is an approximation of two dimensional flow field from the image intensities, is computed

by extracting a dense velocity field from an image sequence. The optical flow field in the

image is calculated on basis of the two assumptions that the intensity of any object point

is constant over time and that nearby points in the image plane move in a similar way.

Additionally, the easiest method of finding image displacements with optical flow is the

feature-based optical flow approach that finds features (for example, image edges,

corners, and other structures well localized in two dimensions) and tracks these as they

move from frame to frame.

Furthermore, feature based optical flow method involves two stages. Firstly, the features

are found in two or more consecutive images. The act of feature extraction, if done well,

will both reduce the amount of information to be processed (and so reduce the workload),

and also go some way towards obtaining a higher level of understanding of the scene, by

its very nature of eliminating the unimportant parts. Secondly, these features are matched

between the frames. In the simplest and commonest case, two frames are used and two

sets of features are matched to give a single set of motion vectors.

Page 8: Motion Detection Sceurity Camera

Additionally, finding optic flow using edges has the advantage (over using two

dimensional features) that edge detection theory is well advanced. It has the advantage

over approaches which attempt to find flow everywhere in the image. The features are

found according to the below algorithm:

Feature selection algorithm :

1. Compute the spatial gradient matrix and its minimum eigenvalue at every pixel in the

image I.

2. Call the maximum value of eigen values over the whole image.

3. Retain the image pixels that have a eigen value larger than a percentage of maximum

eigen values. This percentage can be 10% or 5%.

4. From those pixels, retain the local max. pixels (a pixel is kept if its eigen value is

larger than that of any other pixel in its 3 x3 neighborhood).

5. Keep the subset of those pixels so that the minimum distance between any pair of

pixels is larger than a given threshold distance (e.g. 10 or 5 pixels).[4]

1. Computation of Optical Flow :

The idea of optical flow is to calculate some function, velocity vector v = (u,v), for each pixel in an image. The function v (u,v) describes how quickly each particular pixel is moving across the image stream along with the direction in which the pixel is moving.Consider an image stream described in terms of intensity as I(x,y,t). The intensity’s position change over time is:

Page 9: Motion Detection Sceurity Camera

2. Extra Object Detection

Every year, thousands of people lost in the home thefts. There are a lot of reasons

for these thefts like less security theft detection system based on video processing. When

thief is detected, alarm sound begin to play with high volume. By this alarm sound, if

there is a person in the next rooms, he or she can catch target person.

We designed our fire detection system based on Flame Recognition in Video

method . In this method, color and motion information are computed from video

sequences to detect fire. According to RGB color information of pixels, fire colored pixel

are detected. Fire colored pixels are possible fire pixels. To ensure about fire, temporal

variations of fire colored pixels are calculated. If temporal variation is above some level,

fire is detected.

Our fire detection system contains three main parts:

1- Finding fire colored pixels (possible fire pixels)

2- Controlling temporal variations of fire colored pixels

3- According to temporal variations, detection of fire

Page 10: Motion Detection Sceurity Camera

System Design Features

The system should be able to provide means for efficient and less time

consuming.

The system should be more user friendly editing software.

It should provide the necessary help pages for user reference.

It should also provide the facility of storing the necessary settings of the software.

Support basic formatting commands such as Bold, Italic, Underline, Strikeout,

Font Name, Font Size, Font Color, Justification (Left, Right, and Center),

Bullets and Number Lists.

Dialogs should be presented to the user for modifying Font and Color

attributes.

Provide for standard Cut, Copy, Paste, Undo, Redo, Select All, and

commands.

Allow for the inserting and removing indentation.

Allow the inclusion of images along with alternative text and text alignment

options.

Allow for the insertion of web links (Anchor tags), including the definition of

the target frame.

Allow for the insertion of a horizontal line for text separation.

Provide a Find and Replace mechanisms. This dialog should highlight the

appropriate text upon a find, and support a Replace All operation.

Page 11: Motion Detection Sceurity Camera

User Interface:

The user interface design deals with the identification of the user and how the user

interacts with the new computer system. The system is designed with highly user friendly

interface.

Software Interface:

.Net

Before getting deeply into the subject we will first know how Businesses are

related to Internet, what .NET means to them and what exactly .NET is built upon. As per

the product documentation from a Business perspective, there are three phases of the

Internet. The First phase gets back to the early 1990's when Internet first came into

general use and which brought a big revolution for Businesses. In the First phase of the

Internet Businesses designed and launched their Website's and focused on the number of

hits to know how many customers were visiting their site and interested in their products,

etc. The Second phase is what we are in right now and in this phase Businesses are

generating revenue through Online Transactions. We are now moving into the Third

phase of the Internet where profit is the main priority. The focus here is to Businesses

effectively communicate with their customers and partners who are geographically

isolated, participate in Digital Economy and deliver a wide range of services. How can

that be possible? The answer, with .NET.

What is .NET ?

way of controlling the Internet, which is false. .NET is Microsoft's strategy of

software that provides services to people any time, any place, on any device. An accurate

definition of .NET is, it's an XML Web Services  platform which allows us to build

rich .NET applications, which allows users to interact with the Internet using wide range

of smart devices (tablet devices, pocket PC's, web phones etc), which allows to build and

integrate Web Services and which comes with many rich set of tools like Visual Studio to

fully develop and build those applications.

Page 12: Motion Detection Sceurity Camera

.NET Framework AdvanTags

The .NET Framework offers a number of advanTags to developers. The following

paragraphs describe them in detail.

Consistent Programming Model

Different programming languages have different approaches for doing a task. For

example, accessing data with a VB 6.0 application and a VC++ application is totally

different. When using different programming languages to do a task, a disparity exists

among the approach developers use to perform the task. The difference in techniques

comes from how different languages interact with the underlying system that applications

rely on.

With .NET, for example, accessing data with a VB .NET and a C# .NET looks

very similar apart from slight syntactical differences. Both the programs need to import

the System.Data namespace, both the programs establish a connection with the database

and both the programs run a query and display the data on a data grid. The VB 6.0 and

VC++ example mentioned in the first paragraph explains that there is more than one way

to do a particular task within the same language. The .NET example explains that there's a

unified means of accomplishing the same task by using the .NET Class Library, a key

component of the .NET Framework.

The functionality that the .NET Class Library provides is available to all .NET

languages resulting in a consistent object model regardless of the programming language

the developer uses.

Visual Basic .NET

Visual Basic .NET provides the easiest, most productive language and tool for

rapidly building Windows and Web applications. Visual Basic .NET comes with

enhanced visual designers, increased application performance, and a powerful integrated

development environment (IDE). It also supports creation of applications for wireless,

Internet-enabled hand-held devices.

Page 13: Motion Detection Sceurity Camera

Powerful Windows-based Applications

Visual Basic .NET comes with features such as a powerful new forms designer, an

in-place menu editor, and automatic control anchoring and docking. Visual Basic .NET

delivers new productivity features for building more robust applications easily and

quickly. With an improved integrated development environment (IDE) and a significantly

reduced startup time, Visual Basic .NET offers fast, automatic formatting of code as you

type, improved IntelliSense, an enhanced object browser and XML designer, and much

more.

Building Web-based Applications

With Visual Basic .NET we can create Web applications using the shared Web

Forms Designer and the familiar "drag and drop" feature. You can double-click and write

code to respond to events. This project done by Visual Basic .NET 2005 comes with an

enhanced Web Page Tag Generator for working with complex Web pages. We can also

use IntelliSense technology and tag completion, or choose the Web Page Tag Generator

for visual authoring of interactive Web applications.

Simplified Deployment

With Visual Basic .NET we can build applications more rapidly and deploy and

maintain them with efficiency. Visual Basic .NET 2005 and .NET Framework 2.0 makes

"DLL Hell" a thing of the past. Side-by-side versioning enables multiple versions of the

same component to live safely on the same machine so that applications can use a specific

version of a component. XCOPY-deployment and Web auto-download of Windows-

based applications combine the simplicity of Web page deployment and maintenance

with the power of rich, responsive Windows-based applications.

Improved Coding

You can code faster and more effectively. A multitude of enhancements to the code

editor, including enhanced IntelliSense, smart listing of code for greater readability and a

background compiler for real-time notification of syntax errors transforms into a rapid

application development (RAD) coding machine.

Direct Access to the Platform

Visual Basic developers can have full access to the capabilities available in .NET

Framework 2.0. Developers can easily program system services including the event log,

Page 14: Motion Detection Sceurity Camera

performance counters and file system. The new Windows Service project template

enables to build real Microsoft Windows NT Services. Programming against Windows

Services and creating new Windows Services is not available in Visual Basic .NET

Standard, it requires Visual Studio 2005 Professional, or higher.

Full Object-Oriented Constructs

You can create reusable, enterprise-class code using full object-oriented

constructs. Language features include full implementation inheritance, encapsulation, and

polymorphism. Structured exception handling provides a global error handler and

eliminates spaghetti code.

OOP with VB

OOP Basics

Visual Basic was Object-Based, Visual Basic .NET is Object-Oriented, which

means that it's a true Object-Oriented Programming Language. Visual Basic .NET

supports all the key OOP features like Polymorphism, Inheritance, Abstraction and

Encapsulation. It's worth having a brief overview of OOP before starting OOP with VB.

Why Object Oriented approach?

A major factor in the invention of Object-Oriented approach is to remove some of the

flaws encountered with the procedural approach. In OOP, data is treated as a critical

element and does not allow it to flow freely. It bounds data closely to the functions that

operate on it and protects it from accidental modification from outside functions. OOP

allows decomposition of a problem into a number of entities called objects and then

builds data and functions around these objects. A major advanTag of OOP is code

reusability.

Some important features of Object Oriented programming are as follows:

Emphasis on data rather than procedure

Programs are divided into Objects

Data is hidden and cannot be accessed by external functions

Objects can communicate with each other through functions

Page 15: Motion Detection Sceurity Camera

New data and functions can be easily added whenever necessary

Follows bottom-up approach

Concepts of OOP:

Objects

Classes

Data Abstraction and Encapsulation

Inheritance

Polymorphism

VB Language

Visual Basic, the name makes me feel that it is something special. In the History

of Computing world no other product sold more copies than Visual Basic did. Such is the

importance of that language which clearly states how widely it is used for developing

applications. Visual Basic is very popular for it's friendly working (graphical)

environment. Visual Basic. NET is an extension of Visual Basic programming language

with many new features in it. The changes from VB to VB .NET are huge, ranging from

the change in syntax of the language to the types of projects we can create now and the

way we design applications. Visual Basic .NET was designed to take advanTag of

the .NET Framework base classes and runtime environment. It comes with power packed

features that simplify application development.

Briefly on some changes:

The biggest change from VB to VB .NET is, VB .NET is Object-Oriented

now. VB .NET now supports all the key OOP features like Inheritance, Polymorphism,

Abstraction and Encapsulation. We can now create  classes and objects, derive classes

from other classes and so on. The major advanTag of OOP is code reusability

The Command Button now is Button and the TextBox is TextBox instead of Text as in

VB6

Many new controls have been added to the toolbar to make application development

more efficient

VB .NET now adds Console Applications to it apart from Windows and Web

Applications. Console applications are console oriented applications that run in the DOS

version

All the built-in VB functionality now is encapsulated in a Namespace (collection of

Page 16: Motion Detection Sceurity Camera

different classes) called System

New keywords are added and old one's are either removed or renamed

VB .NET is strongly typed which means that we need to declare all the variables by

default before using them

VB .NET now supports structured exception handling using Try...Catch...Finally syntax

The syntax for procedures is changed. Get and Let are replaced by Get and Set

Event handling procedures are now passed only two parameters

The way we handle data with databases is changed as well. VB .NET now uses

ADO .NET, a new data handling model to communicate with databases on local

machines or on a network and also it makes handling of data on the Internet easy. All the

data in ADO .NET is represented in XML format and is exchanged in the same format.

Representing data in XML format allows us for sending large amounts of data on the

Internet and it also reduces network traffic when communicating with the database

VB .NET now supports Multithreading. A threaded application allows to do number of

different things at once, running different execution threads allowing to use system

resources

Web Development is now an integral part of VB .NET making Web Forms and Web

Services two major types of applications

Windows Forms

In Visual Basic

Its these Forms with which we work. They are the base on which we build,

develop all our user interface and they come with a rich set of classes. Forms allow us to

work visually with controls and other items from the toolbox. In VB .NET forms are

based on the System.Windows.Forms namespace and the form class is

System.Windows.Forms.Form. The form class is based on the Control class which allows

it to share many properties and methods with other controls.

When we open a new project in Visual Basic the dialogue box that appears first is the one

which looks like the image below. Since we are working with Windows Applications

(Forms) you need to select WindowsApplication and click OK.

Page 17: Motion Detection Sceurity Camera

Controls

A control is an object that can be drawn on to the Form to enable or enhance user

interaction with the application. Examples of these controls, TextBoxes, Buttons, Labels,

Radio Buttons, etc. All these Windows Controls are based on the Control class, the base

class for all controls. Visual Basic allows us to work with controls in two ways: at design

time and at runtime. Working with controls at design time means, controls are visible to

us and we can work with them by dragging and dropping them from the Toolbox and

setting their properties in the properties window. Working at runtime means, controls are

not visible while designing, are created and assigned properties in code and are visible

only when the application is executed. There are many new controls added in Visual

Basic .NET and we will be working with some of the most popular controls in this

section. You can select the controls from the menu towards the left-hand side of this page.

2.2 PRODUCT FUNCTION:

Provide an integrated toolbar to perform the standard text editing functions, and

other essential functions (as listed in the above points). Allow for the Insert mode

(overwrite), word wrapping options to be toggled, and the visibility of scroll bars to be

defined. Allow the use of context menus that include all the required text formatting

commands. The context menu should be sensitive to the user’s selection. Allow for the

insert, removal, and property definition of tables.

Have the ability to simply set the text of the document body, the inner text of an

Html Document; a browsable designer property. Allow for the assignment of the

complete Body element (Body outer Html), preserving and body properties. Also allow

for the assignment of the Body contents, Body inner Html. Support the inclusion of

Headings and Formatted blocks of text. This operation should be able to be performed in

reverse; set to Normal style.

Body Properties

Have the ability to define the default body background and foreground colors.

Allow for the ability of the Html content to be viewed or edited directly. Allow for the

pasting of Text and Html Markup. Allow a reference to a stylesheet to be applied to the

Page 18: Motion Detection Sceurity Camera

document at runtime. The purpose is to allow the definition of a corporate wide stylesheet

that all documents should reference for standardizing fonts, colors, etc. Allow a reference

to a script source file to be applied to the document at runtime.

The purpose is to allow the use of a corporate script file that can be used for handling

links requiring programmatic redirection.

Allow for the ability to ensure all links are forwarded to a new browser window;

and not rendered within the window containing the original link. Allow a document to be

loaded by a given URL. The Web Page Tag Generator is not designed to provide similar

functionality to Web Page Tag Generator Products; such as Microsoft FrontPage. For

complex layout requiring Styles, Absolute Positing, Frames, Multi-Media, etc, these

products should be utilized.

External Behavior

Operations that the control The toolbar is non interactive in that it does not toggle

Bold, Underline, and Italic state based on the user selection. Support is only included for

a single Font selection and not Font Families. Multiple Selections of items is not

supported and all operations are based on a single selected control. Simple Font properties

are used rather than style attributes. The inclusion of style attributes brings around

complexity regarding the use of Span tags.

There was the option to have the control be Tab driven; supporting Design, Edit

Html, and Preview. This would then have made the control look more like a fully-

functional Web Page Tag Generator rather than a replacement to the Rich Text Box.

2.2.1 Economical Feasibility:

This is the most important aspect that has to be critically evaluated. This includes

the feasibility study of cost-benefit analysis. This is an assessment of the economic

justification for a computer based system project.

The installation of this software is also easier where the user itself without

spending costs for installation may easily install.

The management accepted economical feasibility report specifying cost versus

benefit and the proposed system if installed, would be a good investment for it. The

Page 19: Motion Detection Sceurity Camera

sources in terms of the hardware, software and skilled staff are readily available incurring

no extra cost. Hence the project is economically feasible.

Recommended Implementation:

The proposed system performs the factors mentioned above which makes the

proposed system a feasible one. Since the proposed system may be acceptable by the

management because of the above factors mentioned, it is recommended for

implementation.

After careful study and analysis of the system the following facts are found. The

major functionalities are identified in the system and categorized into subsystems. Each

operation in the subsystem is treated as a separate module that differs from others but

interact with each other.

Page 20: Motion Detection Sceurity Camera

Security Camera

Main Module

One of the most common approaches is to compare the current frame with the

previous one. It's useful in video compression when you need to estimate changes and to

write only the changes, not the whole frame. But it is not the best one for motion detection

applications. So, let me describe the idea more closely.

Assume that we have an original 24 bpp RGB image called current frame (image),

a grayscale copy of it (currentFrame) and previous video frame also gray scaled

(backgroundFrame). First of all, let's find the regions where these two frames are

differing a bit. For the purpose we can use Difference and Threshold filters.

Compare one frame to next frame of the capturing video from camera the result

will be same the alaram mode is off, then the comparing the concurrent video stream will

be more different the alaram is on, the COM dialing is activated.

Sub Module : Capture Mode

Create Api function, call the create capture mode.

Page 21: Motion Detection Sceurity Camera

SYSTEM ANALYSIS

Existing System:

Security camera, are non-functional surveillance cameras designed to fool intruders, or

anyone who it is supposedly watching. Those cameras are intentionally placed in a

noticeable place, so passing people notice them and believe the area to be monitored by

CCTV. All time the camera watch and recorded it. The recorded data volume is too high.

Limitations

It may accidentally low features.

Proposed System

A motion detector is a device for motion detection. That is, it is a device that

contains a physical mechanism that quantifies motion that can be either integrated with or

connected to other devices that alert the user of the presence of a moving object within

the field of view. They form a vital component of comprehensive security systems, for

both homes and businesses.

Its easily detect behind object and camera, the application inform to the users in

three way

1. Capture the image

2. Alarm

3. Phoned by COM port

Page 22: Motion Detection Sceurity Camera

4. SYSTEM DESIGN

Design Concepts:

Security Camera is designed based on the fundamental design concepts such as

modularity and cohesion. As per the design concepts which are given by the software

engineering principles.

i) System Design:

System design is the development of a computer system solution to a problem that

has the same components and interrelationship among the components as the original

problem.

Schedules design activities

Works with the user to determine the various data inputs to the system

Plans how the policies will be checked through the system

Design required outputs

Problem specification

ii)Input Design:

Input design is the process of converting user-originated input to a computer -

based format. Inaccurate input data are the most common cause of error in data

processing. Errors entered by the data entry operators can be controlled by input design.

The goal of input design is to provide an easy, logical and error free approach for the end-

users.

A well - designed format can simplify the task of working through the options. It

can reduce the effort of the person who is browsing through the orders as well€ as to

minimize the process.

iii)Output Design:

In any system, results of processing are communicated to the users and to other

systems through outputs. In output design, it is determined how the information is to be

displayed for both immediate needs as well as for the complete sequence of operations

done by the user.

Page 23: Motion Detection Sceurity Camera

Iv)Code Design:

Coding is defined as a natural consequence of design. Coding in this system is

more structured. The system uses as many functions for each piece of work. Each work is

modularized, so it leads to code reusability. The programming language characteristics

and coding style can affect software quality and maintainability. The initial translation

step from detail design to programming language compilers or restriction can lead to

complete source code that is difficult to test and maintain.

Once the source code has been generated the function of a module should be

apparent without reference to a design specification. The code must be understandable

stresses simplicity and clarity.

The speed of the software is very fast. The developed software is work on

Windows based platform. There is no delay in any of the modules Application is working

with the maximum speed.

4.2 Modularity:

The concept of modularity is that the software is didvided into sperately named

and addressable components called modules.The modules are integrated to satisfy the

problem requirements.The decomposing will reduce the complexity of the problem.

Modular systems consist of well-defined, manageable units with well-defined interfaces

among the units. Desirable properties of a modular system includes:

Each processing abstract is a well-defined subsystem that is potentially useful

in other applications.

Each function in each abstraction has a single, well-defined purpose.

Modularity enhances design clarity, which in turn eases implementation,

debugging, testing, documenting and maintenance of the software product.

The modules are easy to understand and hence it will be easy to build and change.

The criteria of modular decomposability, composability, understandability, continuity and

protection must be considered for an effective modular design.

4.3 Cohesion:

Cohesion is the measure of relative functional strength of a module. A cohesive

module performs a single task with less interaction with the other parts of the program. In

a software design high cohesion must be achieved.

Page 24: Motion Detection Sceurity Camera

High cohesion is that, the functions and objects within a module should be related

to each other. Low levels of cohesion should be avoided when modules are designed.

The system has the following modules to take care of carious functions involved

in my project.

a) Activate the web camera

b) Enable Security

c) Disable security

d) Option of alarm, capture and COM port communication

Page 25: Motion Detection Sceurity Camera

SYSTEM REQUIREMENTS

Hardware Requirements:

Processor : Pentium 4

RAM : 512 MB

Hard disk : 20 GB

Monitor : 15” VGA

Software Requirements:

Operating System : Windows Xp (SP2)

Language : Visual Basic.Net

Page 26: Motion Detection Sceurity Camera

Software Description:

Visual Basic, the name makes me feel that it is something special. In the

History of Computing world no other product sold more copies than Visual Basic did.

Such is the importance of that language which clearly states how widely it is used for

developing applications. Visual Basic is very popular for it's friendly working (graphical)

environment. Visual Basic. NET is an extension of Visual Basic programming language

with many new features in it. The changes from VB to VB .NET are huge, ranging from

the change in syntax of the language to the types of projects we can create now and the

way we design applications. Visual Basic .NET was designed to take advanTag of

the .NET Framework base classes and runtime environment. It comes with power packed

features that simplify application development.

Page 27: Motion Detection Sceurity Camera

SYSTEM TESTING & IMPLEMENTATION

Testing Phase

It is a program statement that violates one or more rules of the language in which

it is written. These errors are shown during testing through error messages generated by

the computer.

Program Testing:

Program testing checks for syntax errors and logic errors. A syntax error is a

program statement that violates one or more rules of the language in which it is written.

These errors are shown during testing through error message generated by the computer.

Logic error deals with incorrect data fields, out of range items and individual

combinations. When a program is tested, the actual output is compared with the expected

output.

Unit Testing:

Unit testing comprises the set of tests performed by an individual programmer

prior to integration of the unit into larger system. So all the functional, performance,

stress and structure tests are performed with the software.

Validation Testing:

Validation is concerned with evaluating a software product at the end of the

software development process to determine compliance with the product requirements.

The primary goal of verification and validation is to improve the quality of the product.

The system satisfies all the goals specified. A test that verifies for the user that the system

procedures operate to system specification and the integrity of vital data is maintained.

Page 28: Motion Detection Sceurity Camera

Integration Testing:

All the modules and components are integrated together and tests their

functionality. All the modules are communicated with each other through well - defined

interfaces.

System Security:

System security is the must for every system. Both the modules will be protected.

Implementation:

Implementation is the process of having the users check out of the software is

working fine without any errors. The logical and behavioral performance of the system is

satisfactory after implementation. The system is successfully tested with the test data

during implementation.

Page 29: Motion Detection Sceurity Camera

Conclusion