Project Report Template
Project Report Template
INTERNATIONAL UNIVERSITY
Submitted by
Discussion of Results 4
Self-Evaluation 4
References 4
International University 2
School of EE
Experimental Procedure
This code outlines an experimental procedure to implement a Face Recognition System using
Python, OpenCV, and Tkinter for a graphical interface. Below is a description of experimental
setup, equipment, and procedure:
1. Objective
The goal is to develop a system that can:
Capture and save face images for user registration.
Perform face recognition by matching real-time input with saved faces.
Manage image data by removing duplicates or purging all saved images.
International University 3
School of EE
d) Time: a library for handling time-related tasks
- To process with the development of this Verification System, it is required to obtain an Agreement
License from for the use of the Open Source Computer Vision Library. The license can be downloaded
through the link:
https://github.com/kipr/opencv/blob/master/data/haarcascades/haarcascade_frontalface_default.xml
Equipment and Components Used
1. Hardware
Laptop: A system capable of Running Python on Visual Studio Code.
Webcam: Integrated or external webcam for face capture.
2. Software
Python 3.13.1: Programming language for implementing the system
OpenCV: Library for real-time computer vision and image processing.
Tkinter: GUI library in Python for creating user interfaces.
Haar Cascade Classifier: Prer-trained model for face detection, provided by OpenCV.
3. Data Storage
Local directory (dataset): Used to save and manage captured face images.
Experiment Setup
1. Software Environment
Install required Python libraries (cv2, numpy, tkinter) using pip:
pip install opencv-python numpy
2. Directory Structure
Create a directory dataset in the project folder for storing images.
3. Face Detection Model
The Haar Cascade model ( haarcascade_frontalface_default_xml ) is used for
detecting faces in images
Procedure
1. Setup the Application
o Run the script to initialize the GUI application.
o The interface provides buttons for:
Adding a user face.
Verifying a user’s face.
International University 4
School of EE
Managing images (deleting duplicates or purging all).
2. Capture Face Images
o The "Add User" button prompts the user for their name.
o Captures 25 images of the user's face through the webcam and saves them in the
dataset directory.
3. Verify User Face
o The "Verify User" button compares the live webcam feed to saved faces in the
dataset.
o Uses pixel-wise comparisons to match the input face with the stored images.
4. Delete Duplicate Images
Data Collection
Data (face images) is captured via the webcam and saved in JPEG format in the dataset
directory.
Image files are named with the format <name>_<count>.jpg.
International University 5
School of EE
Observations
Face Detection: Real-time detection accuracy depends on lighting and camera quality.
Performance: The system displays FPS (frames per second) to monitor performance
during operation.
Experimental Results
International University 6
School of EE
The provided script is a GUI-based Face Recognition System implemented using Python,
OpenCV, and Tkinter. Below is a detailed breakdown of the outcomes and observations for each
functionality:
1. GUI Functionality
The application GUI provides six core features:
Add User: Captures and saves images of a user's face to a dataset folder.
Verify User: Matches a live camera feed against stored faces in the dataset and identifies
users.
Delete Duplicates: Detects and removes duplicate or similar images from the dataset.
Purge All Images: Deletes all images in the dataset.
Help: Displays an informational dialog explaining how to use the application.
Exit: Safely terminates the application.
2. Face Detection and Image Capture
The application uses Haar Cascade classifiers for face detection.
It captures up to 25 images of a user's face, saving them in a dataset directory named
<username>_<count>.jpg.
3. Face Matching
Captures a live video feed, detects faces, and compares them with saved images in the
dataset using Euclidean distance.
Matches are identified by the filename (e.g., username) of the closest image in the
dataset.
4. Duplicate Detection
The delete duplicates function identifies duplicate images using pixel-wise differences.
Retains the 15 most recent unique images and removes duplicates based on a similarity
threshold.
5. Description of Results
The provided script is a GUI-based Face Recognition System implemented using Python,
OpenCV, and Tkinter. Below is a detailed breakdown of the outcomes and observations for each
functionality:
1. GUI Functionality
The application GUI provides six core features:
Add User: Captures and saves images of a user's face to a dataset folder.
Verify User: Matches a live camera feed against stored faces in the dataset and identifies
users.
Delete Duplicates: Detects and removes duplicate or similar images from the dataset.
International University 7
School of EE
Purge All Images: Deletes all images in the dataset.
Help: Displays an informational dialog explaining how to use the application.
Exit: Safely terminates the application.
Observations:
The GUI is responsive, thanks to the use of threads for computationally intensive tasks.
Decorative elements like the Christmas border improve visual appeal but don't affect
core functionality.
3. Face Matching
Captures a live video feed, detects faces, and compares them with saved images in the
dataset using Euclidean distance.
Matches are identified by the filename (e.g., username) of the closest image in the
dataset.
Observations:
Accuracy: Matching based solely on Euclidean distance between grayscale image pixels
can lead to false positives or errors.
Real-time Results: Displaying FPS (frames per second) on the feed ensures real-time
feedback.
4. Duplicate Detection
The delete duplicates function identifies duplicate images using pixel-wise differences.
Retains the 15 most recent unique images and removes duplicates based on a similarity
threshold.
Observations:
Efficiency: Works well for small datasets but may not scale efficiently with larger
datasets due to its pixel-wise approach.
International University 8
School of EE
Enhancement Opportunity: Incorporating feature-based methods (e.g., embeddings)
could improve detection.
5. Data Management
The purge_all_images function completely clears the dataset, ensuring easy dataset
management.
6. Help and User-Friendliness
A help dialog explains each functionality, making the application beginner friendly.
Informational messages and error handling improve usability.
Discussion of Result
2. GUI Improvements:
o The uploaded code includes basic GUI functionality with options like "Add User"
and "Verify User."
o Recommendation: Add features like duplicate image deletion and dataset
management for better usability.
4. Error Handling:
o The uploaded code lacks comprehensive error handling for situations like missing
Haar Cascade files or failed webcam initialization.
o Recommendation: Add error handling with clear messages for better robustness.
International University 9
School of EE
5. Scalability:
o The current implementation is not designed for large datasets.
6. Application Packaging:
o The code lacks instructions or functionality for creating a standalone executable.
Duplicate Detection:
This functionality is absent in the uploaded code and significantly improves dataset
management.
Comprehensive GUI:
The provided code features a more interactive and user-friendly GUI with buttons
for:
o Adding users.
o Verifying users.
o Deleting duplicates.
Progress Display:
The provided code displays real-time FPS during face detection and matching,
providing feedback on system performance.
International University 10
School of EE
Multithreading:
Dataset Purging:
A "Purge All Images" option is added, allowing users to clear the entire dataset
easily, improving usability.
Help Menu:
Decorative Enhancements:
The provided code includes a "Christmas Border" for visual appeal, which is not
critical but adds a creative touch.
Self-Evaluation
I learned a lot through this project, which not only fueled my curiosity but also promoted my
background knowledge, which played a role in my development. Improve the ability to work
in groups and discuss and recognize problems.
References
[1]OpenCV documentation, https://docs.opencv.org/
[2]Tkinter documentation,
https://docs.python.org/3/library/tkinter.html
[3]TTKBootstrap documentation
https://ttkbootstrap.readthedocs.io/
[4]PyInstalle manual
https://pyinstaller.readthedocs.io/
[5] Tran, M. H. (2024) "Python 101: Face Stream Verification System" [Lecture PDF]
Institution: Ho Chi Minh City International University – HCMIU. Fall 2024.
International University 11
School of EE