SlideShare a Scribd company logo
1 of 25
Real Time Facial
Recognition using
Open CV and Python
(using Laptop’s Webcam)
Master’s EMM – Computer Vision Project
👦
Presented By:
• Akash Satamkar (31672)
• Krupali Rana (31668)
Under guidance of : Prof. Dr. Stefan Elser.
Introduction
• Implementation of Face Detection and Recognition by simply
using Laptop’s Webcam.
• Real Time face detection using Face Detection algorithm to
visualize human faces in Digital image.
• We are using video feed from a webcam which are a sequence of
frames of still images being updated one after the other to
recognize and predict faces.
2
Goals
3
• To train the image dataset and store them with proper
faceID.
• Passing the frames captured by webcam one by one to
detect faces.
• Depending upon the confidence level, determine
whether to label the predicted face or not.
• Validating the test results with multiple test cases.
• Improving the training data with larger data sets of
images.
Software Analysis
4
• Anaconda IDE
• SpyDer studio with Python 3.7
version
• Open CV libraries
Haar Cascade Classifier
▪ Haar feature based classifier is a machine learning
based approach
▪ Detect objects in images
▪ Train a lot of Positive and negative images
▪ The haarcascade_frontalface_default.xml is a haar
cascade designed by OpenCV to detect the frontal
face
5
Positive and Negative images
▪ Positive face example images provide a lot of variations. It
manually crops and normalize each face into a standard
size
▪ Negative non face examples are images that don’t contain
faces. They are taken from arbitrary images which do not
contain the object you want to detect.
6
Positive face set of images
Negative non face set of images
Computation of Features
detectMultiscale() Module
- To create rectangle around the faces
detected in image.
Parameters :
scaleFactor = Adjust the size of image
minNeighbors = Specify how many
neighbors person can have
Cascade of Classifiers
Features are grouped together into stages
of classifiers.
If a window fails at 1st stage , it is discarded.
Else it is passed to 2nd stage of features.
The window which passes all stages is face
region.
7
LBPH Algorithm
8
• Local Binary Pattern is simple but
efficient texture operator.
• It is combined with HOG (Histogram of
Gradients) to recognize faces in image.
It uses 4 parameters : {Radius, Neighbours, Grid X, Grid Y }
LBP Operation:
It uses sliding window concept based on
parameters Radius and Neighbours.
9
Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b
• Extracting a portion of this grayscale image (3 x 3 pixels)
• Represented in a matrix of 3 x 3 of pixel intensities with each pixel intensity in range (0 – 255)
• Using centre value as threshold and perform thresholding. (0 = < threshold, 1 = > threshold)
• Obtain binary values and concatenate in clockwise manner.
• Convert binary value to decimal value and set it to centre value.
• In the end , we have obtained a new image with better characteristics.
10
Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b
LBP combined with Histogram to predict faces:
• Now we divide the new image generated into grids with Grid X and Grid Y parameters.
• Obtain the histogram of each grid .
• Now concatenate the individual histograms to obtain a new and bigger histogram.
• The final histogram represents characteristics of original image.
• The algorithm is trained and each histogram is used to represent each image of training
dataset.
• We compare the two histograms and return the image with closest histogram.
• The output is the ID with closest match and the calculated Euclidean distance can be a
confidence measurement.
▪ Confidence level :
The lower the value of confidence the better is the match which means the distance
between two histograms is closer.
Then we can use this confidence level to predict the face by defining the threshold.
This method is illumination invariant in nature.
Robust method to represent local features in image
11
12
Some important OpenCV functions :
1. FaceDetection function
2. Label for training data function
13
3. Draw Rectangle function
4. Put Text function
5. Train Classifier function
Our Process is easy
Creating Dataset
Creating two subdirectories
and loading them with set of
individual images for
training.
Training Dataset
Training the dataset
using LBPH algorithm
and save the trained
data into “.yml” file.
Predicting Faces in
Real time
Loading the trained data
file and predicting faces
frame by frame and label
them.
14
Flowchart
15
16
Place your screenshot here
Testing and Results
17
Case 1: Single face detection and recognition
Place your screenshot here
Case 2: Multiple faces
18
Place your screenshot here
Case 3: Multiple faces with unknown labelled person
19
Place your screenshot here
Case 4: Using different props on face
20
Place your screenshot here
Case 4: Using different props on face
21
Place your screenshot here
Case5: Masking certain regions of Face
22
Further Enhancements
23
• The training dataset can be improved by including
more no. of sample images.
• We can further implement CNN (Convolution Neural
Networks) using TensorFlow for better Face
Recognition.
References
▪ Working of LBPH : https://towardsdatascience.com/face-recognition-how-lbph-works-
90ec258c3d6b
▪ Article on face detection basics : https://www.datacamp.com/community/tutorials/face-
detection-python-opencv
▪ Link for downloading Anaconda package - https://www.anaconda.com/distribution/
▪ Link for Basics of Haar Cascade classifier-
https://docs.opencv.org/3.4.1/d7/d8b/tutorial_py_face_detection.html
▪ https://www.learnopencv.com/face-detection-opencv-dlib-and-deep-learning-c-python/
24
THANKS!
Any questions?
25
😉

More Related Content

What's hot

Face Detection Attendance System By Arjun Sharma
Face Detection Attendance System By Arjun SharmaFace Detection Attendance System By Arjun Sharma
Face Detection Attendance System By Arjun SharmaArjun Agnihotri
 
Object detection presentation
Object detection presentationObject detection presentation
Object detection presentationAshwinBicholiya
 
Face detection ppt
Face detection pptFace detection ppt
Face detection pptPooja R
 
Automatic Attendance System using Deep Learning
Automatic Attendance System using Deep LearningAutomatic Attendance System using Deep Learning
Automatic Attendance System using Deep LearningSunil Aryal
 
Automatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionAutomatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionNikyaa7
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition pptSantosh Kumar
 
Face Recognition Technology
Face Recognition TechnologyFace Recognition Technology
Face Recognition TechnologyShashidhar Reddy
 
Face mask detection
Face mask detection Face mask detection
Face mask detection Sonesh yadav
 
Face recognization
Face recognizationFace recognization
Face recognizationleenak770
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection SystemAbhiroop Ghatak
 
Face Recognition based Lecture Attendance System
Face Recognition based Lecture Attendance SystemFace Recognition based Lecture Attendance System
Face Recognition based Lecture Attendance SystemKarmesh Maheshwari
 
Attendance system based on face recognition using python by Raihan Sikdar
Attendance system based on face recognition using python by Raihan SikdarAttendance system based on face recognition using python by Raihan Sikdar
Attendance system based on face recognition using python by Raihan Sikdarraihansikdar
 
Face recognition using artificial neural network
Face recognition using artificial neural networkFace recognition using artificial neural network
Face recognition using artificial neural networkSumeet Kakani
 
Face Recognition using OpenCV
Face Recognition using OpenCVFace Recognition using OpenCV
Face Recognition using OpenCVVasile Chelban
 
Face Recognition System/Technology
Face Recognition System/TechnologyFace Recognition System/Technology
Face Recognition System/TechnologyRahulSingh3034
 

What's hot (20)

Final year ppt
Final year pptFinal year ppt
Final year ppt
 
Face recognisation system
Face recognisation systemFace recognisation system
Face recognisation system
 
Face Detection Attendance System By Arjun Sharma
Face Detection Attendance System By Arjun SharmaFace Detection Attendance System By Arjun Sharma
Face Detection Attendance System By Arjun Sharma
 
Object detection presentation
Object detection presentationObject detection presentation
Object detection presentation
 
Face detection ppt
Face detection pptFace detection ppt
Face detection ppt
 
Automatic Attendance System using Deep Learning
Automatic Attendance System using Deep LearningAutomatic Attendance System using Deep Learning
Automatic Attendance System using Deep Learning
 
Automatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionAutomatic Attendance system using Facial Recognition
Automatic Attendance system using Facial Recognition
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition ppt
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Face Recognition
Face RecognitionFace Recognition
Face Recognition
 
Face Recognition Technology
Face Recognition TechnologyFace Recognition Technology
Face Recognition Technology
 
Face mask detection
Face mask detection Face mask detection
Face mask detection
 
Face recognization
Face recognizationFace recognization
Face recognization
 
Face Detection
Face DetectionFace Detection
Face Detection
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection System
 
Face Recognition based Lecture Attendance System
Face Recognition based Lecture Attendance SystemFace Recognition based Lecture Attendance System
Face Recognition based Lecture Attendance System
 
Attendance system based on face recognition using python by Raihan Sikdar
Attendance system based on face recognition using python by Raihan SikdarAttendance system based on face recognition using python by Raihan Sikdar
Attendance system based on face recognition using python by Raihan Sikdar
 
Face recognition using artificial neural network
Face recognition using artificial neural networkFace recognition using artificial neural network
Face recognition using artificial neural network
 
Face Recognition using OpenCV
Face Recognition using OpenCVFace Recognition using OpenCV
Face Recognition using OpenCV
 
Face Recognition System/Technology
Face Recognition System/TechnologyFace Recognition System/Technology
Face Recognition System/Technology
 

Similar to Computer Vision - Real Time Face Recognition using Open CV and Python

cvpresentation-190812154654 (1).pptx
cvpresentation-190812154654 (1).pptxcvpresentation-190812154654 (1).pptx
cvpresentation-190812154654 (1).pptxPyariMohanJena
 
ppt 20BET1024.pptx
ppt 20BET1024.pptxppt 20BET1024.pptx
ppt 20BET1024.pptxManeetBali
 
ppt 20BET1024.pptx
ppt 20BET1024.pptxppt 20BET1024.pptx
ppt 20BET1024.pptxManeetBali
 
Rapid object detection using boosted cascade of simple features
Rapid object detection using boosted  cascade of simple featuresRapid object detection using boosted  cascade of simple features
Rapid object detection using boosted cascade of simple featuresHirantha Pradeep
 
Report face recognition : ArganRecogn
Report face recognition :  ArganRecognReport face recognition :  ArganRecogn
Report face recognition : ArganRecognIlyas CHAOUA
 
Automated_attendance_system_project.pptx
Automated_attendance_system_project.pptxAutomated_attendance_system_project.pptx
Automated_attendance_system_project.pptxNaveensai51
 
IRJET - A Review on Face Recognition using Deep Learning Algorithm
IRJET -  	  A Review on Face Recognition using Deep Learning AlgorithmIRJET -  	  A Review on Face Recognition using Deep Learning Algorithm
IRJET - A Review on Face Recognition using Deep Learning AlgorithmIRJET Journal
 
Face Recognition Based Intelligent Door Control System
Face Recognition Based Intelligent Door Control SystemFace Recognition Based Intelligent Door Control System
Face Recognition Based Intelligent Door Control Systemijtsrd
 
Mirko Lucchese - Deep Image Processing
Mirko Lucchese - Deep Image ProcessingMirko Lucchese - Deep Image Processing
Mirko Lucchese - Deep Image ProcessingMeetupDataScienceRoma
 
Face Detection System on Ada boost Algorithm Using Haar Classifiers
Face Detection System on Ada boost Algorithm Using Haar ClassifiersFace Detection System on Ada boost Algorithm Using Haar Classifiers
Face Detection System on Ada boost Algorithm Using Haar ClassifiersIJMER
 
Learning with Relative Attributes
Learning with Relative AttributesLearning with Relative Attributes
Learning with Relative AttributesVikas Jain
 
IRJET - Hand Gesture Recognition to Perform System Operations
IRJET -  	  Hand Gesture Recognition to Perform System OperationsIRJET -  	  Hand Gesture Recognition to Perform System Operations
IRJET - Hand Gesture Recognition to Perform System OperationsIRJET Journal
 
IRJET- Class Attendance using Face Detection and Recognition with OPENCV
IRJET- Class Attendance using Face Detection and Recognition with OPENCVIRJET- Class Attendance using Face Detection and Recognition with OPENCV
IRJET- Class Attendance using Face Detection and Recognition with OPENCVIRJET Journal
 
Blind Source Camera Identification
Blind Source Camera Identification Blind Source Camera Identification
Blind Source Camera Identification Sudhanshu Patel
 
Avihu Efrat's Viola and Jones face detection slides
Avihu Efrat's Viola and Jones face detection slidesAvihu Efrat's Viola and Jones face detection slides
Avihu Efrat's Viola and Jones face detection slideswolf
 
Real time multi face detection using deep learning
Real time multi face detection using deep learningReal time multi face detection using deep learning
Real time multi face detection using deep learningReallykul Kuul
 
PROJECT REPORT
PROJECT REPORTPROJECT REPORT
PROJECT REPORTpmm330
 
Gender Classification using SVM With Flask
Gender Classification using SVM With FlaskGender Classification using SVM With Flask
Gender Classification using SVM With FlaskAI Publications
 

Similar to Computer Vision - Real Time Face Recognition using Open CV and Python (20)

cvpresentation-190812154654 (1).pptx
cvpresentation-190812154654 (1).pptxcvpresentation-190812154654 (1).pptx
cvpresentation-190812154654 (1).pptx
 
ppt 20BET1024.pptx
ppt 20BET1024.pptxppt 20BET1024.pptx
ppt 20BET1024.pptx
 
ppt 20BET1024.pptx
ppt 20BET1024.pptxppt 20BET1024.pptx
ppt 20BET1024.pptx
 
Rapid object detection using boosted cascade of simple features
Rapid object detection using boosted  cascade of simple featuresRapid object detection using boosted  cascade of simple features
Rapid object detection using boosted cascade of simple features
 
Report face recognition : ArganRecogn
Report face recognition :  ArganRecognReport face recognition :  ArganRecogn
Report face recognition : ArganRecogn
 
Automated_attendance_system_project.pptx
Automated_attendance_system_project.pptxAutomated_attendance_system_project.pptx
Automated_attendance_system_project.pptx
 
IRJET - A Review on Face Recognition using Deep Learning Algorithm
IRJET -  	  A Review on Face Recognition using Deep Learning AlgorithmIRJET -  	  A Review on Face Recognition using Deep Learning Algorithm
IRJET - A Review on Face Recognition using Deep Learning Algorithm
 
Face Recognition Based Intelligent Door Control System
Face Recognition Based Intelligent Door Control SystemFace Recognition Based Intelligent Door Control System
Face Recognition Based Intelligent Door Control System
 
Mirko Lucchese - Deep Image Processing
Mirko Lucchese - Deep Image ProcessingMirko Lucchese - Deep Image Processing
Mirko Lucchese - Deep Image Processing
 
Face Detection System on Ada boost Algorithm Using Haar Classifiers
Face Detection System on Ada boost Algorithm Using Haar ClassifiersFace Detection System on Ada boost Algorithm Using Haar Classifiers
Face Detection System on Ada boost Algorithm Using Haar Classifiers
 
Learning with Relative Attributes
Learning with Relative AttributesLearning with Relative Attributes
Learning with Relative Attributes
 
IRJET - Hand Gesture Recognition to Perform System Operations
IRJET -  	  Hand Gesture Recognition to Perform System OperationsIRJET -  	  Hand Gesture Recognition to Perform System Operations
IRJET - Hand Gesture Recognition to Perform System Operations
 
Ppts21
Ppts21Ppts21
Ppts21
 
IRJET- Class Attendance using Face Detection and Recognition with OPENCV
IRJET- Class Attendance using Face Detection and Recognition with OPENCVIRJET- Class Attendance using Face Detection and Recognition with OPENCV
IRJET- Class Attendance using Face Detection and Recognition with OPENCV
 
Blind Source Camera Identification
Blind Source Camera Identification Blind Source Camera Identification
Blind Source Camera Identification
 
[DL輪読会]ClearGrasp
[DL輪読会]ClearGrasp[DL輪読会]ClearGrasp
[DL輪読会]ClearGrasp
 
Avihu Efrat's Viola and Jones face detection slides
Avihu Efrat's Viola and Jones face detection slidesAvihu Efrat's Viola and Jones face detection slides
Avihu Efrat's Viola and Jones face detection slides
 
Real time multi face detection using deep learning
Real time multi face detection using deep learningReal time multi face detection using deep learning
Real time multi face detection using deep learning
 
PROJECT REPORT
PROJECT REPORTPROJECT REPORT
PROJECT REPORT
 
Gender Classification using SVM With Flask
Gender Classification using SVM With FlaskGender Classification using SVM With Flask
Gender Classification using SVM With Flask
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Computer Vision - Real Time Face Recognition using Open CV and Python

  • 1. Real Time Facial Recognition using Open CV and Python (using Laptop’s Webcam) Master’s EMM – Computer Vision Project 👦 Presented By: • Akash Satamkar (31672) • Krupali Rana (31668) Under guidance of : Prof. Dr. Stefan Elser.
  • 2. Introduction • Implementation of Face Detection and Recognition by simply using Laptop’s Webcam. • Real Time face detection using Face Detection algorithm to visualize human faces in Digital image. • We are using video feed from a webcam which are a sequence of frames of still images being updated one after the other to recognize and predict faces. 2
  • 3. Goals 3 • To train the image dataset and store them with proper faceID. • Passing the frames captured by webcam one by one to detect faces. • Depending upon the confidence level, determine whether to label the predicted face or not. • Validating the test results with multiple test cases. • Improving the training data with larger data sets of images.
  • 4. Software Analysis 4 • Anaconda IDE • SpyDer studio with Python 3.7 version • Open CV libraries
  • 5. Haar Cascade Classifier ▪ Haar feature based classifier is a machine learning based approach ▪ Detect objects in images ▪ Train a lot of Positive and negative images ▪ The haarcascade_frontalface_default.xml is a haar cascade designed by OpenCV to detect the frontal face 5
  • 6. Positive and Negative images ▪ Positive face example images provide a lot of variations. It manually crops and normalize each face into a standard size ▪ Negative non face examples are images that don’t contain faces. They are taken from arbitrary images which do not contain the object you want to detect. 6 Positive face set of images Negative non face set of images
  • 7. Computation of Features detectMultiscale() Module - To create rectangle around the faces detected in image. Parameters : scaleFactor = Adjust the size of image minNeighbors = Specify how many neighbors person can have Cascade of Classifiers Features are grouped together into stages of classifiers. If a window fails at 1st stage , it is discarded. Else it is passed to 2nd stage of features. The window which passes all stages is face region. 7
  • 8. LBPH Algorithm 8 • Local Binary Pattern is simple but efficient texture operator. • It is combined with HOG (Histogram of Gradients) to recognize faces in image. It uses 4 parameters : {Radius, Neighbours, Grid X, Grid Y } LBP Operation: It uses sliding window concept based on parameters Radius and Neighbours.
  • 9. 9 Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b • Extracting a portion of this grayscale image (3 x 3 pixels) • Represented in a matrix of 3 x 3 of pixel intensities with each pixel intensity in range (0 – 255) • Using centre value as threshold and perform thresholding. (0 = < threshold, 1 = > threshold) • Obtain binary values and concatenate in clockwise manner. • Convert binary value to decimal value and set it to centre value. • In the end , we have obtained a new image with better characteristics.
  • 10. 10 Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b LBP combined with Histogram to predict faces: • Now we divide the new image generated into grids with Grid X and Grid Y parameters. • Obtain the histogram of each grid . • Now concatenate the individual histograms to obtain a new and bigger histogram. • The final histogram represents characteristics of original image.
  • 11. • The algorithm is trained and each histogram is used to represent each image of training dataset. • We compare the two histograms and return the image with closest histogram. • The output is the ID with closest match and the calculated Euclidean distance can be a confidence measurement. ▪ Confidence level : The lower the value of confidence the better is the match which means the distance between two histograms is closer. Then we can use this confidence level to predict the face by defining the threshold. This method is illumination invariant in nature. Robust method to represent local features in image 11
  • 12. 12 Some important OpenCV functions : 1. FaceDetection function 2. Label for training data function
  • 13. 13 3. Draw Rectangle function 4. Put Text function 5. Train Classifier function
  • 14. Our Process is easy Creating Dataset Creating two subdirectories and loading them with set of individual images for training. Training Dataset Training the dataset using LBPH algorithm and save the trained data into “.yml” file. Predicting Faces in Real time Loading the trained data file and predicting faces frame by frame and label them. 14
  • 16. 16
  • 17. Place your screenshot here Testing and Results 17 Case 1: Single face detection and recognition
  • 18. Place your screenshot here Case 2: Multiple faces 18
  • 19. Place your screenshot here Case 3: Multiple faces with unknown labelled person 19
  • 20. Place your screenshot here Case 4: Using different props on face 20
  • 21. Place your screenshot here Case 4: Using different props on face 21
  • 22. Place your screenshot here Case5: Masking certain regions of Face 22
  • 23. Further Enhancements 23 • The training dataset can be improved by including more no. of sample images. • We can further implement CNN (Convolution Neural Networks) using TensorFlow for better Face Recognition.
  • 24. References ▪ Working of LBPH : https://towardsdatascience.com/face-recognition-how-lbph-works- 90ec258c3d6b ▪ Article on face detection basics : https://www.datacamp.com/community/tutorials/face- detection-python-opencv ▪ Link for downloading Anaconda package - https://www.anaconda.com/distribution/ ▪ Link for Basics of Haar Cascade classifier- https://docs.opencv.org/3.4.1/d7/d8b/tutorial_py_face_detection.html ▪ https://www.learnopencv.com/face-detection-opencv-dlib-and-deep-learning-c-python/ 24