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 recognition technology
Face recognition technologyFace recognition technology
Face recognition technologyShubhamLamichane
 
Project Face Detection
Project Face Detection Project Face Detection
Project Face Detection Abu Saleh Musa
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technologyranjit banshpal
 
Face detection presentation slide
Face detection  presentation slideFace detection  presentation slide
Face detection presentation slideSanjoy Dutta
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection SystemAbhiroop Ghatak
 
Facial Expression Recognition System using Deep Convolutional Neural Networks.
Facial Expression Recognition  System using Deep Convolutional Neural Networks.Facial Expression Recognition  System using Deep Convolutional Neural Networks.
Facial Expression Recognition System using Deep Convolutional Neural Networks.Sandeep Wakchaure
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition pptSantosh Kumar
 
Face recognization
Face recognizationFace recognization
Face recognizationleenak770
 
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 recognigion system ppt
Face recognigion system pptFace recognigion system ppt
Face recognigion system pptRavi Kumar
 
Face recognition technology - BEST PPT
Face recognition technology - BEST PPTFace recognition technology - BEST PPT
Face recognition technology - BEST PPTSiddharth Modi
 
Face recognization using artificial nerual network
Face recognization using artificial nerual networkFace recognization using artificial nerual network
Face recognization using artificial nerual networkDharmesh Tank
 
Face detection ppt
Face detection pptFace detection ppt
Face detection pptPooja R
 
Face Recognition System/Technology
Face Recognition System/TechnologyFace Recognition System/Technology
Face Recognition System/TechnologyRahulSingh3034
 

What's hot (20)

Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technology
 
Project Face Detection
Project Face Detection Project Face Detection
Project Face Detection
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technology
 
Face detection presentation slide
Face detection  presentation slideFace detection  presentation slide
Face detection presentation slide
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection System
 
Facial Expression Recognition System using Deep Convolutional Neural Networks.
Facial Expression Recognition  System using Deep Convolutional Neural Networks.Facial Expression Recognition  System using Deep Convolutional Neural Networks.
Facial Expression Recognition System using Deep Convolutional Neural Networks.
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition ppt
 
Face recognisation system
Face recognisation systemFace recognisation system
Face recognisation system
 
Final year ppt
Final year pptFinal year ppt
Final year ppt
 
Face recognization
Face recognizationFace recognization
Face recognization
 
Face Recognition Technology by Vishal Garg
Face Recognition Technology by Vishal GargFace Recognition Technology by Vishal Garg
Face Recognition Technology by Vishal Garg
 
face detection
face detectionface detection
face detection
 
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
 
Image recognition
Image recognitionImage recognition
Image recognition
 
face recognition
face recognitionface recognition
face recognition
 
Face recognigion system ppt
Face recognigion system pptFace recognigion system ppt
Face recognigion system ppt
 
Face recognition technology - BEST PPT
Face recognition technology - BEST PPTFace recognition technology - BEST PPT
Face recognition technology - BEST PPT
 
Face recognization using artificial nerual network
Face recognization using artificial nerual networkFace recognization using artificial nerual network
Face recognization using artificial nerual network
 
Face detection ppt
Face detection pptFace detection ppt
Face detection ppt
 
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

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

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