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 - BEST PPT
Face recognition technology - BEST PPTFace recognition technology - BEST PPT
Face recognition technology - BEST PPTSiddharth Modi
 
Face Detection and Recognition System
Face Detection and Recognition SystemFace Detection and Recognition System
Face Detection and Recognition SystemZara Tariq
 
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
 
Facial recognition technology by vaibhav
Facial recognition technology by vaibhavFacial recognition technology by vaibhav
Facial recognition technology by vaibhavVaibhav P
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition pptSantosh Kumar
 
Face recognization
Face recognizationFace recognization
Face recognizationleenak770
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technologyShubhamLamichane
 
Face recognition Face Identification
Face recognition Face IdentificationFace recognition Face Identification
Face recognition Face IdentificationKalyan Acharjya
 
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
 
Attendance Management System using Face Recognition
Attendance Management System using Face RecognitionAttendance Management System using Face Recognition
Attendance Management System using Face RecognitionNanditaDutta4
 
Project Face Detection
Project Face Detection Project Face Detection
Project Face Detection Abu Saleh Musa
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection SystemAbhiroop Ghatak
 
Face recognization 1
Face recognization 1Face recognization 1
Face recognization 1leenak770
 
Automatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionAutomatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionNikyaa7
 
Face detection presentation slide
Face detection  presentation slideFace detection  presentation slide
Face detection presentation slideSanjoy Dutta
 

What's hot (20)

Face Recognition
Face RecognitionFace Recognition
Face Recognition
 
Face recognition technology - BEST PPT
Face recognition technology - BEST PPTFace recognition technology - BEST PPT
Face recognition technology - BEST PPT
 
Face recognisation system
Face recognisation systemFace recognisation system
Face recognisation system
 
Face Detection and Recognition System
Face Detection and Recognition SystemFace Detection and Recognition System
Face Detection and Recognition 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
 
Facial recognition technology by vaibhav
Facial recognition technology by vaibhavFacial recognition technology by vaibhav
Facial recognition technology by vaibhav
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition ppt
 
Face recognization
Face recognizationFace recognization
Face recognization
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technology
 
Face recognition Face Identification
Face recognition Face IdentificationFace recognition Face Identification
Face recognition Face Identification
 
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.
 
Attendance Management System using Face Recognition
Attendance Management System using Face RecognitionAttendance Management System using Face Recognition
Attendance Management System using Face Recognition
 
Project Face Detection
Project Face Detection Project Face Detection
Project Face Detection
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection System
 
Face Detection
Face DetectionFace Detection
Face Detection
 
Face recognization 1
Face recognization 1Face recognization 1
Face recognization 1
 
Face Recognition Technology by Vishal Garg
Face Recognition Technology by Vishal GargFace Recognition Technology by Vishal Garg
Face Recognition Technology by Vishal Garg
 
Automatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionAutomatic Attendance system using Facial Recognition
Automatic Attendance system using Facial Recognition
 
Final year ppt
Final year pptFinal year ppt
Final year ppt
 
Face detection presentation slide
Face detection  presentation slideFace detection  presentation slide
Face detection presentation slide
 

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

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

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