Interfacing of MATLAB With Arduino For Face Recognition
Interfacing of MATLAB With Arduino For Face Recognition
Abstract
This paper explains proposed algorithm for face recognition using image processing and
manipulation of the output pin state of Arduino board with ATmega328P controller by tracking the
face of a human. The face recognition algorithm has been developed on MATLAB platform by the
combination of several image processing algorithms. Using the theory of Image Acquisition and
Fundamentals of Digital Image Processing, the face of a user has been detected in real time. By using
Face Recognition and Serial data communication, the state of Arduino board pin has been controlled.
MATLAB programming develops a computer vision system in the real time for face detection and
tracking using camera as image acquisition hardware. Arduino programming provides an interfacing
of a hardware prototype with control signals generated by real time face detection and tracking.
Keywords: MATLAB, Arduino board, ATmega328P, Digital Image processing, serial data
i i F R ii
© 2017, This is an Open Access article distributed under the terms of the Creative Commons Attribution License
(http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the
original work is properly credited.
Recent Advances in Technology and Engineering , Department of Computer Science and Engineering, T John Institute of Technology,
Bangalore, Published By: International Journal of Sciecne, Engineering and Technology, ISSN (O): 2348-4098 , ISSN (P): 2395-4752
Software Implementation
The entire algorithm for face recognition is a based
on image processing. The proposed system uses
MATLAB as a platform on which image processing
algorithm has been developed and tested. As an
image acquisition devise, camera is used. A camera
can be an inbuilt camera of laptop or it can be a USB
camera as well. To get the details of the hardware
device interfaced with the computer, imaqhwinfo
command of MATLAB is used. Entire MATLAB
program for this algorithm can be divided in parts as
follows.
A. Image Acquisition:
The first task in image processing algorithm is to get
the live video feed from the camera connected. This
live video feed has further been converted into
sequence of frames and these frames are used in
order to apply further image processing algorithm.
For that getsnapshot command of MATLAB is used,
which converts video feed into image array.
Figure1: Flow chart of proposed system Conditionally, ROI (Region of Interest) can also be
defined for capturing specified area of the frame.
PROPOSED SYSTEM Image acquisition toolbox of MATLAB can also be
used for image acquisition purpose.
The Face Recognition is done by detecting and
matching the face of a user. Here, a hardware set up
B. Face Detection:
is required which can be used as an image
Stepping the video frame will make sure we keep
acquisition hardware such as camera. This camera is
getting image input from the webcam and by
connected to a computer. Computer captures the
checking the size of the returning box we will be able
video from the camera. An algorithm for face
to get the number of face detected in the video
recognition is written in MATLAB environment. This
frame.
program recognizes the face of a user in real time.
Depending on the face recognized, the control signal In order to track the face a rectangle box is
is generated and sent through serial communication impended on to the face while tracking.
to Arduino board. State of LEDs connected to digital x = bbox(1, 1);
output pin of ATmega328P microcontroller shows
that who is using the computer. Experimental setup y = bbox(1, 2);
of this system is shown in Fig. 2
w = bbox(1, 3);
h = bbox(1, 4);
L=single(vzm)'*single(vzm);
[V,D]=eig(L);
V=single(vzm)*V;
V=V(:,end:-1:end-(N-1));
program has to be uploaded to ATmega328P using according to the user’s requirement and used as a
Arduino IDE. This program makes serial standalone system. The main advantages of using
communication port as an input port for the Arduino Arduino board are the board is inexpensive, used with
board. cross-platform, programming environment is simple
and clear and the software is open source and flexible to
modify. The Figure below shows an Arduino Uno which
is used in this system.
RESULTS
HARDWARE IMPLEMENTATION
Various types of cameras are available today. The one Table 1: Results Obtained
with good resolution should be used for the
effectiveness of the system. Generally, a laptop in-built After developing the whole system, testing of face
web cam or USB camera is used as an imaging device. recognition algorithm and its communication with
Here, the device takes continuous snapshots with Arduino board has been tested. Arduino board is
predefined triggering rate. These continuous snapshots programmed such that when a board receives a
look like a video as that has been taken in very small character from the MATLAB, digital output pin or a
fraction of time. Image acquisition toolbox is the best board sets HIGH or LOW accordingly. LEDs are
tool for the adjustment of parameters of an imaging connected on this digital output ports and by
device used in the system. receiving the signals from the MATLAB, they changes
their states from ON to OFF and OFF to ON.
B. Arduino Uno Depending on the face recognized, digital output
pins on Arduino board sets up HIGH or LOW
Arduino is an open-source electronics prototyping
accordingly. Table shown above states various
platform which can be used to develop interactive
outputs.
objects, taking input from a variety of switches or
sensors, and controlling a variety of lights, motors and
other physical outputs. Arduino can be programmed CONCLUSION
Recent Advances in Technology and Engineering , Department of Computer Science and Engineering, T John Institute of Technology,
Bangalore, Published By: International Journal of Sciecne, Engineering and Technology, ISSN (O): 2348-4098 , ISSN (P): 2395-4752
Main aim of this prototype system is to detect a face, 3 Student, Computer Science Department, Dayananda
track it, match it with stored Eigen faces and Sagar Academy of Technology and Management,
accordingly set digital pin of Arduino board HIGH or Karnataka, India, eyogiyogesh@gmail.com
LOW. Using MATLAB, face recognition algorithm has 4 Student, Computer Science Department, Dayananda
been developed with the PCM technique. The Eigen Sagar Academy of Technology and Management,
faces are stored first and then we take snapshot of Karnataka, India, asaikumargowd@gmail.com
user’s face in real time. Then we match the user’s
face with stored faces and we interfaced this Face 5 Professor, Computer Science Department, Dayananda
recognition with Arduino using Serial Sagar Academy of Technology and Management,
Karnataka, India, anitha.jayapalan@gmail.com
communication.
References
[9] https://www.mathswork.com.
[10] https://www.arduino.cc.
Author’s details