Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
62 views

Real-Time Face Recognition System Using Python and OpenCV

Uploaded by

selemondoc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Real-Time Face Recognition System Using Python and OpenCV

Uploaded by

selemondoc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

International Journal of Scientific Research in Engineering and Management (IJSREM)

Volume: 06 Issue: 05 | May - 2022 Impact Factor: 7.185 ISSN: 2582-3930

Real-time Face Recognition System using Python and


OpenCV
Chowdhury Md. Mizan1, Aritra Ghosh2, Sudeep Ghosh3,, Tridib Chakroborty4, Sayan Sarkar5, Spandan Ghosh6

1,2,3,4,5,6
Department of Information Technology, Guru Nanak Institute of technology, Kolkata, India

Abstract— Face recognition is a technique that an electronic device like a computer can determine and recognize a human face
by comparing the given sample of facial attributes of that person. This subject or topic, using unbiased facial data, computer-
based face recognition as an analysis is a largely unexplained part of research study.
Here in this research paper we have tried to find and present a ideal way of face detection using Python and a computer device
with active integrated web cam.
This report contains how using python we have tried to implement one of the most important part of computer science, Deep
learning, which can be used for detecting or recognizing human faces. We have proposed a system that can help in recognizing
a human face in real-time. This can be used for various purpose and various machine and smart devices

recognition technology gives an individual a sense of being


I. INTRODUCTION more aware, comfortable and safe, this technique is much
more desirable than the other methods.
The study of recognizing someone by their face, expressions,
and other physical characteristics has exploded in prominence There are many face recognition applications, which can be
in recent years. Face recognition technology is the subject of classified into two categories: those that require facial
several studies in various regions of the world, owing to its identification and those that require facial verification. The
numerous applications in diverse fields. Face recognition first group of application compares a face to one in a database,
technology is primarily utilized in security verification, while the second group does the opposite. The verification
including passport authentication, biometric authentication, technique attempts to verify a human face based on a sample
image processing, driver license verification, video of that face.
surveillance, and a variety of other applications. Although,
reliable biometric identification method already exists, such There are many limitations in the face recognition technology.
as the fingerprint verification and the retina scanner, but still, Sometimes, we see that human faces has been changed a lot
face recognition is stillz a challenging problem to solve and over a short period of time. Another major problem can be
there is currently no full proof solutions that can claim it can similar faces. We see that many different people in the world
handle all the situations it may encounter. Because of the can have similar faces, therefore a discrimination technique
numerous settings of the human face, face recognition system among those faces are very much needed. Otherwise, we will
is always tough to display an accurate solution. Due to some not be able to identity each person’s face accurately. Keeping
of these difficulties of the face recognition problem, there are the above problems in mind, we have introduced and
many different techniques. Furthermore, the applications developed a real-time image processing face recognition
cover a wide range of scenarios. system. The major advantages of this model is reduced cost,
improved accuracy and increased speed. In this research
There is no denying the fact, that there are numerous different paper, we have highlighted the various algorithms and
methods for identifying and confirming people, the primary techniques that can be used to face recognition application
incentive for face recognition is that it is a passive, based on PCA and LDA and verified on a real-time
technology. Further analysis is also carried out to check the
nonintrusive approach for checking and identifying people. accuracy and performance of the algorithm used.
Password verification, PIN number verification, token
systems, fingerprint as well as iris scanners, are some of the or as a non-text image. In the following sections, we have
examples of other methods of identification. But since, face reviewed the old work, propose the new classification scheme
and discuss the results that are obtained.
© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM13420 | Page 1
International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 05 | May - 2022 Impact Factor: 7.185 ISSN: 2582-3930

that we can achieve a system with increased accuracy and


There are two types of phases in Face Recognition System. speed up the entire process.
Those are: Some known algorithms of face recognition are:
 Marian Stewart Bartlett, Javier R. Movellan and
Face Detection: Terrence J. Sejnowski developed a face recognition
system which was based upon ICA and PCA. The
Face Detection, which is also known as Facial Detection is an algorithm is used here is PCA(Principle Component
AI (Artificial Intelligence) based Computer Science Analysis), it is a popular unsupervised statistical
Technology which helps to find and identify human faces in method that can be used to find useful image
images. Face Detection Technology is used in several field representation, here image is contained in pair wise
such as – biometrics, including security, entertainment, law relationship between pixels and the fact about ICA is
enforcement and personal safety – for tracking people. that information can be contained in the higher order
statistics. Where many other proposed a better
The application i.e., Face Detection use Machine Learning version of the face recognition system using ICA
and Algorithm to detect face of a particular person within an (Maryam Mollaee, Mohammad Hossein Moattar had
image. The algorithm generally starts by finding human eyes presented a face recognition system for better
which is the easiest features to detect. Then the algorithm accuracy).
attempts to detect the mouth, eyebrows, iris, nose and the  Matthew Turk and Alex Pentland had proposed a face
nostrils. After detecting if the algorithm confirms that it found recognition system using Eigenfaces approach.
the face it applies another additional test to confirm. Basically, this approach for recognition was
developed by Sirovich and Kirby which was used by
Turk and Pentland for face classification. They had
Face Recognition: developed a near-real-time computer system that by
locating and tracking a subject’s head, recognize a
Face Recognition is a process of recognizing human face person by comparing the characteristics of the face to
through Computer Technology which uses Biometrics to those of known individuals.
indicate facial features from a video or photograph. After that  A face recognition system using LDA algorithm was
it compares the received information with the database of a approached by K. N. Plataniotis, Juwei Lu and A. N.
saved face or known face to find match. Venetsanopoulos. Ronald A. Fisher first formulated
the LDA, this algorithm can be also used to reduce
At first a picture of our face is clicked from an image or video the dimensionality. LDA and PCA both approaches
are linear transformation technique but being an
which might be alone or in a crowd, then a software reads the
unsupervised algorithm PCA, since it ignores class
geometry of our face. The distance between chin to forehead
label sand and its aim is to find directions that
or the distance between our eyes is included as key factors.
maximize variance. LDA is supervised, it computes
Then this key factors are matched with the database and if it
the direction that represents axis that maximizes the
is matched then the face is recognized.
separation between many classes.
 Dhanaseely, Himavati, Srinivasan had used PCA
approach to achieve a face recognition system with
reduction of dimensionality and used neural
II. RELATED WORK: network for classification based on upright
frontal face detection. Neural network carries
In this article, we have tried to build a face recognition system signals from one place to another which is
using python. We have tried to go further one step to the face biologically inspired, it behaves like neurons of
detection through face recognition system, it’s a system that human beings, but it requires lot of computational
can identify human with proper authentication. As the real- work.
world applications, it can be used for few cases like – finding  Maliha Khan; Sudeshna Chakraborty; Rani
missing person, security purpose, attendance system. There Astya; Shaveta Khepra had proposed a Face
are a lot of projects and research works has been done to Recognition System using OpenCV. They even used
achieve a proper and efficient face recognition system. The PCA to reduce large amount of stored data to the size
aim is to select the appropriate approach of face recognition that is required to economically represent the data.

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM13420 | Page 2


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 05 | May - 2022 Impact Factor: 7.185 ISSN: 2582-3930

detect the face of a person. It is well known for its


III. LIBRARIES USED performance and how it able to recognize or detect the
faces of a person from both sides i.e., front face and side
face.
1. NUMPY:

Numpy is a package for computing in Python. It is a III. METHODOLOGY


library of Python which provides multidimensional array
objects, derived objects of various kind ( such as matrices
and masked arrays. ) . Other mathematical calculations an In our project, we made a system which will recognize a
also be performed. In our system, we used Numpy to person’s face with accuracy. Our system generally captures
convert our images into some form of an array so that we images through webcam and save it. And the output of our
can store the model that has been trained. system is that it will recognize a person’s face with accuracy.
The steps of our methods are as follows:
 At first, when a person came in front of the webcam
the webcam starts taking pictures of that person and
2. OpenCV: saves that images. Our device can take n number of
images depending of user’s choice.
OpenCV is an image and video processing library that is  Our system consists of three steps:
used for video and image analysis, like face detection, 1. Capturing images.
photo editing, license plate reading, advanced robotic 2. Trained all captured images.
vision, and much more. 3. Recognition of face.
 Our system takes 100 pictures at a time at the time of
Dlib library contains implementation of ‘deep metric capturing images. When the system finishes taking
learning’ which is used for constructing our face 100 images of a person it automatically stops
embeddings which are used for the actual face recognition capturing, otherwise if the user wants to take images
process. less than 100 then he/she can stop capturing images
by pressing ‘q’.
The face_recognition library, which is super easy to work  While taking the pictures the users have to give an ID
with and we will be using this in our code. First and along with the name of the person whose face is be to
foremost, we have to install dlib library before we install detected. After assigning an ID the details are saved
face_recognition library. in a csv excel file with an unique id which will be
used for recognizing faces.
 One database csv file has also been created to save
3. Haar Cascade Frontal Face: the name of the persons whose images are captured
by our system.
Haar cascade Frontal Face Specifier is an Object Detection
 We use Local Binary Pattern Histogram method to
Algorithm which is used to detect or recognize faces in an
convert the bits which are generated by Haar Cascade
picture or a video of real time. Haar Cascade algorithm
Frontalface Specifier to computer understandable
generally uses edge/line detection features which was
binary digits which makes the task machine
proposed by Viola and Jones in their research paper
understandable to successfully continue with the
“Rapid Object Detection using a Boosted Cascade of
recognition process.
Simple Features” which was published in the year 2001.
 After successfully capturing images of a person and
This algorithm is given a lot of positive images which
convert it to machine readable code our system
consists faces, and a lot of negative images which does not
trained that images for recognition.
contains any face to train them. The model which was
created from this training is available at the OpenCV  After completion of the training process the system
GitHub repository. then recognize the persons wit the help of the
database with accuracy.
4. Local Binary Pattern Histogram:

LBPH (Local Binary Pattern Histogram) is a type of


Face-Recognition algorithm which is used to recognize or
© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM13420 | Page 3
International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 05 | May - 2022 Impact Factor: 7.185 ISSN: 2582-3930

V. FLOW CHART OF THE PROPOSED


ALGORITHM

Fig: 1.1

In Figure 1.1 it was shown that one id and name of a person is


taken as input. This particular process is done in face image
capturing process. Here, one id and name of that person is
taken as input and after that webcam automatically starts
capturing pictures of face as shown in fig 1.2 below.

Fig: 1.2. Capturing images after giving id and name of that


particular person

Fig: 1.3. Training of the captured images

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM13420 | Page 4


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 05 | May - 2022 Impact Factor: 7.185 ISSN: 2582-3930

Figure 1.3 shows us that after successfully capturing images


of a particular person our system trained that captured images
for future recognition purpose. After the competition of the
training of captured images the name and the given id gets
stored in a separate file as shown in figure 1.4 which is used
in recognition process.

Fig: 1.6. Shows Recognition of a Unknown face

If the face doesn’t match with the database then our system
will declare that person as unknown person. This high
accuracy of our proposed system makes it more secure.

In this study, we have implemented a Real Time Face


Recognition System using OpenCV and Python. It can be used
as a security system also because of its high accuracy. It
Fig: 1.4. Name and ID of that particular person is stored in recognizes a person if and only if the face of that particular
a separate file for recognition process. person matches with the database with 100 percent accuracy.
This is Real-Time System which captures person’s images live
using webcam. In this project there is still some work remained
VI. RESULTS AND DISCUSSION to do. Our future work is to implement Iris Recognition in this
system which will make this system more appropriate for
security of some confidential data or recognition purpose too.

VII. REFERENCE

[1] Emami, Shervin & Suciu, Valentin. (2012). Facial


Recognition using OpenCV. Journal of Mobile, Embedded
and Distributed Systems. 4.

[2] Dhawle, T., Ukey, U. and Choudante, R., 2020. Face


Detection and Recognition Using OpenCV and
Python. Int. Res. J. Eng. Technol, 7(10).

[3] M. Khan, S. Chakraborty, R. Astya and S. Khepra, "Face


Detection and Recognition Using OpenCV," 2019
Fig: 1.5. Recognition of Known face International Conference on Computing, Communication, and
Intelligent Systems (ICCCIS), 2019, pp. 116-119, doi:
10.1109/ICCCIS48478.2019.8974493.
After capturing images and training of those images two types
of output generates. One for known person and the other for [4] Kumbhar, P.Y., Attaullah, M., Dhere, S. and
Unknown person. During Recognition if the person’s face Hipparagi, S., 2017. Real time face detection and
completely matches with the database with 100 percent tracking using OpenCV. International journal for
accuracy then the stored id and the name of that person will research in emerging science and technology, 4(4).
visible on the screen.
[5] Manikandan, J., Prathyusha, S.L., Kumar, P.S.,
Chandra, Y.J. and Hanuman, M.U., 2020. Face

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM13420 | Page 5


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 05 | May - 2022 Impact Factor: 7.185 ISSN: 2582-3930

Detection and Recognition using Open CV Based on


Fisher Faces Algorithm. Proceedings of International
Journal of Recent Technology and Engineering (IJRTE),
ISSN, pp.2277-3878.

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM13420 | Page 6

You might also like