Question
Write a python code about Eigenfaces and Face Recognition. If I save at least 1024 images in a folder called face on the D drive,
Write a python code about Eigenfaces and Face Recognition.
If I save at least 1024 images in a folder called face on the D drive, please apply this to Python code.
Use PCA (SVD) for gray-scale face images
- find eigenfaces
- show face recognition performance
1. Crop the same image size for face area.
- image size : 32*32 -> 1024 dimension vector (F)
at least 1024 gray images ( N face images)
- More than vector dimension
- Different faces
2. Construct data matrix, A
- Find the mean vector (M) of your collected image vectors (Fs)
- Make the vector space by including the origin
Subtract each face vector with the mean vector Fx - M => ak >k: index of face image vector Make the data matrix, A with the column vector ak A= [ aj a2 an] 1 Two cases of ATA ON 1024 AT II 3. Apply SVD Apply SVD (PCA) to the covariance matrix Find some eigenvectors for the largest singular values. Number of eigenfaces is your choice. Dependent on your training face data SED 201203 13 4. Test face recognition Collect 10 different cropped face images > 5 test images for one face Represent each face images using the eigenfaces Compare the coefficients {C1, C2, "., Cn} for face recognition - M=C te2 +C3 ...ten Mean vector of collected face images 0000, 14 Find the Coefficients inner product of eigenface vector and test face image vector Eigenfaces => orthonormal - M=C1 +c2 +C3 ...te Ck = -M 00000 (inner product of e, and test face image vector) 15 Generate face image using eigenfaces linear combination of eigenface vectors adding the mean vector T 2C1 +0 |t0 ...ten +M 16 Face Recognition Coefficients of eigenfaces => vector {C1, C2,...cn} The coefficients vector is an identity of each face Don't use the approximated face image that is linearly combined by eigenfaces. How to compare the identity of faces . Observe the coefficients for each different face Find dominant/main coefficients to discriminate the different faces Project: Eigenfaces and Face Recognition Use PCA (SVD) for gray-scale face images Find eigenfaces Show face recognition performance 999 ZES
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started