0% found this document useful (0 votes)
81 views5 pages

Interfacing of MATLAB With Arduino For Face Recognition

Hi

Uploaded by

srijith raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views5 pages

Interfacing of MATLAB With Arduino For Face Recognition

Hi

Uploaded by

srijith raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Recent Advances in Technology International Journal of Science,

and Engineering (RATE-2017) Engineering and Technology


th
6 National Conference by TJIT, Bangalore An Open Access Journal

Interfacing of MATLAB with Arduino for Face


Recognition
1
Kiran R, 2M Lohith, 3Yogesh E, 4Sai Kumar A, 5Anitha J

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

Introduction hardware includes Camera, Arduino board with


ATmega328P microcontroller.
The revolutionized computers open up the chances
of using images and video frames as input signals of The goal of this work is to visually detect and
the signal processing. Such signal processing is match a face and send the data to the Arduino board
named as image processing. Image processing to glow LEDs connected with the microcontroller’s
transforms various sets of characteristics of image digital output port. The most challenging issue rose
parameters into output as control signals. The while developing the face recognition algorithm is
constant revolution in the field of digital image that detection of face against complex background.
processing opens up a multitude of application in Here, we are using PCA method with Eigen faces to
various areas, in which innovative technologies could recognize the face. Working of the proposed
have been developed. The best platform on which prototype system can be understood by the
many image processing algorithms have been following flowchart shown in fig. 1
developed so far is MATLAB. Major advantage of
using MATLAB as an image processing algorithm
development environment is it’s built in image
processing functions and its compatibility with
hardware such as cameras, Arduino Raspberry Pie
and many more.

The aim of this paper is to propose a prototype


model which both detects and matches a face with
distinct features and generates and sends a control
signal to the hardware according to the face
recognized. This proposed prototype system
contains both software and hardware tools. Software
includes MATLAB and Arduino IDE software whereas

© 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);

bboxPolygon = [x, y, x+w, y, x+w, y+h, x, y+h];

Where bboxPolygon(1:2:end) represents the x


values of the polygon and bboxPolygon(2:2:end)
represents the y Values of the polygon.

Figure 2: Experimental Setup


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

% vzm is v with the mean removed.

After subtracting the mean from our database set,


we will need to find the correlation matrix, and find
the eigenvectors to it.

 L=single(vzm)'*single(vzm);
[V,D]=eig(L);

V=single(vzm)*V;

V=V(:,end:-1:end-(N-1));

%N = 10 which means we are choosing the 10 largest


eigenvectors.
Figure 3: Face detection using rectangle box As you can see here, V can give us the eigenvectors
for L, whereas L is the correlation matrix, ordered by
 To detect the points inside of the face
its Eigen values in D from low to high. Single is just
region, therefore the following code is going to give
converting data to single precision.
us the corner points in face region.
The image of the person is captured and the points
Points=detectMinEigenFeatures(rgb2gray(videoFrame)
on the face are detected and it is stored in the
, 'ROI', bbox);
database. When a new image of the person is
snapped its output may come out to be positive only
if the points detected are almost same to the
previous detection. Figure 5 shows the two faces one
on the left is the currently captured image and image
on the right is already present in the database.

Figure 4: Detecting points on the face.

C. Face Matching: Figure 5: Matched faces


Principal Component Analysis (PCA) is used to match
the image in the database. First a set of data images D. Interfacing MATLAB with Arduino
are stored in the program. After we have to use PCA
on the database, the original data will be in the To interface MATLAB with Arduino, certain Arduino
forms of the eigenvectors. libraries are downloaded in MATLAB IDE, this creates
a Arduino to run in MATLAB environment.
After inputting an image, we will measure the Communication of hand gesture algorithm with
difference between the eigenvectors in input images Arduino board is done through serial data transfer.
with the original images in the dataset, and then we To access the serial port of a computer using
need to determine which picture has the least MATLAB, couple of lines of coding should be done.
difference to identify the input image. The general MATLAB function for serial port access is shown
eigenvector calculation requires that we subtract the below.
mean of our database.
ser =serial('COM18');
 m=uint8(mean(v,2)); %m is the mean of all
images, v is the database. Here, COM18 is a serial communication port on
vzm=v-uint8(single(m)*single(O)); which Arduino board is connected. Moreover, a
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

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.

Figure 7: Arduino Uno

RESULTS

Figure 6: Arduino IDE

HARDWARE IMPLEMENTATION

Camera is the first and the most important hardware


in this system used for image acquisition purpose.
Secondly, the implementation of face recognition
algorithm on hardware is a challenging task. Proper
selection of a hardware is important for the effective
working of the system. Here, Arduino board is used
which is powered by ATmega328P microcontroller.
Arduino Uno can be programmed using Arduino IDE
with precise serial port adjustment. Information
regarding hardware and their roles in the system is
explained below.

A. Image acquision device

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

[1] Panth Shah and Tithi Vyas (2014), “Interfacing of


MATLAB with Arduino for Object Detection Algorithm
Implementation using Serial Communication”, International
Journal of Engineering Research & Technology (IJERT).

[2] Chunming Li, Yanhua Diao and Hongtao Ma (2009), “A


Statistical PCA Method for Face Recognition”,IEEE.

[3] V. Subburaman and S. Marcel. Fast Bounding Box


estimation based face detection in “Workshop on Face
Detection of the European Conference on Computer Vision
(ECCV)”, 2010.

[4] Raquib Buksh, Soumyajit Routh, Parthib Mitra, Subhajit


Banik, Abhishek Mallik, Sauvik Das Gupta, “Implementation
of MATLAB based object detection technique on Arduino
Board and iROBOT CREATE”, IJSRP, Vol. 4, Issue 1, Jan
2014, ISSN: 2250-3153.

[5] Nikhil Sawake, “Intelligent Robotic Arm”, Submitted to


Innovation Cell, IIT- Bombay, July 2013.

[6] P. Jenifer Martina, P. Nagarajan and P. Karthikeyan


(2013), “Hand Gesture Recognition Based Real-time
Command System”, International Journal of Computer
Science and Mobile Computing (IJCSMC).

[7] Viola Paul, J. Jones. Michael, “Rapid Object Detection


Using a Boosted Cascade on Simple Features”, IEEE CVPR,
Vol.1, NO. 2, p511~518,Dec. 2001.

[8] Gary Bradski, Adrian Kaehler, Vadim Pisarevsky,


”Learning-Based Computer Vision with Intel’s Open Source
Computer Vision Library”,Intel Technology Journal, Vol
9,Issue 2, p119~131, 19 May 2005.

[9] https://www.mathswork.com.

[10] https://www.arduino.cc.

Author’s details

1 Student, Computer Science Department, Dayananda


Sagar Academy of Technology and Management,
Karnataka, India, kirana.r.mankale@gmail.com

2 Student, Computer Science Department, Dayananda


Sagar Academy of Technology and Management,
Karnataka, India, mlohith4u@gmail.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy