SlideShare a Scribd company logo
1 of 24
Download to read offline
Under the guidance
of
Prof. Govind Sharma
Dheeraj Sachan
Y9198
Aim of the project
 To detect all the faces in a given RGB image
 Match them one by one with the faces present in the
database
 If the detected face matches closely with a face present
in the database then it is classified as a recognized face
 If a face can not be recognized , then add the face to
the existing database so that it can be recognized next
time
Face recognition using Eigenfaces
 Suppose Γ is a 𝑁2 X 1 vector, corresponding to an NxN face
image I
 Problems arise when performing recognition in a high-
dimensional space
 The idea is to represent G into a low-dimensional space
Computation of the eigenfaces
 1- Obtain face images I1, I2, ..., IM (training faces)
the face images must be centered and of the same size
 2- Represent every image Ii(NXN)as a vector Γi(𝑁2X1)
 3- Compute the average face vector Ψ
Ψ= 1/𝑀( Γ𝑖 )∞
𝑖=1
 4-Subtract the mean face: Φi = Γi -Ψ
 5- Compute the covariance matrix C
 6-Compute the eigenvectors ui of 𝐴𝐴 𝑇
The matrix 𝐴𝐴 𝑇
is very large(𝑁2
X𝑁2
) so it is not
practical to compute its eigenvectors
 6.1- Consider the matrix 𝐴 𝑇
𝐴 (MxM matrix)
 6.2- Compute the eigenvectors vi of 𝐴 𝑇
𝐴
𝐴 𝑇 𝐴 vi =μi vi
 6.3- 𝐴𝐴 𝑇 and 𝐴 𝑇 𝐴 have the same eigenvalues and their
eigenvectors are related as follows: ui = Avi
 6.4-Compute the M best eigenvectors of 𝐴𝐴 𝑇
: ui = Avi
(normalize ui such that ||ui|| = 1)
 7-Keep only K eigenvectors (corresponding to the K
largest eigenvalues)
 Training faces
 Mean face
Representing faces onto this basis
 Each face (minus the mean) Φi=Γi-Ψ in the training
set can be represented as a linear combination of the
best K eigenvectors:
Φi= 𝑤𝑗 𝑢𝑗𝑘
𝑗=1 , (wj = 𝑢𝑗 𝑇Φi )
uj ’s are the ‘eigenfaces’
 Each normalized training face Φi is represented in this
basis by a vector:
Face Recognition Using Eigenfaces
 Given an unknown face image Γ
(centered and of the same size like the training faces)
 1: Normalize Γ: Φ = Γ-Ψ
 2: Project on the eigenspace
Φ= 𝑤𝑗 𝑢𝑗𝑘
𝑗=1 , (wj = 𝑢𝑗 𝑇Φ)
 3: Represent Φ as:
 4: Find er = minl ||W-Wl||
er is the minimum euclidean distance between
weights vector of unknown image and its best
matching counterpart in image database
 5: If er < Tr ( threshold ) , then G is recognized as face l
from the training set
Result 1
Time taken = 0.5966 S
Result 2
Result 3
Face detection from RGB image
Approach
 Color Segmentation
 False hit removal
 Template matching
 Recognition of Detected faces with training
images
Color Segmentation
 The aim of color segmentation is to separate out skin
regions from non skin regions in RGB image
 Use Gray World Assumption to get color balanced RGB
image
 Convert RGB image into YCbCr image
 The equation for transforming from RGB to YCbCr
Gray World Assumption
 It states that for a typical scene, the average intensity
of the red, green, and blue channels should be equal
 Let an image I(x,y) has size M x N, where x and y
denote the indices of the pixel position.
 Ir(x,y), Ig(x,y) and Ib(x,y) denote the red,green, and
blue channels of the image respectively
 Compute
𝑹 𝒂𝒗𝒈 =
𝟏
𝑴𝑵
𝑰 𝒓(𝒙, 𝒚)
𝑵
𝒚=𝟏
𝑴
𝒙=𝟏
𝑮 𝒂𝒗𝒈 =
𝟏
𝑴𝑵
𝑰 𝒈(𝒙, 𝒚)
𝑵
𝒚=𝟏
𝑴
𝒙=𝟏
𝑩 𝒂𝒗𝒈 =
𝟏
𝑴𝑵
𝑰 𝒃(𝒙, 𝒚)
𝑵
𝒚=𝟏
𝑴
𝒙=𝟏
 If the three values are identical, the image already
satisfies the gray world assumption
 If the three values are not identical we keep the green
channel unchanged, and define the gain for the red
and blue channels
α= 𝐺 𝑎𝑣𝑔/𝑅 𝑎𝑣𝑔 and β = 𝐺 𝑎𝑣𝑔/𝐵𝑎𝑣𝑔
 Adjust the Red and Blue pixels by
𝐼𝑟(𝑥, 𝑦)= α𝐼𝑟(𝑥, 𝑦) and 𝐼 𝑏(𝑥, 𝑦)= β𝐼 𝑏 𝑥, 𝑦
Normal RGB image
Color Balanced RGB Image
Skin segmentation using YCbCr
 Convert color balanced RGB image into YCbCr color
space
 The pixels belonging to following range can be
classified as skin pixels
77<=Cb<=127 and
133<=Cr<=173
 The skin segmentation gives a binary image
 White pixels denote skin region
 Black pixels denote non-skin region
YCbCr image
Binary Image after skin segmentation
False Hit Removal
 In the binary image fill the black holes
present inside the white skin regions
 Then check the aspect ratio for the regions
aspect ratio=width/height
 For face (0.4<=aspect ratio <= 1 )
 Regions not satisfying above conditions
are not considered
Original image
False Hit Removal
Skin segmented
image
Filled Image False detections Result after false
hit removal
Recognition example
Time taken=3.6449 S
for all the processes
Work to be done in next semester
 Implement template matching for face detection after
skin segmentation
 Study Viola–Jones object detection framework
- Slow but accurate algorithm
- Speed can be increased if used in the skin segmented
image
 Implement face recognition via sparse representation
and compare its accuracy with current algorithm used
BTP Presentation

More Related Content

Similar to BTP Presentation

Eigenface For Face Recognition
Eigenface For Face RecognitionEigenface For Face Recognition
Eigenface For Face RecognitionMinh Tran
 
Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...
Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...
Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...ijcisjournal
 
Component-Based Ethnicity Identification from Facial Images.pdf
Component-Based Ethnicity Identification from Facial Images.pdfComponent-Based Ethnicity Identification from Facial Images.pdf
Component-Based Ethnicity Identification from Facial Images.pdfnadia abd
 
Face Recognition using PCA-Principal Component Analysis using MATLAB
Face Recognition using PCA-Principal Component Analysis using MATLABFace Recognition using PCA-Principal Component Analysis using MATLAB
Face Recognition using PCA-Principal Component Analysis using MATLABSindhi Madhuri
 
Presentation on Face Recognition Based on 3D Shape Estimation
Presentation on Face Recognition Based on 3D Shape EstimationPresentation on Face Recognition Based on 3D Shape Estimation
Presentation on Face Recognition Based on 3D Shape EstimationRapidAcademy
 
Variational Autoencoders For Image Generation
Variational Autoencoders For Image GenerationVariational Autoencoders For Image Generation
Variational Autoencoders For Image GenerationJason Anderson
 
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...IJMER
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...IJSRD
 
A Hybrid SVD Method Using Interpolation Algorithms for Image Compression
A Hybrid SVD Method Using Interpolation Algorithms for Image CompressionA Hybrid SVD Method Using Interpolation Algorithms for Image Compression
A Hybrid SVD Method Using Interpolation Algorithms for Image CompressionCSCJournals
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...Shahbaz Alam
 
Sample Lesson Plan for College Algebra
Sample Lesson Plan for College Algebra Sample Lesson Plan for College Algebra
Sample Lesson Plan for College Algebra Tariqul Islam
 
A Tutorial On Ip 1
A Tutorial On Ip 1A Tutorial On Ip 1
A Tutorial On Ip 1ankuredkie
 

Similar to BTP Presentation (20)

Face Recognition
Face RecognitionFace Recognition
Face Recognition
 
Lec14 eigenface and fisherface
Lec14 eigenface and fisherfaceLec14 eigenface and fisherface
Lec14 eigenface and fisherface
 
Eigenface For Face Recognition
Eigenface For Face RecognitionEigenface For Face Recognition
Eigenface For Face Recognition
 
Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...
Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...
Content Based Image Retrieval Using Gray Level Co-Occurance Matrix with SVD a...
 
Component-Based Ethnicity Identification from Facial Images.pdf
Component-Based Ethnicity Identification from Facial Images.pdfComponent-Based Ethnicity Identification from Facial Images.pdf
Component-Based Ethnicity Identification from Facial Images.pdf
 
20100822 computervision veksler
20100822 computervision veksler20100822 computervision veksler
20100822 computervision veksler
 
Face recognition using PCA
Face recognition using PCAFace recognition using PCA
Face recognition using PCA
 
Face Recognition using PCA-Principal Component Analysis using MATLAB
Face Recognition using PCA-Principal Component Analysis using MATLABFace Recognition using PCA-Principal Component Analysis using MATLAB
Face Recognition using PCA-Principal Component Analysis using MATLAB
 
Presentation on Face Recognition Based on 3D Shape Estimation
Presentation on Face Recognition Based on 3D Shape EstimationPresentation on Face Recognition Based on 3D Shape Estimation
Presentation on Face Recognition Based on 3D Shape Estimation
 
D046022629
D046022629D046022629
D046022629
 
Variational Autoencoders For Image Generation
Variational Autoencoders For Image GenerationVariational Autoencoders For Image Generation
Variational Autoencoders For Image Generation
 
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
 
A Hybrid SVD Method Using Interpolation Algorithms for Image Compression
A Hybrid SVD Method Using Interpolation Algorithms for Image CompressionA Hybrid SVD Method Using Interpolation Algorithms for Image Compression
A Hybrid SVD Method Using Interpolation Algorithms for Image Compression
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
 
Ijcatr04041016
Ijcatr04041016Ijcatr04041016
Ijcatr04041016
 
Sample Lesson Plan for College Algebra
Sample Lesson Plan for College Algebra Sample Lesson Plan for College Algebra
Sample Lesson Plan for College Algebra
 
C1803011419
C1803011419C1803011419
C1803011419
 
Project 2
Project 2Project 2
Project 2
 
A Tutorial On Ip 1
A Tutorial On Ip 1A Tutorial On Ip 1
A Tutorial On Ip 1
 

BTP Presentation

  • 1. Under the guidance of Prof. Govind Sharma Dheeraj Sachan Y9198
  • 2. Aim of the project  To detect all the faces in a given RGB image  Match them one by one with the faces present in the database  If the detected face matches closely with a face present in the database then it is classified as a recognized face  If a face can not be recognized , then add the face to the existing database so that it can be recognized next time
  • 3. Face recognition using Eigenfaces  Suppose Γ is a 𝑁2 X 1 vector, corresponding to an NxN face image I  Problems arise when performing recognition in a high- dimensional space  The idea is to represent G into a low-dimensional space
  • 4. Computation of the eigenfaces  1- Obtain face images I1, I2, ..., IM (training faces) the face images must be centered and of the same size  2- Represent every image Ii(NXN)as a vector Γi(𝑁2X1)  3- Compute the average face vector Ψ Ψ= 1/𝑀( Γ𝑖 )∞ 𝑖=1  4-Subtract the mean face: Φi = Γi -Ψ  5- Compute the covariance matrix C
  • 5.  6-Compute the eigenvectors ui of 𝐴𝐴 𝑇 The matrix 𝐴𝐴 𝑇 is very large(𝑁2 X𝑁2 ) so it is not practical to compute its eigenvectors  6.1- Consider the matrix 𝐴 𝑇 𝐴 (MxM matrix)  6.2- Compute the eigenvectors vi of 𝐴 𝑇 𝐴 𝐴 𝑇 𝐴 vi =μi vi  6.3- 𝐴𝐴 𝑇 and 𝐴 𝑇 𝐴 have the same eigenvalues and their eigenvectors are related as follows: ui = Avi  6.4-Compute the M best eigenvectors of 𝐴𝐴 𝑇 : ui = Avi (normalize ui such that ||ui|| = 1)  7-Keep only K eigenvectors (corresponding to the K largest eigenvalues)
  • 7. Representing faces onto this basis  Each face (minus the mean) Φi=Γi-Ψ in the training set can be represented as a linear combination of the best K eigenvectors: Φi= 𝑤𝑗 𝑢𝑗𝑘 𝑗=1 , (wj = 𝑢𝑗 𝑇Φi ) uj ’s are the ‘eigenfaces’  Each normalized training face Φi is represented in this basis by a vector:
  • 8. Face Recognition Using Eigenfaces  Given an unknown face image Γ (centered and of the same size like the training faces)  1: Normalize Γ: Φ = Γ-Ψ  2: Project on the eigenspace Φ= 𝑤𝑗 𝑢𝑗𝑘 𝑗=1 , (wj = 𝑢𝑗 𝑇Φ)  3: Represent Φ as:
  • 9.  4: Find er = minl ||W-Wl|| er is the minimum euclidean distance between weights vector of unknown image and its best matching counterpart in image database  5: If er < Tr ( threshold ) , then G is recognized as face l from the training set
  • 10. Result 1 Time taken = 0.5966 S
  • 13. Face detection from RGB image Approach  Color Segmentation  False hit removal  Template matching  Recognition of Detected faces with training images
  • 14. Color Segmentation  The aim of color segmentation is to separate out skin regions from non skin regions in RGB image  Use Gray World Assumption to get color balanced RGB image  Convert RGB image into YCbCr image  The equation for transforming from RGB to YCbCr
  • 15. Gray World Assumption  It states that for a typical scene, the average intensity of the red, green, and blue channels should be equal  Let an image I(x,y) has size M x N, where x and y denote the indices of the pixel position.  Ir(x,y), Ig(x,y) and Ib(x,y) denote the red,green, and blue channels of the image respectively  Compute 𝑹 𝒂𝒗𝒈 = 𝟏 𝑴𝑵 𝑰 𝒓(𝒙, 𝒚) 𝑵 𝒚=𝟏 𝑴 𝒙=𝟏 𝑮 𝒂𝒗𝒈 = 𝟏 𝑴𝑵 𝑰 𝒈(𝒙, 𝒚) 𝑵 𝒚=𝟏 𝑴 𝒙=𝟏 𝑩 𝒂𝒗𝒈 = 𝟏 𝑴𝑵 𝑰 𝒃(𝒙, 𝒚) 𝑵 𝒚=𝟏 𝑴 𝒙=𝟏
  • 16.  If the three values are identical, the image already satisfies the gray world assumption  If the three values are not identical we keep the green channel unchanged, and define the gain for the red and blue channels α= 𝐺 𝑎𝑣𝑔/𝑅 𝑎𝑣𝑔 and β = 𝐺 𝑎𝑣𝑔/𝐵𝑎𝑣𝑔  Adjust the Red and Blue pixels by 𝐼𝑟(𝑥, 𝑦)= α𝐼𝑟(𝑥, 𝑦) and 𝐼 𝑏(𝑥, 𝑦)= β𝐼 𝑏 𝑥, 𝑦
  • 17. Normal RGB image Color Balanced RGB Image
  • 18. Skin segmentation using YCbCr  Convert color balanced RGB image into YCbCr color space  The pixels belonging to following range can be classified as skin pixels 77<=Cb<=127 and 133<=Cr<=173  The skin segmentation gives a binary image  White pixels denote skin region  Black pixels denote non-skin region
  • 19. YCbCr image Binary Image after skin segmentation
  • 20. False Hit Removal  In the binary image fill the black holes present inside the white skin regions  Then check the aspect ratio for the regions aspect ratio=width/height  For face (0.4<=aspect ratio <= 1 )  Regions not satisfying above conditions are not considered Original image
  • 21. False Hit Removal Skin segmented image Filled Image False detections Result after false hit removal
  • 22. Recognition example Time taken=3.6449 S for all the processes
  • 23. Work to be done in next semester  Implement template matching for face detection after skin segmentation  Study Viola–Jones object detection framework - Slow but accurate algorithm - Speed can be increased if used in the skin segmented image  Implement face recognition via sparse representation and compare its accuracy with current algorithm used