Real-Time Voter Authentication System: An advanced voting solution using barcode scanning and facial recognition to ensure secure and accurate voter verification. The system scans barcodes from IDs and verifies identities through real-time facial recognition, enhancing election security and streamlining the voting process.
- Introduction
- Features
- Project Structure
- Installation
- Setup
- How It Works
- Troubleshooting dlib Installation
- License
- Contact
- Disclaimer
The Real-Time Voter Authentication System is a Python-based application designed to improve the security and efficiency of the voting process. By combining barcode scanning and facial recognition technology, this system ensures that each voter is accurately identified, preventing fraud and enhancing the integrity of elections.
- Barcode Scanning: Utilizes a webcam to scan voter ID barcodes.
- Facial Recognition: Matches the face of the voter with the stored image in the database.
- Database Management: Securely stores voter information, including encrypted barcodes and face images.
- Encryption: Ensures that sensitive voter information is encrypted and protected.
The project contains the following main files:
Voter_verification.py
: Handles barcode scanning, face recognition, and verification.Database_creation.py
: Creates the SQLite database and adds voter data.Key_generation.py
: Generates an encryption key used for securing data.encryption_key.key
: The generated encryption key (not included in the repository for security reasons).voters.db
: The SQLite database containing voter information (generated during runtime).
Ensure that you have the following installed on your system:
- Python 3.x
- pip (Python package installer)
- OpenCV
- face_recognition
- cryptography
- numpy
- pyzbar
Install the required Python libraries using the following command:
pip install opencv-python pyzbar sqlite3 cryptography face_recognition numpy
git clone https://github.com/yourusername/Real-Time-Voter-Authentication-System.git
cd Real-Time-Voter-Authentication-System
pip install -r requirements.txt
-
Before you can create and populate the database, you need to generate an encryption key.
-
Run the Key_generation.py script to create the encryption_key.key file:
python Key_generation.py
This will generate a file named encryption_key.key, which will be used to encrypt sensitive data in the database.
-
Once the encryption key is generated, you can create and populate the database with voter information.
-
Open the Database_creation.py file.
-
Modify the add_voter function call at the end of the script to include actual voter information. Example:
add_voter('John Doe', 'XYZ1234567', 'path_to_image_of_voter.jpg')
Replace 'path_of_the_image_of_voter_card' in Database_creation.py with the actual path of the voter's image.
-
Run the script to create the voters.db SQLite database and add the voter(s):
python Database_creation.py
Now that the database is set up, you can run the voter verification system.
-
Run the Voter_verification.py script:
python Voter_verification.py
-
The system will activate the webcam and start scanning for barcodes.
-
Once a barcode is detected, it will retrieve the corresponding voter information from the database.
-
The system will then attempt to match the face of the voter with the stored image.
-
If the face matches, the voter is authenticated; otherwise, the system will indicate a failed authentication.
- Barcode Scanning: The system uses the cv2 and pyzbar libraries to capture and decode barcodes from voter IDs.
- Face Recognition: The face_recognition library compares the real-time image captured by the webcam with the stored image in the database.
- Database Management: SQLite3 is used to store and manage voter information securely.
- Encryption: Sensitive data, such as barcodes, are encrypted using the cryptography.fernet module before being stored in the database.
-
If you encounter issues installing dlib directly via pip, follow these steps:
-
Download Precompiled Package:
Visit this GitHub repository to download the appropriate dlib package for your Python version.
-
Install Manually:
After downloading the wheel file, navigate to the directory where it is located and run:
pip install dlib-<version>-cp<python_version>-none-win_amd64.whl
Replace and <python_version> with the version and Python version of the downloaded package.
-
Verify Installation: To ensure dlib is installed correctly, run:
import dlib print(dlib.__version__)
-
If issues persist, consult the dlib documentation or seek help in relevant forums for additional support.
This project is licensed under a proprietary license. All rights are reserved by the author.
For more details, see the LICENSE file.
If you have any questions or issues with this project, please contact Faiz-3112 .
This project is protected under copyright law. No part of this project may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the author, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law.
Unauthorized use, reproduction, or distribution of this material is prohibited and may result in severe civil and criminal penalties.