We
require two software's for the implementation of the project.
1. MATLAB : For
implementing vehicle License Plate tracking and reorganization.
2. KEIL : For
implementing the decision making using microcontroller 8051.
4.1
MATLAB
MATLAB is an abbreviation of Matrix Laboratory.
It is a popular Mathematical Programming Environment used extensively in
Education as well as in industry. The trick behind MATLAB is that everything is
represented in the form of arrays or matrices mathematical operations starting
from simple algebra to complex calculus may be conveniently carried out using
the environment. The main use of MATLAB can be converted into C, C++, or Visual
C++.
Although MATLAB is intended
primarily for numerical computing, an operational toolbox uses the MuPAD
symbolic engine, allowing access to symbolic computing capabilities.
We can use MATLAB in a wide range of
Application, including signal and image processing, communications, control
design, test and measurement, financial modeling and analysis, and
computational biology. For a million engineers and scientists in industry and
academia, MATLAB is the language of technical computing.
4.1.1 Image Processing
Image processing generally involves
extraction of useful information from an image. This useful information may be
the dimension of an engineering component, size of diagnosed tumor, or even a
3D view of an unborn baby. The main areas of application of image processing
are Bio-Medical, Engineering, Quality control, Face detection, Traffic control
etc.
4.1.2 MATLAB Language
MATLAB provides a high-level
language and development tools that let us quickly develop and analyze our
algorithms and applications. The MATLAB language supports the vector and matrix
operations that are the fundamental to engineering and scientific problems.
In many cases, MATLAB eliminates the
need for 'for' loops. As a result, one line of MATLAB code can often replace
several lines of C or C++ code. At the same time, MATLAB provides all the
features of a traditional programming, including arithmetic operators, flow
control, data structure, data types, object oriented programming (OOP), and
debugging features.
For general purpose scalar
computations, MATLAB generates machine-code instructions using its JIT
(Just-In-Time) compilation technology. This technology, which is available on
most platform, provides execution speeds that rival those of traditional
programming languages.
4.1.4 Designing
Graphical User Interfaces
We can use the interactive tool
GUIDE (Graphical User Interface Development Environment) to layout, design, and
edit user interfaces. GUIDE lets us include list boxes, pull-down menus, push
buttons, radio buttons, and sliders, as well as MATLAB plots and Microsoft
Active X controls. we can create GUIs programmatically using MATLAB functions.
4.1.5 MATLAB programming technique
for image processing
4.1.1.1 Recording of the processing
used
When
it is used to process images one generally writes function files, or script
files to perform the operation, these files form a formal record of the
processing used and ensures that the
final results can be tested and replicated by others should the need arises.
4.1.1.2 Access to implementation
details
MATLAB
provides many function for image processing and other tasks most of these functions
are written in the MATLAB language and are publically readable as plain text
files, thus the implementation details of these functions are accessible and
open to scrutiny.
4.1.1.3 Numerical accuracy
Another
advantage of MATLAB is that it allows one to ensure maximal numerical precision
in the final result.
4.1.1.4 Advanced algorithms
MATLAB
is a scientific programming language and provides strong mathematical and numerical
support for the implementation of advanced algorithms, it is for this reason
that MATLAB is widely used by the image processing and computer vision
community. new algorithm are very likely to be implemented first in MATLAB, indeed
they may only be available in MATLAB.
Key
Features
- High
level language for technical computing.
- Development
environment for managing code, files, and data.
- Interactive
tools for iterative exploration, design, and problem solving.
- 2D
and 3D graphics functions for visualizing data.
- Functions
for integrating MATLAB based algorithm with external applications and
languages, such as C, C++, Fortran, Java, COM, and Microsoft Excel.
4.1.6 Flow chart: MATLAB GUI
4.1.7 Explanation of flowchart:
MATLAB GUI
- Start
the MATLAB GUI.
- First
find the password for protection purpose.
- If
the password entered is valid then it displays your valid person else displays
you are not a valid person. so the access is denied.
- Detection
toggle button on the GUI is clicked to start the detection.
- Displaying
the toggle button to stop after the start button is pressed and in future these
same button is pressed to stop the detection.
- Video
from the camera is inputted into MATLAB using image acquisition tool in MATLAB
and dividing the same input image into 16 quadrants.
- Serial
port is initialized to COM port1 to communicate with the microcontroller.
- The
input video is previewed on the GUI.
- While
the toggle button in stop detection position the following action happens.
- The
input image color components are stored in different arrays.
- The
conditioning equation is used to obtain particular color i.e. segmentation
- is
done and converted it into binary image.
- The
noise in the image is removed by means of the same mathematical image processing
technique.
- Then
the mean value are calculated and compared with the co-ordinates values these
- values
are sent to the microcontroller through the serial port.
- Stop
the detection. toggle button is pressed to stop the detection.
- End
of the MATLAB GUI program.
4.2
Keil µVision
3
Software
The
use of C language to perform microcontroller is becoming too common. And most
of the time it is not easy to build an application in assembly which instead we
can make easily in C. So it is important that we know C language for
Microcontroller which is commonly known as Embedded C.
As
we use Keil C51 compiler, hence we also call it Keil C. The Keil development
tool offers numerous features and advantage that help us to develop embedded
applications quickly and successfully. They are easy to use and are guaranteed
to help us achieve our goals in timely manner.
4.2.1
8051 Development Tool Support
The
Keil C51 Compiler and the Keil Linker/Locator provide optimum 8051 architecture
support with the following features and C language extensions :
- Interrupt
functions with register bank support are written directly in C.
- Bit
and bit-addressable variables for optimal Boolean Data type support.
- Compiler
time stack with data overlaying uses direct memory access and gives high-speed
code with little overhead compared to assembly programming.
- Re-entrant
functions for usage by multiple interrupt or task threats.
- Absolute
Variable locating enables peripheral access and memory sharing.
- Code
and variable banking expend the physical memory address space.
4.2.2
Embedded system and C programming
- An embedded system is an application
that contain at least one programmable computer (typical in the form of a
microcontroller and microprocessor of digital signal processor chip).
- It
is easier and less time consuming to write in C than assembly.
- C
is easier to modify and update.
- We
can use code available in function libraries.
- C
code is portable to other Microcontroller with little or no modification.
- It
is very efficient.
- It
is popular and well used.
- Even
desktop developers who have used only Java and C++ can soon understand C
syntax.
- Good,
well-proven computers are available for every Embedded processor (8-bit to 32
bit or more)
- Experience
staff are available.
- Book,
training courses, code sample and internet sites discussing the use of the
language are very widely available.
4.2.3 Flow chart: Embedded C Program
Figure
4.1.3 : Flow chart of Embedded C Program
Figure 4.1.3 shows the
flow chart of embedded C program and it is described by following steps which
are listed below:-
- Start
the coding.
- Declaration
of all the variable and ports used in coding.
- Initialization
of the COM port for the serial communication and stepper motor to initial
position.
- Bring
the stepper motor to the middle position so that it can move in any corner of
the screen with the same display period.
- While
super loop is been used to run the code continuously until the power supply is
turned off.
- Before
checking the switches the particular quadrant value and update the current step
value of stepper motor.
- Checking
the current value with the new value before incrementing the count value of the
stepper motor.
- Updating
the current value of the stepper motor after the increment.
- Checking
for the wireless disable bit before switching on the LASER pointer.
- End
of the code.
4.2.4
Embedded OS Programming
- To
obtain periodic function execution and avoid wasting processor cycle we can use
interrupts.
4.2.4.1
Tasks, Functions and scheduling
- In
case of EOS, we are able to control the execution times of a single task.
- The
task will be implemented as an interrupt service routine: This ISR will be
invoked by the overflow of a timer.
4.2.4.2
Saving Power
- Problem
noted with many ‘super loop’ applications are that the processor wasted a large
no of CPU cycle in a delay loop.
- 8051
devices have an idle mode where power consumption may be reduced by a factor
10.
- Using
EOS, we can reduce the power consumption of the application by having the
processor enter idle mode when it finishes executing the ISR.
4.2.4.3
Portability
- ON-chip
timer which can be used to generate interrupts in this way is by no means
restricted to the 8051 family.
4.2.5 Flow chart:
Embedded OS Program
Figure
4.1.4 : Flow chart of Embedded OS Program
Figure 4.1.4 shows Explanation
of Embedded OS program which is described by following steps:-
- Start
the simple embedded OS code.
- Declaration
of all the variables and ports used in coding.
- Initialization
of the COM port for the serial communication and stepper motor to initial
position.
- Initialize
stepper motor to the auto reload register.
- Bring
the stepper motor to the middle position so that if it can move in any corner
of the screen same delay period.
- While
super loop is been used to run the code continuously until power is turned off.
- Running
the microcontroller in ideal come of power saving mode.
- The
code is internally connected to the timer2 interrupted function where
previously code is made in to function and placed in this interrupt function.
- This
function waked up when the function is interrupted from the ant of the used
ports.
- End of the coding.
4.2.6
Co-operation scheduler programming
- A
co-operation scheduler provides single-tasking system architecture.
4.2.6.1
Operation
- Tasks
are scheduled to run at specific times (either on a one-shot or regular basic).
- When
a task is scheduled to run it is added to the waiting list.
- When
the CPU is free, the next waiting task (if any) is executed.
- The
task runs to completion and returns control to the scheduler.
4.2.6.2
Implementation
- The
scheduler is simple and can be implemented in a small amount of code.
- The
scheduler must be allocated memory for only a single task at a time.
- The
scheduler will generally be written entirely in a high-level language (such as
‘c’).
- The
scheduler is not a separate application; it becomes part of the developer’s
code.
4.2.6.3
Performance
- Obtain
rapid response to external events requires care at the design stage.
4.2.6.4
Reliability and safety
- Co-operate scheduling
is simple, predictable, reliable and safe
4.2.7
Flow chart: Co-operative Scheduler
Figure
4.1.5 :Flow chart of Co-operative Scheduler
Figure 4.1.5 shows the
flow chart of Embedded scheduler program and can be explained by following
step:-
- Start
the scheduler code.
- Initialize
the timer2 to the auto reload register of the scheduler function.
- Declarations
of all the variables and port used in coding.
- Initialization
of the COM port for serial communication and stepper motor to the initial
position.
- Initialize
thetimer2 to auto reload register.
- Bring
the stepper motor to middle position so it can move any corner of the screen
with same delay.
- Scheduler
adds function to the required function to run where ever required and when the
function is interrupted.
- While
super loop is been used to run the code continuously until the power supply is
turned off.
- End
of the code.
4.3
Issues faced during the development of the hardware
- Mounting
of the stepper motor.
- Connecting
the stepper motor to the microcontroller.
- Camera
interfacing with the MATLAB.
- Embedded
coding and dumping the code in to the Microcontroller.
- Simple
embedded and scheduler programming and rigging the code.
- Color
detection and finding the quadrant value.
- Automatic
adjustment of the stepper motor to initial position.
- Adjusting
the distance between the white background and camera in synchronous to gun
pointer.
- Detecting
the person coming in while attire on white background.
- How
to control the gun action when our army needs to occupy the same area under
surveillance.
4.4
Methods used to resolve the issues
- In
this project stepper motor was placed on another stepper motor using a good
gum.
- In
this project for driving inductive load like relay we used ULN2003 and relay is
used
- for
the switching action of the stepper motor.
- In
this project an extensive search was made for finding the coding related to
image acquisition from camera.
- In
this project embedded coding related tutor was taken for the code dumping
technique.
- In
this project image acquired from the camera was noisy, it was removed by
software programming was done using advance topic like Mathematical Morphology.
- In
this project micro switch where used to set the stepper motor to the initial
position.
- In
this project transmitter and receiver were used to disable the gun action.
4.5
System Functional Requirements
4.5.1
Definition
Statement of service
the system should provide how the system should react to the particular
Situation.
4.5.2
Initialization
Once
you have tasted the working of embedded coding and MATLAB coding, you’ll
probable to put it to use by proper interfacing with the microcontroller and in
turn with the stepper motor. Now the camera will capture the area under
surveillance.
4.5.3
User Interface
The
user interface should be designed in secured
way with a lot of specific instruction and must fulfill the ergonomic
requirements the purpose achieved with the help of MATLAB GUI coding.
4.5.4 Identification
It
is done using the particular secured password handled higher authority
officers.
4.5.5
Response
The system should
response to each input and should transmit without any error.
4.6
Non-functional requirements
4.6.1
Definition
Constrain
on the services or function offered by the system such as timing constrains,
constrains on the development process, standard etc.
4.6.2
Reliability
All
the components and circuit elements are stable and can work under the
temperature of -40c.The transmitter can operate up to the range of 250fts.
4.6.3
Performance
Threats are detected
accurately and gun point towards the intruder and works accurately.
4.6.4
Robustness
The
serial data is transmitted in nano seconds to the microcontroller and switching
of the relays are very speed.
4.6.5 Maintainability
Skilled
persons are required for the alignment of camera and gun so the system is
secured.