Blind Assistance Cap for Visually Impaired
Blind Assistance Cap for Visually Impaired
PROJECT REPORT
1
June 2025
2
DECLARATION
We, Rishiraj Singh, Nitesh Puri, Nikhil Saini, Sajiya Ansari and Mohammed Inam
Fazil hereby declare that the Project Report entitled “Blind Cap Assistance Device for
Blind People,” completed by me under the guidance of Lecturer Sanjay Kumar Meena,
is submitted in partial fulfillment of the requirements for the award of the Diploma in
Computer Science and Engineering at Government Polytechnic College, Bundi.
3
ACKNOWLEDGEMENT
4
ABSTRACT
The primary objective of this project is to develop a Blind Assistance Cap using
ultrasonic sensing technology, powered by an Arduino Nano and programmed in the C
language using the Arduino IDE. The system is designed to aid visually impaired
individuals by detecting nearby obstacles and providing real-time directional alerts through
audio signals.
The wearable device integrates three ultrasonic sensors, strategically positioned on a cap to
cover the left, front, and right directions. These sensors continuously monitor the
surroundings and calculate the distance of objects in their respective paths. When an
obstacle is detected within a specified range, the Arduino Nano triggers a corresponding
buzzer to notify the user through sound. This directional audio feedback allows the user to
understand the obstacle’s position and avoid collisions.
5
TABLE OF CONTENT
LIST OF FIGURES
6
CHAPTER 1
INTRODUCTION
In today's world, technology has become an essential tool for solving real-life challenges,
especially for people with disabilities. One such challenge faced by visually impaired individuals
is safe and independent navigation in unfamiliar environments. Without the ability to see, they
often rely on traditional aids like walking sticks or the help of others. However, these methods
have limitations and may not always detect obstacles at head level or from the sides.
To solve this problem, we have developed a project called the Blind Assistance Cap. This smart
wearable device is designed to help visually impaired individuals detect nearby obstacles using
sensors and receive audio feedback through buzzers. The system is built using an Arduino Nano
microcontroller, three ultrasonic sensors, and buzzers to provide real-time obstacle alerts.
The programming for this project is done in C language using the Arduino IDE. The ultrasonic
sensors measure the distance of objects in front, to the left, and to the right. When any object is
detected within a certain range (e.g., 40 cm), the buzzer corresponding to that direction is
activated, helping the user to sense which side the obstacle is on and avoid it.
This cap is lightweight, low-cost, and easy to use. It does not require an internet connection,
smartphone, or any external devices. The idea is to create a practical, wearable, and affordable
assistive device for those who are blind or have low vision.
There are many advantages to using this project: it gives users greater independence, prevents
accidental collisions, and improves safety and mobility. The cap is especially useful in crowded
or unfamiliar areas where obstacle detection is critical. By combining basic electronics and
embedded programming, our project demonstrates how simple innovations can make a big
difference in real life.
7
CHAPTER 2
LITERATURE SURVEY
In the digital era, artificial intelligence tools have transformed many traditional processes. One
such advancement is the use of facial recognition technology for attendance systems. Face
recognition provides a secure, efficient, and contactless alternative, reducing the risk of proxy
attendance and saving valuable time.
Based on this, our project introduces a Face Attendance System that uses the system’s camera to
capture attendance through facial recognition. We developed this application using technologies
like Python, OpenCV for face detection, MySQL for database management, and PyQt for
designing a user-friendly graphical interface. The system uses the LBPH (Local Binary Pattern
Histogram) Face Recognizer for recognizing faces from a live camera feed, while Haarcascade
classifiers help detect faces within images.
In our system, students are first registered by filling in basic details and capturing images. These
images, stored in a dedicated folder linked to a unique student ID, are used to train a machine
learning model. Attendance is then marked by recognizing faces in real-time, and records are
saved in both the database and Excel files. Our survey concludes that face recognition-based
systems are faster, contactless, accurate, and effectively reduce proxy attendance compared to
traditional methods.
8
CHAPTER 3
AIM AND SCOPE OF THE PROJECT
9
3.2 PROJECT ARCHITECTURE
10
CHAPTER 4
METHODS AND MATERIALS USED
Face Detection:
Face detection was carried out using OpenCV's Haar Cascade Classifier, which detects
human faces from live webcam video streams by identifying patterns and features in
real-time.
Face Recognition:
The system uses the Local Binary Patterns Histogram (LBPH) Face Recognizer model,
which converts facial images into local binary patterns and compares them with the
stored data to identify and authenticate registered students.
Attendance Marking:
Upon successful face recognition, the system automatically marks attendance by storing
the student’s name, ID, date, and time in the database. The system also prevents
duplicate attendance within a single session.
Database Management:
A MySQL database is used for managing student records and attendance logs. It ensures
organized data storage, retrieval, and management.
User Interface Development:
The graphical user interface was developed using PyQt5 to provide a user-friendly
platform for student registration, live attendance capturing, and administrative
controls. For this purpose, we also use Qt Designer software, which is provided by
PyQt.
11
5.3 WORKING EXPLANATION
Registration Page:
This page is designed for registering new students into the system. The user is
required to enter essential student details such as Student ID, Name, Date of Birth,
Email, and other necessary information. After filling in the details, images of the
student can be captured directly via webcam by clicking the Capture button, which
saves multiple face images for training purposes.
Student Table:
Once the images are captured, the user can click the Submit button to store the
student’s data into the Student Table. This data is saved using SQL queries with a
unique Student ID that helps in identifying students during the face recognition
process.
12
Train Model:
After registering students, the system requires training for face recognition. The
captured images are used to train the model using the Local Binary Patterns
Histogram (LBPH) Face Recognizer algorithm. This step enables the system to
recognize and match student faces accurately during attendance marking.
Attendance Page:
In the Attendance Window, the system captures live images through the webcam
and identifies students by matching their facial attributes with the images stored
in the database. If a match is found, the corresponding student’s attendance is
marked for that session.
14
CHAPTER 5
RESULTS AND DISCUSSION
5.1 Results
After successfully developing and testing the project, the system delivered very promising
results. The Face Attendance System was able to detect and recognize registered students’
faces in real-time using the webcam. As soon as a student stood in front of the camera, the
system would identify the face and automatically mark the attendance by saving the
student’s name, ID, date, and time into the database.
During testing, the system achieved an average accuracy of 90-95%, which is quite reliable
for a classroom environment. One of the best features of this system is that it prevents
duplicate attendance in the same session. Once a student’s attendance is marked, it cannot
be recorded again until the next session, ensuring error-free records.
The attendance records were securely stored in the MySQL database, and at the same time,
an Excel file was generated for maintaining offline reports. The Graphical User Interface
(GUI) created using PyQt5 was clean and easy to use. It provided smooth navigation for
student registration, capturing attendance, and handling admin controls.
5.2 Discussion
While working on this project, I realized how artificial intelligence and machine learning
can be applied practically to solve daily problems in educational institutions. By using facial
recognition technology, this system successfully tackled issues like proxy attendance,
manual errors, and time wastage during attendance marking.
For face recognition, I chose the Local Binary Patterns Histogram (LBPH) recognizer
because it works efficiently even with small datasets and is easy to implement. The model
performed well in various conditions, though in cases like poor lighting, background
changes, or face masks, the accuracy slightly dropped — which can be improved in the
future.
This system not only simplified attendance management but also ensured data security and
easy reporting. Features like automatic Excel export and duplicate prevention made it more
reliable for daily classroom use.
However, there’s always room for improvement. In the future, this system can be enhanced
by adding features like:
Face mask detection.
Remote attendance marking for online classes.
SMS or email notifications for absent students.
Further improving the recognition accuracy under challenging conditions.
Attendance can be taken based on the class timetable
Overall, this project helped me gain hands-on experience in implementing AI-based
solutions and proved how technology can bring positive changes in academic management
systems. It was a great learning experience and a practical example of how simple ideas can
turn into smart digital solutions.
15
CHAPTER 6
SUMMARY AND CONCLUSION
SUMMARY
This project aimed to develop a smart, efficient, and contactless Face Attendance System for
educational institutions. Traditional attendance systems often face issues like proxy
attendance, manual errors, and time consumption. To overcome these challenges, this system
uses facial recognition technology to automate the attendance process in a secure and reliable
manner.
The system was designed using Python, OpenCV, PyQt5, MySQL, and the LBPH Face
Recognizer model. It includes different modules such as student registration, model training,
attendance capturing, and database management. Real-time face detection and recognition
was successfully implemented through a webcam, and attendance data was securely stored in
a MySQL database and also exported to Excel files for easy reporting.
During testing, the system showed high accuracy and efficiency, achieving 90-95% face
recognition accuracy in controlled classroom conditions. The project also demonstrated the
practical use of artificial intelligence and machine learning in solving real-world problems.
CONCLUSION
In conclusion, the Face Attendance System successfully provides a modern and reliable
solution for attendance management in educational institutions. The system effectively
eliminates issues like proxy attendance and manual errors, while also saving valuable
classroom time.
By integrating AI-based face recognition with database management and user-friendly
interfaces, this project contributes to the digital transformation of academic processes.
Although the system performed well, certain limitations like varying lighting conditions and
face masks slightly affected accuracy, which opens scope for future enhancements.
Overall, this project was a valuable learning experience, offering hands-on exposure to
machine learning, Python programming, database handling, and GUI development. It reflects
how technology can be practically applied to improve everyday processes in education and
beyond.
16
APPENDIX
A: SOURCE CODE
A.1 [Link] (GUI OF MAIN HOME PAGE)
from PyQt5 import
QtWidgets,QtCore from MPH
import PageWindow
from DashBoard import
Dashboard from registration
import Registration_
from take_attendance import
T_attendace from settings import
Settings
from about_us import About
from Trained_images import
t_images from Home import
HomePage
class
Project([Link])
: def init (self):
super(Project,self). init ()
self.stacked_w=[Link]
() [Link](self.stacked_w)
[Link]={}
self.register_page(Dashboard(),'Dash')
self.register_page(Registration_(),'regi')
self.register_page(T_attendace(),'t_attendac
e') self.register_page(About(),'about')
self.register_page(Settings(),'settings')
self.register_page(t_images(),'t_images')
self.register_page(HomePage(),'home')
[Link]('home')
def register_page(self,page,name):
[Link][name]=page
self.stacked_w.addWidget(pa
ge) if
isinstance(page,PageWindow
):
page.go_to_signal.connect([Link]
to) @[Link](str)
def goto(self,name):
if name in [Link]:
self.stacked_w.setCurrentWidget([Link][n
ame])
17
A.2 take_attendance.py
class
T_attendace(PageWindow):
def init (self):
super(T_attendace, self). init () [Link](r"D:\PyQt\
take_attendance.ui", self)
[Link] = None
[Link] = [Link]()
[Link](self.update_frame)
[Link] = [Link]()
[Link](r"D:\python projects\Face_detection\reco\
[Link]")
[Link] = self.dash_b
self.Register_new.mousePressEvent = self.goto_Regi
[Link] = self.goto_About
[Link] = self.goto_settings
[Link] = self.goto_t_images
self.Home_page.mousePressEvent=self.goto_home
[Link](self.start_manually)
self.stop_b.[Link](self.stop_capturing)
self.save_attendance.[Link](self.save_in_excel)
self.Reset_c.[Link](self.reset_capture)
self.Home_B.[Link](self.goto_home)
#
self.s_table=[Link](self.student_tab
le) def reset_capture(self):
[Link]=None
self.student_table.setRowCount(0)
def start_manually(self):
18
[Link] = [Link](0)
[Link](30)
19
def update_frame(self):
ret, img =
[Link]() if not
ret:
return
gray = [Link](img,
cv2.COLOR_BGR2GRAY) faces =
[Link](gray,1.3,9)
id_, conf =
[Link](crop) # if
conf>8:
#
id_=0
print(id_
)
print(co
nf)
[Link] = self.get_profile(id_)
color = [Link](img,
cv2.COLOR_BGR2RGB) h, w, ch = [Link]
bytes_per_line = ch * w
qt_image = QImage([Link], w, h, bytes_per_line,
QImage.Format_RGB888)
self.camera_w.setPixmap([Link](qt_image))
if hasattr(self, 'profile') and [Link] is not
None:
[Link]=[Link]().strftime("%d-
%m-%Y")
self.student_table.setRowCount(3)
self.student_table.setItem(0,0,[Link](str(self.dict_st['id'])))
self.student_table.setItem(0,1,[Link](self.dict_st['name']))
self.student_table.setItem(0,2,[Link](self.dict_st['gender']))
self.student_table.setItem(0,3,[Link](self.dict_st['dob']))
self.student_table.setItem(0,4,[Link](self.dict_st['branch']))
self.student_table.setItem(0,5,[Link](self.dict_st['class']))
self.student_table.setItem(0,6,[Link](self.dict_st['semester']))
20
self.student_table.setItem(0,7,[Link](self.dict_st['email']))
self.student_table.setItem(0,8,[Link](str(self.dict_st['date'])))
21
def
stop_capturing(self
): if
[Link]()
:
[Link]()
if [Link] and [Link]():
[Link]()
self.camera_w.clear
() def
get_profile(self,id_):
conn=[Link](host="localhost",
user="root",password="admin123",database="gpc")
[Link]()
return profile
def save_in_excel(self):
conn =
[Link](
host="localhost",
user="root",
password="admin123",
database="gpc"
)
print("4")
cursor = [Link]()
22
[Link](insert_attendance, (
self.dict_st['id'], self.dict_st['name'],
self.dict_st['gender'], dob_date, self.dict_st['branch'],
self.dict_st['class'], self.dict_st['semester'],
self.dict_st['email'], date
))
[Link]() # Don't forget to commit
changes! print("6")
23
message_box = [Link]()
message_box.setIcon([Link])
message_box.setWindowTitle("Information")
message_box.setText("Attendance successfully Saved")
message_box.setStandardButtons([Link])
message_box.exec_()
else:
error_box = [Link]()
error_box.setIcon([Link])
error_box.setWindowTitle("Check Box Error")
error_box.setText("Please! check the CheckBox ")
error_box.setStandardButtons([Link].
Ok) error_box.exec_()
else:
error_box = [Link]()
error_box.setIcon([Link])
error_box.setWindowTitle("Capture Error")
error_box.setText("Please! Capture attendance first")
error_box.setStandardButtons([Link].O
k) error_box.exec_()
def goto_settings(self,
event):
self.go_to('settings')
def goto_t_images(self,
event):
self.go_to('t_images')
24
A.3 [Link]
from MPH import PageWindow
from PyQt5 import
QtWidgets,uic
from [Link] import
QImage,QPixmap import sys
import numpy as
np import os
import sqlite3 as sq
import cv2
import [Link]
class
Registration_(PageWindow):
def init (self):
super(Registration_,self). init () [Link](r"D:\PyQt\
[Link]",self)
[Link]=self.dash_b
[Link]=self.goto_attendace
[Link]=self.goto_About
[Link]=self.goto_settings
[Link]=self.goto_t_images
self.Home_page.mousePressEvent=self.goto_home
self.Home_B.[Link](self.goto_home)
self.image_label = [Link]([Link],
"camera_feed") #branch selection
self.branch_s=[Link]([Link],"Branch
_s")
#class selection
self.class_s=[Link]([Link],"class_s")
#semester selection
self.semester_s=[Link]([Link],"semester_s")
self.s_gender=[Link]([Link],"s_gender")
self.camera_feed = [Link]([Link], "camera_feed")
self.capture_b.[Link](self.insert_update)
self.reset_b.[Link](self.reset_form)
def reset_form(self):
self.branch_s.setCurrentIndex(0)
self.class_s.setCurrentIndex(0)
self.semester_s.setCurrentIndex(0)
self.s_gender.setCurrentIndex(0)
self.student_id.clear()
self.student_name.clear()
self.email_id.clear()
25
def insert_update(self):
self.branch_s=self.branch_s.currentText()
self.class_s=self.class_s.currentText()
self.semester_s=self.semester_s.currentText()
[Link]=self.student_id.text()
[Link]=self.student_name.text()
[Link]=self.email_id.text()
self.s_gender=self.s_gender.currentText()
[Link]=self.Date_of_birth.text()
conn=[Link](host="localhost",
user="root",password="admin123",database="gpc")
cursor = [Link]()
cmd="SELECT * FROM students WHERE id = %s"
[Link](cmd, ([Link],))
print("Enter kr gya")
record =
[Link]() if
record:
print("Record exists, updating...")
update_query = "UPDATE students SET name=%s, gender=%s, dob=%s,
email=%s, branch=%s, class_=%s, semester=%s WHERE id=%s"
[Link](update_query, ([Link], self.s_gender, [Link],
[Link], self.branch_s, self.class_s, self.semester_s, [Link]))
else:
print("No record found, inserting...")
insert_query = "INSERT INTO students (id, name, email, gender, dob, branch,
class_, semester) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)"
[Link](insert_query, ([Link], [Link], [Link], self.s_gender,
[Link], self.branch_s, self.class_s, self.semester_s))
[Link]()
[Link]()
[Link]()
fd=[Link](r"C:\Users\lappy garage\Flask code\
face_attendance\haarcascade_frontalface_default.xml")
cam=[Link]
(0) samplenum=0
while True:
ret,img=[Link]()
img=[Link](img,(500,291))
gray=[Link](img,cv2.COLOR_BGR2GRAY)
faces=[Link](gray,scaleFactor=1.3,minNeigh
bors=3) # reg=Registraion()
for (x,y,w,h) in faces:
samplenum=samplenum+1 file=r"C:\
Users\lappy garage\Flask
code\face_attendance\Dataset\image."+str([Link])+"."+str(samplenum)
+".jpg" crop=gray[y:y+h,x:x+w]
gray1=[Link](crop,(150,150))
[Link](file,gray1)
[Link](img,(x,y),(x+w,y+h),
(0,255,0),2)
[Link](img,str(samplenum-
1),(50,50),cv2.FONT_HERSHEY_COMPLEX,1,(0,0,255),2)
color=[Link](img,cv2.COLOR_BGR2RGB)
H,W,ch=[Link]
bytes_per_line = ch
26
*W
qt_image = QImage([Link], W, H, bytes_per_line, QImage.Format_RGB888)
27
self.image_label.setPixmap([Link](qt_image))
[Link](1)
if samplenum>30:
error_box = [Link]()
error_box.setIcon([Link])
error_box.setWindowTitle("Information")
error_box.setText("Student successfully Registerd")
error_box.setStandardButtons([Link].
Ok) error_box.exec_()
self.camera_feed.clear()
break
[Link]()
[Link]
()
def dash_b(self,event):
self.go_to('Dash')
def
goto_attendace(self,event
): self.go_to('t_attendace')
def goto_About(self,event):
self.go_to('about')
def
goto_settings(self,event):
self.go_to('settings')
def
goto_t_images(self,event):
self.go_to('t_images')
def goto_home(self,event):
self.go_to('home')
28
A.4 trained_images.py
from MPH import PageWindow
from PyQt5 import
QtWidgets,uic import sys
import os
from PyQt5 import QtWidgets, uic,
QtCore,QtGui from [Link] import
QLabel, QGridLayout from [Link] import
QPixmap,QImage
import cv2
from PIL import
Image import
numpy as np
class
t_images(PageWindow):
def init (self):
super(t_images,self). init () [Link](r"D:\PyQt\
Trained_images.ui",self)
[Link]=self.dash_b
self.Register_new.mousePressEvent=self.goto_Regi
[Link]=self.goto_atten
dace [Link]=self.goto_About
[Link]=self.goto_settings
self.Home_page.mousePressEvent=self.goto_home
[Link] = [Link](QGridLayout,
"gridLayout")
[Link] = [Link]([Link],
"refreshButton") [Link] =
[Link]([Link], "homeButton") self.model_train
= [Link]([Link], "model_t")
# Initial load
self.load_images()
def
load_images(self)
: # Clear old
widgets
while [Link]():
item = [Link](0)
widget = [Link]()
if widget is not None:
[Link]()
if not [Link](image_folder):
[Link](image_folder)
30
label = QLabel()
[Link](pixmap)
[Link]("border: 1px solid #ccc; padding: 5px;")
col +=
1 if col
> 5:
col = 0
row += 1
def model_training(self):
rc=[Link]()
path=r"C:\Users\lappy garage\Flask code\face_attendance\Dataset"
images_path=[[Link](path,f) for f in [Link](path)]
faces=[]
ids=[]
for single_image_path in images_path:
faceImage=[Link](single_image_path).convert('L')
faceNp=[Link](faceImage,np.uint8)
id=int([Link](single_image_path)[-1].split(".")[1])
[Link](faceNp)
[Link](id)
[Link]("trainnig",faceNp)
[Link](20)
def model_train(faces,id):
print(type(id))
ids=[Link](id)
[Link](faces,ids)
[Link](r"D:\python projects\Face_detection\reco\[Link]")
[Link]()
model_train(faces,id
s) def
dash_b(self,event):
self.go_to('Dash')
def
goto_attendace(self,event
): self.go_to('t_attendace')
def goto_Regi(self,event):
self.go_to('regi')
def goto_About(self,event):
self.go_to('about')
def
goto_settings(self,event):
self.go_to('settings')
def goto_home(self,event):
self.go_to('home')
31
B: DATABASE SCREENSHOTS
32
D: GUI FILES
E: OUTPUT
33
Image 9 - Attendance Page
34
Image 11 - Model Training Page
35
REFRENCES
1. OpenCV Documentation
Available at: [Link]
2. Python Official Documentation
Available at:
[Link]
3. PyQt5 Documentation
Available at: [Link]
4. MySQL Official Documentation
Available at:
[Link]
5. LBPH Face Recognizer - OpenCV Tutorial
Available at: [Link]
6. Machine Learning for Beginners: A Practical Guide
Available at: [Link]
36
37