SlideShare una empresa de Scribd logo
1 de 25
Real Time Facial
Recognition using
Open CV and
Python
Master’s EMM – Computer Vision Project
👦
Presented By:
• Akash Satamkar
• Krupali Rana
(31672)
(31668)
(using Laptop’s Webcam)
Under guidance of : Prof. Dr. StefanElser.
Introductio
n
• 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
Goal
s
• 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.
3
Software Analysis
• Anaconda IDE
• SpyDer studio with Python 3.7
version
• Open CV libraries
4
Haar Cascade
Classifier
5
▪ Haar feature based classifier is a machine learning
based approach
▪ Detect objects inimages
▪ 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
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.
Positive face set of images
Negative non face set of images
6
Computation of Features
detectMultiscale() Module
- To create rectangle around thefaces
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 intostages
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
• 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 basedon
parameters Radius and Neighbours.
8
• 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.
9
Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b
LBP combined with Histogram to predict faces:
10
Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b
• 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
Some important OpenCV
functions :
1. FaceDetection
function
12
2. Label for training data
function
3. Draw Rectangle
function
4. Put Text
function
5. Train Classifier
function
13
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 Facesin
Real time
Loading the trained data
file and predicting faces
frame by frame and label
them.
14
Flowchart
15
16
Place yourscreenshot here
Testing and Results
Case 1: Single face detection and recognition
17
Place your screenshot here
Case 2: Multiple faces
18
Place your screenshot here
Case 3: Multiple faces with unknown labelledperson
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
• 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.
23
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
😉

Más contenido relacionado

Similar a cvpresentation-190812154654 (1).pptx

PROJECT REPORT
PROJECT REPORTPROJECT REPORT
PROJECT REPORT
pmm330
 
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
ijtsrd
 

Similar a cvpresentation-190812154654 (1).pptx (20)

Blind Source Camera Identification
Blind Source Camera Identification Blind Source Camera Identification
Blind Source Camera Identification
 
[DL輪読会]ClearGrasp
[DL輪読会]ClearGrasp[DL輪読会]ClearGrasp
[DL輪読会]ClearGrasp
 
Learning with Relative Attributes
Learning with Relative AttributesLearning with Relative Attributes
Learning with Relative Attributes
 
Final year ppt
Final year pptFinal year ppt
Final year ppt
 
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
 
Automated_attendance_system_project.pptx
Automated_attendance_system_project.pptxAutomated_attendance_system_project.pptx
Automated_attendance_system_project.pptx
 
Makine Öğrenmesi ile Görüntü Tanıma | Image Recognition using Machine Learning
Makine Öğrenmesi ile Görüntü Tanıma | Image Recognition using Machine LearningMakine Öğrenmesi ile Görüntü Tanıma | Image Recognition using Machine Learning
Makine Öğrenmesi ile Görüntü Tanıma | Image Recognition using Machine Learning
 
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
 
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
 
Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.ppt
 
Review A DCNN APPROACH FOR REAL TIME UNCONSTRAINED FACE.pptx
Review A DCNN APPROACH FOR REAL TIME UNCONSTRAINED FACE.pptxReview A DCNN APPROACH FOR REAL TIME UNCONSTRAINED FACE.pptx
Review A DCNN APPROACH FOR REAL TIME UNCONSTRAINED FACE.pptx
 
PROJECT REPORT
PROJECT REPORTPROJECT REPORT
PROJECT REPORT
 
Bangla Handwritten Digit Recognition Report.pdf
Bangla Handwritten Digit Recognition  Report.pdfBangla Handwritten Digit Recognition  Report.pdf
Bangla Handwritten Digit Recognition Report.pdf
 
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
 
A study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithmsA study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithms
 
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
 
neuralAC
neuralACneuralAC
neuralAC
 
Facial Emotion Recognition: A Deep Learning approach
Facial Emotion Recognition: A Deep Learning approachFacial Emotion Recognition: A Deep Learning approach
Facial Emotion Recognition: A Deep Learning approach
 
Ijcatr04041016
Ijcatr04041016Ijcatr04041016
Ijcatr04041016
 
Object detection presentation
Object detection presentationObject detection presentation
Object detection presentation
 

Último

Call Girls in Sarita Vihar Delhi Just Call 👉👉9873777170 Independent Female ...
Call Girls in  Sarita Vihar Delhi Just Call 👉👉9873777170  Independent Female ...Call Girls in  Sarita Vihar Delhi Just Call 👉👉9873777170  Independent Female ...
Call Girls in Sarita Vihar Delhi Just Call 👉👉9873777170 Independent Female ...
adilkhan87451
 
VIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls In datia Escorts ☎️7427069034 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In datia Escorts ☎️7427069034  🔝 💃 Enjoy 24/7 Escort Service Enjoy...Call Girls In datia Escorts ☎️7427069034  🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In datia Escorts ☎️7427069034 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
nehasharma67844
 

Último (20)

Finance strategies for adaptation. Presentation for CANCC
Finance strategies for adaptation. Presentation for CANCCFinance strategies for adaptation. Presentation for CANCC
Finance strategies for adaptation. Presentation for CANCC
 
The U.S. Budget and Economic Outlook (Presentation)
The U.S. Budget and Economic Outlook (Presentation)The U.S. Budget and Economic Outlook (Presentation)
The U.S. Budget and Economic Outlook (Presentation)
 
Call Girls in Sarita Vihar Delhi Just Call 👉👉9873777170 Independent Female ...
Call Girls in  Sarita Vihar Delhi Just Call 👉👉9873777170  Independent Female ...Call Girls in  Sarita Vihar Delhi Just Call 👉👉9873777170  Independent Female ...
Call Girls in Sarita Vihar Delhi Just Call 👉👉9873777170 Independent Female ...
 
Call Girls Chakan Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chakan Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chakan Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chakan Call Me 7737669865 Budget Friendly No Advance Booking
 
World Press Freedom Day 2024; May 3rd - Poster
World Press Freedom Day 2024; May 3rd - PosterWorld Press Freedom Day 2024; May 3rd - Poster
World Press Freedom Day 2024; May 3rd - Poster
 
SMART BANGLADESH I PPTX I SLIDE IShovan Prita Paul.pptx
SMART BANGLADESH  I    PPTX   I    SLIDE   IShovan Prita Paul.pptxSMART BANGLADESH  I    PPTX   I    SLIDE   IShovan Prita Paul.pptx
SMART BANGLADESH I PPTX I SLIDE IShovan Prita Paul.pptx
 
Election 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdfElection 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdf
 
Financing strategies for adaptation. Presentation for CANCC
Financing strategies for adaptation. Presentation for CANCCFinancing strategies for adaptation. Presentation for CANCC
Financing strategies for adaptation. Presentation for CANCC
 
celebrity 💋 Agra Escorts Just Dail 8250092165 service available anytime 24 hour
celebrity 💋 Agra Escorts Just Dail 8250092165 service available anytime 24 hourcelebrity 💋 Agra Escorts Just Dail 8250092165 service available anytime 24 hour
celebrity 💋 Agra Escorts Just Dail 8250092165 service available anytime 24 hour
 
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
 
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
 
VIP Model Call Girls Shikrapur ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Shikrapur ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Shikrapur ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Shikrapur ( Pune ) Call ON 8005736733 Starting From 5K t...
 
2024: The FAR, Federal Acquisition Regulations, Part 30
2024: The FAR, Federal Acquisition Regulations, Part 302024: The FAR, Federal Acquisition Regulations, Part 30
2024: The FAR, Federal Acquisition Regulations, Part 30
 
VIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Agra 7001035870 Whatsapp Number, 24/07 Booking
 
Pimple Gurav ) Call Girls Service Pune | 8005736733 Independent Escorts & Dat...
Pimple Gurav ) Call Girls Service Pune | 8005736733 Independent Escorts & Dat...Pimple Gurav ) Call Girls Service Pune | 8005736733 Independent Escorts & Dat...
Pimple Gurav ) Call Girls Service Pune | 8005736733 Independent Escorts & Dat...
 
celebrity 💋 Patna Escorts Just Dail 8250092165 service available anytime 24 hour
celebrity 💋 Patna Escorts Just Dail 8250092165 service available anytime 24 hourcelebrity 💋 Patna Escorts Just Dail 8250092165 service available anytime 24 hour
celebrity 💋 Patna Escorts Just Dail 8250092165 service available anytime 24 hour
 
Junnar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Junnar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Junnar ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Junnar ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls In datia Escorts ☎️7427069034 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In datia Escorts ☎️7427069034  🔝 💃 Enjoy 24/7 Escort Service Enjoy...Call Girls In datia Escorts ☎️7427069034  🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In datia Escorts ☎️7427069034 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
 
2024: The FAR, Federal Acquisition Regulations, Part 31
2024: The FAR, Federal Acquisition Regulations, Part 312024: The FAR, Federal Acquisition Regulations, Part 31
2024: The FAR, Federal Acquisition Regulations, Part 31
 

cvpresentation-190812154654 (1).pptx

  • 1. Real Time Facial Recognition using Open CV and Python Master’s EMM – Computer Vision Project 👦 Presented By: • Akash Satamkar • Krupali Rana (31672) (31668) (using Laptop’s Webcam) Under guidance of : Prof. Dr. StefanElser.
  • 2. Introductio n • 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. Goal s • 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. 3
  • 4. Software Analysis • Anaconda IDE • SpyDer studio with Python 3.7 version • Open CV libraries 4
  • 5. Haar Cascade Classifier 5 ▪ Haar feature based classifier is a machine learning based approach ▪ Detect objects inimages ▪ 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
  • 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. Positive face set of images Negative non face set of images 6
  • 7. Computation of Features detectMultiscale() Module - To create rectangle around thefaces 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 intostages 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 • 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 basedon parameters Radius and Neighbours. 8
  • 9. • 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. 9 Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b
  • 10. LBP combined with Histogram to predict faces: 10 Image Reference : https://towardsdatascience.com/face-recognition-how-lbph-works-90ec258c3d6b • 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. Some important OpenCV functions : 1. FaceDetection function 12 2. Label for training data function
  • 13. 3. Draw Rectangle function 4. Put Text function 5. Train Classifier function 13
  • 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 Facesin Real time Loading the trained data file and predicting faces frame by frame and label them. 14
  • 16. 16
  • 17. Place yourscreenshot here Testing and Results Case 1: Single face detection and recognition 17
  • 18. Place your screenshot here Case 2: Multiple faces 18
  • 19. Place your screenshot here Case 3: Multiple faces with unknown labelledperson 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 • 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. 23
  • 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