Beruflich Dokumente
Kultur Dokumente
List of figures i
Abstract ii
1 Introduction 1
1.1 Introduction 1
1.3 Motivation 2
1.5 Applications 3
1.6 Advantages 3
1.7 Disadvantages 3
1.10 Conclusion 5
2.1 Introduction 6
3.1 Introduction 12
3.3.3. Files 15
3.3.3.1 M-Filles 15
3.3.3.2 MAT-Files 15
3.3.4 MIX-Files 16
3.4.1 Imread 16
3.4.2 Imshow 16
3.4.3 Load 17
3.4.4 Size 17
3.4.5 Figure 17
3.6 Conclusion 23
4.1 Introduction 24
4.2 Output-step1 25
4.4 Output-step3 27
4.5 Conclusion 28
References 31
LIST OF FIGURES
Introduction
1.1 Introduction:
In the recent years there has been a tremendous development in the field of
wireless technology and its applications. The wireless technology has been effectively
used for various purposes in one’s daily life. These applications take on many tasks,
from a simple remote control to a million dollar space mission, all striking for one
common purpose that is to bring exceptional services, extended control and easy
operation.
If wireless technology is one of the major fields of interest in the business world,
the other which is yet to make an impression is the robotics. The field of robotics is still
new and the extent to which these two fields can take us is unimaginable as yet.
In today’s world advertising is a major investment for all the companies in order to
sell their products. One can use television, the radio, newspaper, magazines etc., and the
possibilities for advertising are infinite. Along with these there is a lot of recurring
expenditure for the cause. It is also not affordable to all firms to spent huge amounts on
the advertising. In this situation our project can work as a solution to some extent as it is
affordable, attractive, exciting and easy to use.
The project proposes a cost effective, autonomous advertising robotic system with
an image processing system. The project is designed and detailed in such a way that the
autonomous robot is confined to a small area of activity such as malls, parks, offices;
movie theatres etc., the advancements of the project are lot more exciting, the robots can
be design for surveillance as well.
The front end of the robot has the displaying devices such as a LCD monitor or a
projector and a image sensor. It also has audio input and output devices to interact with
people around. The backend of the robot deals with the GSM receiver, the AT Keyboard,
and the control system.
1.2 Aim of the project
The main aim this project is to reduce power consumption by implementing
various image processing techniques to detect human. To achieve this aim, the following
objectives are carried out
1. Various image processing functions are studied.
2. Image acquisition device that is, a web camera is used to acquire the image.
3. Image acquisition tool box is used to compare the captured image with the predefined
specifications of the human skin in RGB form.
4. Graphical User Interface is used to display the video which is nothing but the output
of our project.
1.3 Motivation of the project
These days, there is a huge advancement in the media in this communicating
world. Everywhere we find LCDs and Televisions displaying the messages and playing
advertisements throughout the day. Due to this a lot of power is being consumed even in
the absence of a viewer. Our project ADROBO overcomes this problem by detecting a
human being in the vicinity of the LCD by using camera which captures the face of the
human being and only then plays the advertisement. Saving the power is the major
motivation and also doing this project using MATLAB software made us interested.
1.4 Literature survey
1. Bouman .C and Liu .B. ‘Multiple Resolution Segmentation of Textured
Images’. IEEE Trans. Pattern Anal. Machine Intel, vol .13, no. 2, pp. 99-233,
1991.
2. Chanda .B ‘On Preprocessing techniques for Image Analysis’ ,Ph.D. thesis
University of Kolkata, 1988.
3. Chanda B, Chaudhuri .B.B and Dutta Majumber .D ‘On Image Enhancement
and threshold selection using gray level co-occurrence matrix ’ Pattern
Recognition Letter 3:243-251,1985.
4. Chaudhuri .B.B ‘A note on Fast Algorithm for Spatial Domain Techniques in
Image Processing ’. IEEE Trans. Syst. Man Cyb, vol. SMC-13, no. 6, pp. 1166-
1169, 1983.
5. Fu K.S and Muj .J.K ‘ A survey on Image Segmentation ’ Pattern
Recognition,13:3-16,1981.
6. ‘An introduction to MATLAB 6 for Scientists and Engineers ’ Champman.
7. ‘Getting Started with MATLAB 6 ’ A Quick Introduction for Scientists and
Engineers, Rudra Pratap.
1.5 Applications
1. In Banks, information such as job offers, loans and new schemes can be
displayed.
2. In Multiplexes, this project can be useful to display information about movies and
names of the
3. The timings and the information related to the destination can be displayed in bus
Stations and in airports, the information regarding the arrival and departure can be
displayed.
4. In schools and colleges, our project can replace the notice board.
5. In Industrial applications, such as displaying the offers and the brands which it
manufactures and about the new products.
6. Stock Exchanges.
7. Public Relation Offices
1.6 Advantages:
1. Reduced Power Consumption
2. Effective way of advertising
3. Audience attention is grabbed in a direct way
4. Reliability increases
5. Thermal Stability Increases
6. Life of the system increases
7. Robust
8. Performance increased
9. Maintenance cost is less
10.Cost effective Solution
1.7 Disadvantages:
1. Fails in crowdie environment
2. Human detection algorithm is little sensitive to lighting
3. Speed of operation is less
1.10 Conclusion:
We hereby conclude that in chapter1 we have discussed about the introduction,
aim of the project, the motivation and the literature survey. We also discussed about the
applications, advantages and disadvantages, technical approach and organization of our
project.
Chapter-2
Hardware Components and Description
2.1 Introduction
In this project we are having one camera and PC. In this the camera will capture
the video continuously from that specified area. The purpose of the PC is to display the
advertisement. And we have MATLAB Programming in the PC which will take one
image from that video and perform certain operations on that image. By this
programming we are going to detect the human face in the video.
PC will take one image from that video and will perform certain operations on that image
to detect the human face. When human face is detected it will display the advertisement
video in Graphical User Interface window.
In the program to detect the human face it has a code to detect the skin of the
human. When it crosses the threshold value then it displays the advertisement via
Graphical User Interface (GUI).
2.2 Components of the system:
1 . Image Acuisition Device (Web Camera)
2. Image Processing Unit (PC-MATLAB)
3.USB Connector.
PC
Image
Senor Playing
Web- USB cable Advertisement
camera
GUI
Fig 2.1 Block diagram of basic components of ADROBO
2.2.1 Image Acuisition Device (Web Camera)
A webcam is a video
capture device connected
to a computer or computer
network, often using a
USB port or, if connected
to a network, Ethernet or Wi-Fi.
The most popular use is for video telephony, permitting a computer to act as a
videophone or video conferencing station. This can be used in messenger programs such
as Windows Live Messenger, Skype and Yahoo messenger services. Other popular uses,
which include the recording of video files or even still-images, are accessible via
numerous software programs, applications and devices.
• Webcams are known for low manufacturing costs and flexibility,[1] making them
the lowest cost form of video telephony.
• The term 'webcam' may also be used in its original sense of a video camera
connected to the Web continuously for an indefinite time, rather than for a
particular session, generally supplying a view for anyone who visits its web page
over the Internet. Some of these, for example those used as online traffic cameras,
are expensive, rugged professional video cameras
USB
CMOS Sub- Device PC
image ISP Sample JPEG Control Host
sensor Raster Encoder ler
System Controller
ZC0201
Chapter-3
Software Description and Programming
3.1 Introduction:
MATLAB is a high performance language for technical computing.
It integrates computation, visualization and programming in an easy to use
environment where problems and solutions are expressed in familiar mathematical
notation. Typical uses include:
• Math and computation
• Algorithm development
• Modeling, simulation and prototyping
• Data analysis, exploration and visualization
• Scientific and engineering graphics
• Application development, including graphical user interface building
MATLAB is an interactive system whose basic data element is an array
that does not require dimensioning. This allows you to solve many technical
computing problems, especially those with matrix and vector formulations, in a
fraction of the time it would take to write a program in a scalar non interactive
language such as C or FORTRAN.
The name MATLAB stands for “Matrix laboratory”. MATLAB was
originally written to provide easy access to matrix software developed by the
LINKPACK and EISPACK projects. Today, MATLAB uses software developed
by the LAPACK and ARPACK projects, which together represent the state of the
art in software for matrix computation.
MATLAB features a family of applications specific solutions called
toolboxes. Very important to most users of MATLAB, toolboxes allow you to
learn and apply specialized technology. Toolboxes are comprehensive collections
of MATLAB functions (M-files) that extend the MATLAB environment to solve
particular classes of problems. Areas in which toolboxes are available include
signal processing, control system, neural networks, fuzzy logic, wavelets,
simulation and many others.
3.2 The MATLAB System
The MATLAB system consists of five main parts
3.2.1 Development environment:
This is the set of tools and facilities that help you use MATLAB function
and files. Many of these tools are graphical user interfaces. It includes the
MATLAB desktop and command window, a command history and browsers for
viewing help, the workspace, files and the search path.
3.2.2 The MATLAB Mathematical function library:
This is a vast collection of computational algorithms ranging from
elementary functions like sum, sine, cosine and complex arithmetic, to more
sophisticated functions like matrix inverse, matrix Eigen values, Bessel
functions and fast Fourier transforms.
3.2.3 The MATLAB language:
This is a high-level matrix or array language with flow statements,
functions, data structures, input/output and object oriented programming
features. It allows both “programming in the small” to rapidly create quick and
dirty throw-away programs and “programming in the large” to create complete
large and complex application programs.
3.2.4 Handle Graphics:
This is the MATLAB graphics system. It include high-level commands
for two-dimensional and three dimensional data visualization image processing,
animation and presentation graphics. It also includes low level commands that
allow you to fully customize the appearance of graphics as well as to build
complete graphical user interfaces on your MATLAB applications.
3.2.5 The MATLAB Application Program Interface (API):
This is a library that allows to write C and FORTRAN programs that
interact with MATLAB. It include facilities for calling routines from MATLAB
(dynamic linking), calling MATLAB as a computational engine and for reading
and writing MAT-files.
MATLAB consists of toolboxes, collection of specialized functions useful
in the applications such as symbolic computation, image processing, control
system design and neural networks.
3.3 Basic Building Blocks Of MATLAB
The basic building block of MATLAB is MATRIX. The fundamental data
type is the array. Vectors, scalars, real matrices and complex matrix are handled
as specific class of this basic data type. The built in functions are optimized for
vector operations. No dimension statements are required for vectors or arrays.
Some of the basic features and commands of the MATLAB are:
3.3.1 MATLAB Window
The MATLAB works through three basic windows.
1. Command window
2. Edit window
3. Graphics window
3.3.1.1Command Window
This is the window, which characterized by MATLAB command prompt “ >>
”. It is opened when the application program is launched. All commands
including user-written programs are typed in this window at MATLAB prompt for
execution
3.3.1.2 Graphics or Figure Window
The output of all graphic commands typed in the command window is seen in
this window.
3.3.1.3 Edit Window
In this window one can write, edit, create and save programs in files called M-
files. MATLAB provides it own built in editor.
3.3.2 On Line Help
MATLAB provides online help for all it’s built in functions and programming
language constructs.
The general commands are:
Help lists topics on which help is available
Help win opens the interactive help window
3.3.3 Files:
MATLAB has three types of files for storing information. They are
3.3.3.1 M-files
These are standard ASCII text file with ‘m’ extension to the file
name. You can create your matrices using M-files, which are text files
containing MATLAB code. Use the MATLAB editor or another text editor to
create a file containing the same statements you would type at the MATLAB
command line. Save the file under a name that ends in .m.
There are two types of M-files
I. Script files:
3.3.4 MIX-files
These are MATLAB callable FORTRAN and C programs with .mix
extension to the file name.
3.4 Commands Used In The Programs
3.4.1 Imread: Read image from graphics file.
A=IMREAD (FILENAME.FMT) reads in image in FILE NAME into
A. If the file contains a gray scale intensity image, A is a two-dimensional array.
If the file contains a true color (RGB) image, A is a three-dimensional (M-by-N-
by-3) array. FILENAME is a string that specifies name of the graphics file and
FMT is a string that specifies the format of the file. The file must be in the current
directory or in a directory on the MATLAB path. If IMREAD cannot find a file
named FILENAME, it looks for a file named FILE NAME.FMT.
The possible values for FMT include:
‘jpg’ or ‘jpeg’ Joint Photographic Experts Group (JPEG)
‘tif’or ‘tiff’ Tagged Image File Format (TIFF)
‘gif’ Graphics Interchange Format (GIF)
‘bum’ Window Bitmap (BMP)
‘png’ Portable Network Graphics
‘hdf’ Hierarchical Data Format (HDF)
‘pcx’ Windows Paintbrush (PCX)
‘xwd’ X Window Dump (XWD)
‘cur’ Windows Cursor Resource (CUR)
‘ico’ Windows Icon Resource (ICO)
FIGURE, by itself, creates a new figure window and returns its handle.
FIGURE (H) makes H the current figure, forces it to become visible and raises it
above all other figures on the screen. If FIGURE (H) does not exist and H is an
integer, a new figure is created with handle H.
3.4 Algorithm:
Step1: Align the system, align flag=1, it means web camrra is activated, it starts
capturing the images in front of it.
Step2: Prints the given string, ‘ Video Capturing Started’, on edit box.
Step3: The captured images are displayed on the axes3 with frame gap 1 count.
Step4: When ‘finish’ push button is pressed alignflag=0, it means alignment is
stopped.
Step5: Prints the given string, ‘Image alignment finished’, on edit box.
Step6: The video in axes3 is stopped. The last captured image is displayed on
axes3 and clears the video object.
Step7: Waits for the start push button to be pressed.
Step8: When start push button is pressed, assigns start flag=1.
Step9: Prints the given string, ‘loading…please wait’, on the edit box.
Step10: Video object is initialized.
Step11: Prints given string, ‘Live video started’, on the edit box.
Step12: Selects axes1 to display the image from ‘5.jpg’ file.
Step13: The last frame captured by the camera i.e, the image displayed on the
axes3 is copied to the video object initialized in Step10.
Step14: The video object which is in RGB form is passed to the face function
which will detect the skin tone and returns the same image in Black and White
form.
Step15: The image is now passed through the medium filter. It removes the black
dots in white area and white dots in black area.
Step16: The shapes of each white area are stored in an array.
Step17: The shape with maximum value in array is stored and the boundaries are
calculated.
t- 1st column 1st pixel value.
r- last column last pixel value.
b- 1st column last pixel value.
l- last column first pixel value.
Step18: The values t, r, b, l are passed to an array [l, t, r, b].
Step19: A rectangle is drawn around the boundaries of the selected shape.
Step20: Height and Width of the shape are calculated,
H= abs(t-b)
W=abs(r-l)
Step21: AR=H/W.
Step22: The pixel values inside the rectangle are summed up and the value is
assigned to k.
Step23: If (k>1000) and (AR>0.85) and (AR<1.5) then it prints given string,
‘Welcome’ on the edit box and the videos present in different files are displayed
one by one depending on the modes assigned to them. The start flag status is
checked at every mode.
Step24: If start flag=0, then it goes to Step27 else it continues displaying the video
present in the next mode.
Step25: After completion of the display of video in the last mode, it checks the
status of the start flag.
Step26: If startflag=1 then it goes to mode1 and starts playing the videos again
else go to step27.
Step27: Stop video object.
Step28: Clears video object.
Conclusion:
In chapter-3 we have discussed about the software description that is the MATLAB
system, the basic building blocks of MATLAB such as commands, windows, files and
the program code of the project including with comments
Chapter-4
Results and Discussions
4.1 Introduction:
In this chapter we will discuss the output which is displayed on the Graphical
Interface Unit in 3 steps after the execution of the software programming code discussed
in the chapter3.
The basic window of Graphical User Interface of our project with name adrobo_gui is
shown below:
It consists of three axes, one edit box and five push buttons. Their functions are discussed
below:
• The three axes out of which one is used to display the image which is acquired by
web camera. The second axes is used to display the processed image in black and
white format. Whereas the third axes is used to display the video which is the
result.
• The edit box is named ‘status’ as it indicates the status of the program.
• The five push buttons are Align Systems, Finish, Start, Stop and Reset.
4.2 Output-Step1:
When the push button named ‘Align System’ is clicked or pressed, the camera starts
capturing the images in its vicinity and displays the image on the first axes.
After pressing the ‘Finish’ push button, the image captured at that instant is taken as input
to the program and displays the same image on the first axes throughout the process of
execution.
In this step, the ‘status’ edit box displays the status of the process that is ‘video capturing
started’.
4.3 Output-Step2:
In this step, the push button ‘start’ is pressed. Now the actual processing of the
image starts. The image captured on the first axes is converted to black and white image
and displayed on the second axes. It then compares the selected pixels or portions of the
image with the predefined specifications of human skin written in the program code.
If the comparision is matched, then the following step takes place
In this step, the ‘status’ edit box displays the status that is ‘monitoring’.
4.4 Output-Step3:
In this step, the video that is the output is displayed. This is because the captured
image is matched with the specifications of the human skin written in the the program
code which is nothing but the aim of our project. Since the output is displayed, it
indicates that the aim of our project is achieved and the required result is obtained.
If in case the human is not detected that is if the specifications are not matched the video
will not be displayed.
The ‘status’ edit box displays ‘welcome’ which means it welcomes the viewer to watch
the video.
The ‘stop’ push button is pressed to stop or interrupt the process of execution at any step
or any time instant. The video being displayed can be stopped by pressing the ‘stop’ push
button.
The ‘reset’ button is pressed to stop the execution and to perform the whole execution
from the beginning.
4.5 Conclusion:
In chapter-4 we have discussed about the results and discussions, the output
which is displayed on the graphical user interface and its working in step-1, step-2 and
step-3.
Chapter 5
Conclusions and Future scope
Our project has helped us in understanding the importance of MATLAB and image
processing. To develop the required software program MATLAB is used, it is a high
performance language for technical computing. It integrates compution, visualization and
programming in an easy way to use environment, as this allows us to solve computing
problems, especially those with matrix and vector formulations in a fraction of time
where as in a scalar non interactive language such as C and FORTON it is complicated.
Image processing has many applications in various fields and various image
processing functions have been studied and used in our project. In this project we have
used image acquisition tool in automatic advertising machine, in which advertisement is
played automatically on the basis of human detection that is in the presence of human
beings. This is possible with the help of sensors. The sensors used in our project is image
acquisition device i.e the web camera is used to acquire an image and displays the
captured image on an axes of the Graphical user interface. Image acquisition tool box is
used to compare the captured image with the predefined specifications of the human skin
in the RGB form. If it is matched i.e the human skin is detected. Then GUI displays the
output i.e the video. The main advantage of our project is its less power consumption and
it can be applied in various fields using the principle of human detection like banking
advertisements, railway stations, multiplexes, bus stations, airports, schools and colleges,
industrial applications, stock exchanges and public relation offices etc. Here we
mentioned less power consumption because the video is displayed only in the presence of
the human otherwise it is not. The power can be saved as the LCD will be in the stand by
mode when it is not displaying. As there are limited natural resources like water, natural
gas and natural oils which will soon deplete in the near future. Thus, power should not be
wasted. Our project holds good in conserving electricity and is affordable, attractive,
exciting and easy to use.
In the recent years as there is tremendous development in the technology and its
applications. Wireless technology and robotics are the two fields where our project can be
extended and developed in the near future. The wireless technology is one of the major
fields being developed in the business world and robotics is a fast growing field but yet to
make an impression. On the basis of skin detection an information can be sent in the
presence of a person through wireless technology where the information sent will be
secured and the operation provides security. This project with advanced features can also
be used in defense and army. That is on the basis of skin detection it can identify a
human being entering into the borders but displaying this information or news can be
viewed on the mobiles or LCDs located far away where commandos stay so that they
take an action. Our project of advertising automatically in the presence of human being
but also can be implemented in various fields such as airports, railway stations, banks,
multiplexes and to display the stock exchanges. It can occupy every place of an LCD as it
is low in price, inexpensive and has a attractive and sophisticated look. However the main
advantage and the aim is to reduce the power consumption.
References:
1. William J. Palm, ‘Introduction to MATLAB 7 for Engineers’, 2nd edition.
2. William K. Pratt, John Wilely, ‘Digital Image Processing’, 3rd edition, 2007.
3. Rafel C. Gonzalez, Richard E. Woods and Steven L. Edition, ‘Digital Image
Processing using MATLAB’, PEA, 2004.
4. Chaudari.B.B, ‘A note on fast Algorithm for Spatical Domain Techniques in
Image Processing’, 1st edition, 1983.
5. Scott I. Mackenzie and Raphael Chung Wei Phan, ‘8051 Micro controller’, 4th
edition.
6. A.K. Jain, ‘Fundamentals of Digital Image Processing’, 4th edition, PHI.
7. Rudra Pratap, ‘Getting started with MATLAB 6’, 2nd edition, 2004.
Appendix
Progra
m Code: Comments
Function pushbutton4_callback(hobject,eventdata,handle) //called when system
alignment is pressed
global alignFlag // intialising a global variable alignflag
axes(handles.axes3); //selecting axes3 to show the video
vid = videoinput('winvideo'); //video object is intialised using adapter win video
pause(2); //provides a delay of 2 counts
set(vid,'TriggerRepeat',Inf); // calling trigger function infinite times
vid.FrameGrabInterval = 1; //taking frames from the camera with gap 1 count
alignFlag = 1; //assigns align flag to 1
start(vid); //starting video
set(handles.status,'String', 'Video Capturing Started'); //prints the given string on
edit box of gui
pause(1); //provides a delay of 1 count
while alignFlag == 1, //entering into loop
origIm = getdata(vid,1); //get the new gray scale image
imshow(origIm), //shows the image on axes3
end //end of while loop that is when align flag is 0
stop(vid); //stops the video
set(handles.status,'String', 'Image Alignement Finished'); //prints the given string on
edit box
delete(vid); //delete the video object
clear vid; //clears the video object
pause(1); //provides adelay of 1 count
global startflag, // global start flag to stop infinite loop present in this function
startflag=1; //start flag assigned to 1
set(handles.status,'String','loading...please wait....'); //it prints the given string on edit box
pause(0.1); //provides a delay of 0.1 count
vid=videoinput('winvideo'); //video object is intialised using adapter win video
set(handles.status,'String','live video starting..'); //it prints the given string on edit box
pause(0.3); //provides a delay of 0.3 counts
axes(handles.axes1); //select the axes 1to show the image
imshow('5.jpg'); // shows the image on the selected axes1
vid.FrameGrabInterval = 60; //taking frames from the camera with gap 60 counts
set(vid,'FramesPerTrigger',1); //to set taking frames when trigger called in 1 frame
set(vid,'TriggerRepeat',Inf); //calling trigger function infinite times
triggerconfig(vid, 'Manual'); //to allow the manual setting on video
mode = 1; //this mode variable is used to intimate which advertisement has to be played
start(vid); //starting the video
i = 1; // assigning local variable to 1
k= 1; //assigning local variable to 1
for j = 1:size(boundaries,1), //how many shapes present that many loops are executed
ary(j) = size(boundaries{j},1); //first loop j is 1 and boundaries(1) means first shape
is in ary(1)
end//end of for loop
if size(ary,1)~=0, //if there is no skin detected, there is no shape, means this condition
get false
[mbound ind] = max(ary); //in the array which shape has a maximum value is stored in
index and the value is stored in mbound
C = boundaries{ind}; //set boundaries to the shape
axes(handles.axes1);
imshow('5.jpg');