Facial
Facial
By
Tan Shu Jing
(15ACB03979)
Supervised by
A REPORT
SUBMITTED TO
Universiti Tunku Abdul Rahman
in partial fulfillment of the requirements
for the degree of
BACHELOR OF INFORMATION TECHNOLOGY (HONS)
COMPUTER ENGINEERING
Faculty of Information and Communication Technology
(Perak Campus)
JANUARY 2018
UNIVERSITI TUNKU ABDUL RAHMAN
Title: __________________________________________________________
__________________________________________________________
__________________________________________________________
I __________________________________________________________
(CAPITAL LETTER)
Verified by,
_________________________ _________________________
(Author’s signature) (Supervisor’s signature)
Address:
__________________________
__________________________ _________________________
__________________________ Supervisor’s name
i
FACIAL RECOGNITION-BASED ATTENDANCE MONITORING
By
Tan Shu Jing
(15ACB03979)
Supervised by
A REPORT
SUBMITTED TO
Universiti Tunku Abdul Rahman
in partial fulfillment of the requirements
for the degree of
BACHELOR OF INFORMATION TECHNOLOGY (HONS)
COMPUTER ENGINEERING
Faculty of Information and Communication Technology
(Perak Campus)
JANUARY 2018
DECLARATION OF ORIGINALITY
Signature : _________________________
Name : _________________________
Date : _________________________
iii
ACKNOWLEDGEMENTS
Upon completing this project, I would like to express my sincere expression towards my
supervisor, Mr. Teoh Shen Khang whom had given me unconditional support throughout this
project. Mr. Teoh had not only solved many of my encountered problems but also being very
concern about my project by giving me a lot of alternative options during dealing with the
project. The project couldn’t complete smoothly if it wasn’t his teaching dedication. Thank
you very much for assisting me throughout this project.
Apart from that, I would also like to send my thanks to my parents for being very supportive
in my hard times during conducting this project. Thank you for giving financial aids for the
equipment in this project. Also, special thanks to my siblings and my friend William for the
volunteer to provide their portrait to my project for the testing of my face database system. A
million thank you.
iv
ABSTRACT
The technology working behind will be the face recognition system. The human face is
one of the natural traits that can uniquely identify an individual. Therefore, it is used to trace
identity as the possibilities for a face to deviate or being duplicated is low. In this project, face
databases will be created to pump data into the recognizer algorithm. Then, during the
attendance taking session, faces will be compared against the database to seek for identity.
When an individual is identified, its attendance will be taken down automatically saving
necessary information into a database system. At the end of the day, the attendance information
regarding an individual can be accessed from a web server hosted by the raspberry pi.
In short, this upgraded version of attendance monitoring system not only saved many
resources, but also provide huge convenience to the authority as many process are automated.
v
TABLE OF CONTENTS
FRONT COVER
REPORT STATUS DECLARATION FORM i
TITLE PAGE ii
DECLARATION OF ORIGINALITY iii
ACKNOWLEDGEMENT iv
ABSTRACT v
TABLE OF CONTENTS vi
LIST OF FIGURES ix
LIST OF TABLES xii
LIST OF ABBREVIATIONS xiii
CHAPTER 1 INTRODUCTION 1
1.1 Problem Statement and Motivation 1
1.2 Research Objectives 2
1.3 Project Scope and Direction 3
1.4 Impact, significance and contributions 3
1.5 Background Information 4
1.5.1 Project Field 4
1.5.2 Historical development prior to the project 5
vi
3.2.2 The process of attendance taking 14
CHAPTER 6 CONCLUSION 55
6.1 Project Review 55
vii
6.1.1 Personal Insight 55
6.1.2 Implementation Issue and Challenges 56
6.1.3 Contributions of this project 57
6.1.4 Further Developments 57
6.2 Conclusion 58
BIBLIOGRAPHY 59
PLAGIARISM CHECK RESULT 63
viii
LIST OF FIGURES
ix
Figure 4.2.6 Login interface for phpMyAdmin
Figure 4.2.7 Configuration steps for Wordpress
Figure 4.2.8 Completed design of the webpage
Figure 4.2.9 Customization login page
Figure 4.2.10 Process flow of attendance taking through the webpage
Figure 4.2.11 Method of acquiring the portrait
Figure 4.2.12 Process flow of the facial recognition procedure
Figure 4.2.13 Flow chart of attendance recording procedure
Figure 4.2.14 Relationships between files for the attendance taking
process
Figure 4.2.15 Interface of the Record Attendance Page
Figure 5.1.1 Course Table Design View
Figure 5.1.2 Course Table Datasheet View
Figure 5.1.3 Student Table Design View
Figure 5.1.4 Student Table Datasheet View
Figure 5.1.5 Staff Table Design View
Figure 5.1.6 Staff Table Datasheet View
Figure 5.1.7 Course Timetable Table Design View
Figure 5.1.8 Course Timetable Table Datasheet View
Figure 5.1.9 Student Attendance Table Design View
Figure 5.1.10 Student Attendance Table Datasheet View
Figure 5.1.11 ER Diagram of the database
Figure 5.1.12 Relationship between the tables
Figure 5.2.1 Summary of the services provided by the Attendance
Management System webpage
Figure 5.2.2 Registration Forms tab in the UTAR Attendance System
webpage
Figure 5.2.3 4 Different registration forms in the UTAR Attendance
Management System webpage
Figure 5.2.4 Record Attendance interface on the UTAR Attendance
Management System webpage
Figure 5.2.5 Viewing Attendance Menu
Figure 5.2.6 Interface of View Attendance by Student
Figure 5.2.7 Interface of View Attendance by Subject
Figure 5.2.8 Login prompt from record attendance page
Figure 5.2.9 Login prompt from registration forms page
x
Figure 5.2.10 Login page into the UTAR Attendance System
Figure 5.2.11 Users created in Wordpress for this project
Figure 5.2.12 Staff Directory page
Figure 5.2.13 Student Directory page
Figure 5.2.14 Course Directory page
xi
LIST OF TABLES
xii
LIST OF ABBREVIATIONS
Abbreviations Description
CSV Comma Separated Values
GPIO General Purpose Input/ Output
GTK Graphical User Interface Toolkit
GUI Graphical User Interface
HDMI High Definition Multimedia Interface
I/O Input/ Output
ICT Information & Communication
ID Identification
IoT Internet of Things
IP Internet Protocol
LBPH Local Binary Patterns Histograms
LED Light Emitting Diode
NFC Near Field Communication
NOOBS New Out of Box Software
OS Operating System
RFID Radio Frequency Identification
SD Secure Digital
VGA Video Graphics Array
VNC Virtual Network Computing
Wi-Fi Wireless Fidelity
YML YAML Ain’t Markup Laguage
PHP Hypertext Processor
SQL Structured Query Language
FYP Final Year Project
HTTP Hypertext Transfer Protocol
FastCGI Fast Common Gateway Interface
ER Diagram Entity Relationship Diagram
xiii
Chapter 1: Introduction
According to the previous attendance management system, the accuracy of the data
collected is the biggest issue. This is because the attendance might not be recorded personally
by the original person, in another word, the attendance of a particular person can be taken by
a third party without the realization of the institution which violates the accuracy of the data.
For example, student A is lazy to attend a particular class, so student B helped him/her to sign
for the attendance which in fact student A didn’t attend the class, but the system overlooked
this matter due to no enforcement practiced. Supposing the institution establish an
enforcement, it might need to waste a lot of human resource and time which in turn will not
be practical at all. Thus, all the recorded attendance in the previous system is not reliable for
analysis usage. The second problem of the previous system is where it is too time
consuming. Assuming the time taken for a student to sign his/her attendance on a 3-4 paged
name list is approximately 1 minute. In 1 hour, only approximately 60 students can sign their
attendance which is obviously inefficient and time consuming. The third issue is with the
accessibility of those information by the legitimate concerned party. For an example,
most of the parents are very concerned to track their child’s actual whereabouts to ensure
their kid really attend the classes in college/school. However in the previous system, there are
no ways for the parents to access such information. Therefore, evolution is needed to be done
to the previous system to improve efficiency, data accuracy and provides accessibility to the
information for those legitimate party.
In order to solve the drawbacks of the previous system stated in 1.1, the existing
system will need to evolve. The proposed system will reduce the paper work where
attendance will no longer involve any manual recording. The new system will also reduce the
total time needed to do attendance recording. The new system will acquire individual
attendance by means of facial-recognition to secure data accuracy of the attendance.
The followings are the objectives of this project:
The main intention of this project is to solve the issues encountered in the old attendance
system while reproducing a brand new innovative smart system that can provide convenience
to the institution. In this project, a smart device will be developed which is capable of
recognising the identity of each individuals and eventually record down the data into a
database system. Apart from that, a website will be developed to provide visual access to the
information. The followings are the project scopes:
▪ The targeted groups of the attendance monitoring system are the students and staff of
an educational institution.
▪ The database of the attendance management system can hold up to 2000 individual’s
information.
▪ The facial recognition process can only be done for 1 person at a time.
▪ There will be two types of webpage interface after the login procedure for the admins
and the non-admins respectively.
▪ The project has to work under a Wi-Fi coveraged area, as the system need to update
the database of the attendance system constantly.
▪ The smart device is powered up by power bank to improve the portability of the
device.
Many attendance management systems that exist nowadays are lack of efficiency and
information sharing. Therefore, in this project, those limitations will be overcome and also
further improved.
▪ Students will be more punctual on attending classes. This is due to the attendance of a
particular student can only be taken personally where any absentees will be noticed by
the system. This can not only train the student to be punctual as well as avoids any
immoral ethics such as signing the attendance for their friends.
In short, the project is developed to solve the existing issues in the old attendance system.
The application area of this project is involved in the smart cities sub-field. Smart
cities is a development vision using Information & Communication technology (ICT) in
urban advancement where city’s assets will be managed by smart devices to improve
efficiency and also to reduce human resource consumption. By integrating these concepts, a
Smart attendance monitoring system will be developed.
Traditionally attendance was taken manually which is very time consuming and often
leads to human error. Additionally, there are many uncertainties towards the sources of the
attendance records which in fact, most of the attendance records are not retrieved from the
actual situation. The old method that uses paper sheets for taking student’s attendance can no
longer be used. Based on the research, there are many solutions that are available to solve this
issue.
The second research journals “Face Recognition Based Attendence Marking System”
(Senthamil Selvi, Chitrakala, Antony Jenitha, 2014) is based on the identification of face-
recognition to solve the previous attendance system’s issues. This system uses camera to
capture the images of the employee to do face detection and recognition. The captured image
is compared one by one with the face database to search for the worker’s face where
attendance will be marked when a result is found in the face database. The main advantage of
According to the forth research journal “RFID based Student Attendence System”
(Hussain, Dugar, Deka, Hannan, 2014), the proposed solution is almost similar to the first
research journal where RFID technology is used to improve the older attendance system. In
this system, a tag and a reader is again used as a method of tracking the attendance of the
students. The difference between the first journals with this is where attendance’s information
can be accessed through a web portal. It provides more convenient for information retrieval.
The hardware used in this project so far consists of only 4 components which are:
▪ Raspberry Pi 3
▪ Raspberry Pi 8mp Camera Module
▪ Power Supply Cable
▪ 16Gb Micro SD Card Class 10
When the raspberry pi 3 first arrived, its casing, pi-fan, and the pi camera are not
assembled. Thus, the first thing to do is to screw the pi-fan in place on the casing provided
and next secure the pi board onto the
casing by again tightening it with
screws. For the fan to work, it’s end
has to be connected to a 5v pin and a
ground pin which are pin 4 and pin 6
respectively with the red-wired
connector to pin 4 and black-wired
connector to pin 6. Then, assemble
the pi camera onto the raspberry pi by
first lifting up the camera port’s tab
which is located between the Ethernet
and HDMI ports on the raspberry pi to
loosen it up, next insert the pi camera
Figure 3.1.1 Raspberry Pi 3 GPIO Header connector into the port with the silver
(element14 community, 2017)
Figure 3.1.2 Connections of pi-fan and pi-camera Figure 3.1.3 Final assembled product
onto the raspberry pi 3 board
After the hardware is assembled, it is ready to install the appropriate operating system
into the raspberry pi. The installation process starts by downloading NOOBS (New Out of
Box Software) from the raspberry pi official website into the micro SD card. Then the micro
SD card is inserted into the micro SD slot located below the raspberry pi board.
The next step would be the installation of Raspbian operating system (OS) into the
raspberry pi. The raspberry pi is connected to a monitor via the HDMI slot on the raspberry pi
through the HDMI converter to the VGA port on the monitor for display. Then, a mouse and
a keyboard are connected to the raspberry pi via the USB ports to provide communication
platform between the raspberry pi. Finally, the raspberry pi is powered up and the
initialization is completed by following the on-screen instruction.
Before the raspberry pi can be accessed from a remote device through the connection
of wifi, initial setup has to be done for future convenience. Therefore, when the desktop first
appeared after the initialization process mentioned in the previous section, the Wi-Fi is turned
on to obtain wifi connection from the hotspot provided by a mobile phone. This is to allow
the raspberry pi to remember the entered password for that particular Wi-Fi, so that in the
future, the raspberry pi will automatically connect to the wifi on its start-up. Then, a remote
access software such as VNC Viewer is installed onto the laptop. Upon connecting the
raspberry pi to the remote viewer software (VNC Viewer) on the laptop, the raspberry pi has
to be in the same network as the laptop, then the connection progress can be done by just
entering the IP address of the raspberry pi into the VNC Viewer.
In this project, OpenCV is used to do facial recognition where the whole program will
be coded in Python Language. The installation of OpenCV is merely not enough, therefore,
OpenCV is installed with Python bindings to bridge Python and C++ in OpenCV. In short,
the binding is crucial to enable the calling of a C++ function from Python. The following is a
brief walkthrough on the installation process that had done:
After installing the Pi Camera Module onto the raspberry pi board, the next step is to
enable the camera module. Before being able to do that, the raspberry pi firmware is being
updated first. Then, the camera module is being enabled by going into the configuration menu
at the terminal. Next, the raspberry pi is rebooted. In order for python to interact with the pi
camera, a picamera module with NumPy array support is installed. This is due to OpenCV
takes images as NumPy arrays.
There are two major system flows in the software development section as shown below:
Both process mentioned above are essential because they made up the backbone of the
attendance management system. In this section, the process of both flows will be briefly
described. Meanwhile, their full functionality, specific requirements and also the
methods/approach to accomplish such objectives will be discussed in the upcoming chapter.
The face database is an important step to be done before any further process can be
initiated. This is because the face database acts as a comparison factor during the recognition
process which will be discussed in later section. In the process above, a csv file is created to
aid the process of image labelling because there will be more than one portrait stored for each
student, thus, in order to group their portraits under the name of the same person, labels are
Other than the creation of face database, the rest of the remaining process can all be
done through a webserver. Thus, the attendance taking procedure will also be done through a
web server. This is to provide a friendly user-interface to the user (lecturer) while being able
to conduct an execution on the raspberry pi to do attendance taking without the need to
control the raspberry pi from a terminal which will be ambiguous for most user. Therefore,
just with a click of button on the webpage, a python script will be executed which it will
launch a series of initialization such as loading the trained data to the recognizer and etc. The
attendance taking process will then proceed in a loop to acquire, identify and mark the
attendance for each of the students that is obtained from the pi camera. In chapter 4, every
step in both of the process flow above will be explained in detailed on its accomplishment.
However, for the whole system to store the data effectively, a database using MySQL will be
created to store every single piece of related information in a proper manner so that during
Attendance Management
System Webpage
Figure 3.2.3: Chart showing the service provided by the attendance management system webpage
There will be several requirements to achieve the creation of the face database. The below are
the required software or packages needed to accomplish this objective.
4.1.2 Methodology
Before the attendance management system can work, there are a set of data needed to
be inputted into the system which essentially consist of the individual’s basic information
which is their ID and their faces. The first procedure of portrait acquisition can be done by
using the Raspberry Pi Camera to capture the faces of the individual. In this process the
system will first detect the presence of a face in the captured image, if there are no face
detected, the system will prompt the user to capture their face again until it meets certain
number of portraits which will be 10 required portraits in this project for each student. The
decision of storing only 10 portrait per student is due to the consideration of the limited
storage space in the raspberry pi because the total amount of students in the university is
considered heavy. Then, the images will undergo several pre-processing procedures to obtain
a grayscale image and cropped faces of equal sized images because those are the pre-
requisites of using the EigenFaces Recognizer. Both of the processes mentioned above can be
represented in the diagram below.
Face Detection in
image
database
|----- 1503979
| |----- 0.pgm
| |----- 1.pgm
| |----- 2.pgm
| | ....
| |----- 9.pgm
|----- 1543268
| |----- 0.pgm
| |----- 1.pgm
| | ….
| |-----9.pgm
| ….
| ….
|----- 1613765
|----- 0.pgm
| ….
|----- 9.pgm
After a successful retrieval of facial images into the respective folder, a CSV file is
created to aid the next process of pumping the faces into the recognizer for the training
process. The creation of the CSV file will be done based on a script named create_csv.py. In
this project, the content of CSV file will look like the following format:
database/1503979/0.pgm;0
Base Folder Sub-folder Image File Label
Represents each
individual in one
sub-folder. Named by
their ID.
The development of the face database is an important phase before any facial
recognizing process can be carried out. It acts as a library to compare against with whenever
the system wanted to identify a person. In the image retrieval process, the system will first
prompt for an input from the user to enter their ID number. The system will then validate the
entered input and then check for duplication in the system. In order to proceed, the entered
input must contain only 7 digits of number. Apart from that, the ID inputted have to be a non-
registered ID to ensure no duplication. After that, a directory is created for each individual
where their portraits will be stored inside of it. It is a compulsory to store 10 portraits per
person in the file. After the acquisition of image is done, the images undergo a pre-processing
before storing it into the respective folder.
The above flowchart is only the program flow for the image acquisition process which
describes the program flow for the script create_database.py. There are two more python
scripts that responsible for the remaining execution which will be explained in the next sub-
section.
The following diagram will explain the relationships between these files.
Process Flow prepare_gallery.sh Store images in created
Call the following scripts folder with the name of
Portrait Acquisition student’s ID
Create folder in
Face Detection create_database.py database
Portrait Pre-processing
Create file
Creation of CSV file create_csv.py faceDirectory.csv
Figure 4.1.5: The relationships between the files during the face database creation
Figure 4.1.6: Images provided by the AT&T Facedatabase (AT&T Laboratories Cambridge, 2002)
Testcase Status
No. Description Test Type Test Values Test Output
Name (pass/fail)
An error box
appeared stating
Input value more
1 ‘12345678’ that ‘Length of ID pass
than 7 digits.
number can only
be 7 digits!’
An error box
Input value
appeared stating
2 This test is include alphabetic ‘123abc7’ pass
performed to that ‘Invalid ID
character.
Test check whether number entered’
Input ID the ID typed An error box
by the user is Input ID that is appeared stating
3 valid or not. ‘1600001’ pass
already existed. that ‘ID number
existed’
An error box
Captured image Capture a appeared stating
5 pass
has no face blank image that ‘No face
This test detected!’
performed is
to ensure the An error box
Move while
captured Captured image is appeared stating
6 the image is pass
image motion blur. that ‘No face
taken.
Test
contains a face detected!’
Image
which is The person is Capture the An error box
Capture
detected by standing too close portraits 5cm appeared stating
7 the system pass
during the away from the that ‘No face
before storing capturing process. pi camera. detected!’
it into the face
database Capture an A notice box
Captured image image with a appeared stating
8 pass
has a face. person facing that ‘1 portrait
the pi camera saved!’
Table 4.1.1: Verification test plan for the creation of face database
ID already existed
Invalid ID
12345678 Invalid ID
There will be several requirements before the process of attendance taking can be initiated.
The below are the required software or packages needed to accomplish this objective.
Figure 4.2.4: Test page for the configurations of Nginx with PHP
After the above steps are done, the interface of phpMyAdmin is now accessible from the web
browser again, from any devices which is connected in the same network as the raspberry pi.
PhpMyAdmin is installed in the root file (/var/www/html/), thus, during accessing its
interface on the browser, the path http://192.168.43.232/phpmyadmin is entered to reach the
login interface of phpMyAdmin. During the login, the username is set to ‘root’ and the
password prompted is second one that is created during the setup. All the configured
usernames and passwords for this project will be summarized in the upcoming sub-section.
In this project, many usernames and password are created during the configuration process,
the below are the configured information.
The followings are the summarized file path and web path for this project.
Root file in raspberry pi: /var/www/html/
PhpMyAdmin file: /var/www/html/phpmyadmin
Wordpress file: /var/www/html/wordpress
Access path to phpmyadmin web interface: http://192.168.43.232/phpmyadmin
Access path to wordpress web interface: http://192.168.43.232/wordpress
Access path to wordpress login page: http://192.168.43.232/wordpress/wp-admin
*Note: These web paths are only accessible by devices that are connected to the same
network as the raspberry pi. Meaning the website can only be accessed locally. In order for
them to be accessed outside the network, port forwarding mechanism can be done to allow
this. However, in this project, there are no administrative power to use the university’s
network.
BCS (HONS) Computer Engineering 33
Faculty of Information and Communication Technology (Perak Campus), UTAR
4.2.4 Methodology
After the all the configurations are done, the website now is available for use and thus
users such as the lecturer can start taking down attendance simply by just accessing the
“Record Attendance” tab in the Attendance Management System website. However, in
order for user to access this tab, he/she has to be authorized to do so by logging in into the
system as a “contributor” role (will be further explained in Chapter 5). After logging into the
respective tab, the user will be prompted to select the current timetable ID from a table and
also select the current date to start the attendance taking process. When the user selected the
“submit” button a .php file called student_attendance.php will be called which a python script
named record_attendance.py will be executed from the .php file. In this
student_attendance.php file, two variables which are the timetable ID and the current date
(passed by POST method from the html) will be passed into the python script upon calling it.
Webpage
Record Attendance Php Script
Student_attendance.php
Execute
Python Script
Record_attendance.py
The facial-recognition process is started when the python script is executed. When the
script is first executed, variables are initialized and most importantly, the .yml file created
previously during the recognizer training process is now loaded into the system. After the
system is loaded with the intended data, the process of capturing student faces is initiated.
Firstly, all the students are advised to stand approximately 20cm away from the attendance
taking device (packaged pi camera + raspberry pi) with their face remained parallel to the pi
camera. Usually this can be done by ensuring the eye position is same level as the pi camera.
20cm
Image acquisition
The student’s/staff’s portrait are captured
through a Raspberry Pi Camera Module
during attendance taking.
Repeat the process again when a face is detected
Image pre-processing
The image undergoes face detection
algorithm, being cropped and etc.
Since the face database are downloaded from the internet, thus to test whether the face
recognizer is working, facial images were manually pumped into the code to check for
identification. However, the following flow chart will explain the intended process flow of
the face recognition process.
START
Images = []
Labels = []
idList =[]
Read data from the csv file
True
len(Images) Output
<= 1 error_msg
False
gallery = cv2.face.createEigenFaceRecognizer()
gallery.load(“trained_data.yml”)
Input im_face
label= gallery.predict(im_face)
foundID = idList[label]
Exist
Check ID existence in the database
Not Exist
The php file is the first file that will be called after the user clicked the submit button to start
the attendance taking process. Then, in the php file, a bash file will be executed where the
values entered by the user will also be passed in into the bash file. The bash file will then
again tune the environment to cv environment before executing the python script. During the
execution of the python script, the values passed into the bash file will also be passed into it.
The following diagram explains the relationship between these files.
trained_data.yml
load
execute execute
student_attendance.php runcv_env.sh record_attendance.py
Figure 4.2.14: Relationships between files for the attendance taking process
Testcase Status
No. Description Test Type Test Values Test Output
Name (pass/fail)
Invalid entered
This test is Input value have
input! Timetable
1 performed to more than 7 ‘12345678’ pass
Test ID must be 7
check digits.
input digits long.
whether the
Timetable Invalid entered
Timetable
ID Input value have input! Timetable
2 entered is ‘123456’ pass
valid or not less than 7 digits. ID must be 7
digits long.
Results
Non-Exist
Input of
Timetable
ID ID doesn’t exist
Results
Invalid
Input of
Current
Date Unselected Date
Results
From the designed database above, there are reasons for the creation of every table. In
an institution attendance management system, the main focus is on the staff and students.
Thus, the Student and Staff tables are created to store their basic information. In most
institution, every student is attending classes based on their registered course which are
conducted according to the arranged sessions. While different students can be taking the same
subject in the same semester but are conducted at a different time session. Therefore, there is
a need to store the information of every class sessions according to the subjects so that the
system can track the exact class session that the students had attended. Thus, the
course_timetable table is created to manage that. After having almost every relevant tables
created, another table is needed to store the attendance information of the students which will
be the student_attendance table.
The three main parent tables in this database are the Course, Student and Staff
responsible to hold basic information for the subject details, student’s information and staff’s
information respectively. While there are two child tables in this database which are made up
of the course_timetable table and the student_attendance table. In the course_timetable
table, information of different class session of a particular subjects are stored. In this table, 2
referenced keys are assigned to connect this table with another two tables which are the
sub_ID (connecting it to the Course table) and stf_ID (connecting it to the Staff table). While
in the student_attendance table, there are 3 important elements being stored for each
attendance record which are the stu_ID, timetable_ID and the attnd_date. The timetable_ID
and the stu_ID are connected to the course_timetable table and Student table respectively.
Figure 5.2.1: Summary of the services provided by the Attendance Management System webpage
Based on the chart above, there are in total four types of different utility provided by
the Attendance Management System webpage. In Chapter 4, the setup procedure of the
website is reviewed and the access path to this website is also discussed in detail. In this
Chapter, the created webpage which are hosted by the raspberry pi by Wordpress will be
illustrated and explained here. Since the website created is connected to the database which
can be accessed from the phpMyAdmin page, the ultimate goal provided by this website is to
allow the user (usually the staff or lecturer) to communicate with the database without the
need to access the phpMyAdmin page nor the raspberry pi. And by logging in into the
system, various actions such as adding records to the table, viewing the records and
filtering the intended records can all be performed through the webpage at ease.
Figure 5.2.2: Registration Forms tab in the UTAR Attendance System webpage
Attendance Recording:
There is a page in this website specifically designed to initiate a python script containing the
recognition algorithm during the attendance taking process is started. But before that could
happen, flashing back to the previous section, the student_attendance table require 3
elements to make a record which are the student ID, timetable ID and also the current date.
Thus, in this page, the user (lecturer) will be required to enter the related timetable ID and
Figure 5.2.4: Record Attendance interface on the UTAR Attendance Management System webpage
Attendance Viewing:
After the attendance is being recorded into the database, the next requirements is to be able to
retrieve it. By considering what different user are interested in the form of data to be
displayed, it appears that the lecturer are more interested to view the attendance by the
subjects they teach whilst, students are more interested to view their own attendance for each
of the subjects they registered. Therefore, the attendance viewing page is designed to have
two different access methods.
▪ View attendance by Student ID
▪ View attendance by Subject ID (only accessible by lecturer)
As for authorized user, they can easily login into the system by either clicking on the orange
“LOGIN” word or by choosing the “ADMIN LOGIN” tab which a login page will then
appear as below.
Other Pages:
Apart from the pages created above, there are 3 additional pages created just for viewing
purpose where the records in the database can be viewed here.
▪ Staff Directory page
▪ Student Directory page
▪ Course Directory page
The Staff and Student Directory pages only display a direct Staff and Student tables from the
database, whilst in the Course Directory page, it allows user to enter a specific Subject ID to
enable the viewing of all its timetable details.
Registration Forms:
▪ Course Registration Form student_details.php
▪ Course Timetable Form timetable_details.php
▪ Staff Registration Form staff_details.php
▪ Student Registration Form student_details.php
Attendance:
▪ View Attendance by Student show_attendance.php
▪ View Attendance by Subject show_course_attendance.php
Record Attendance student_attendance.php
Course Directory show_timetable.php
*Note: All the php files above can be found in the attached cd.
Diepen, G. (2017). Detecting and tracking a face with Python and OpenCV. [online]
www.GuidoDiepen.nl. Available at: https://www.guidodiepen.nl/2017/02/detecting-and-
tracking-a-face-with-python-and-opencv/ [Accessed 19 Oct. 2017].
Docs.opencv.org. (2017). Face Recognition with OpenCV — OpenCV 2.4.13.4
documentation. [online] Available at:
https://docs.opencv.org/2.4/modules/contrib/doc/facerec/facerec_tutorial.html#face-
database [Accessed 19 Oct. 2017].
Element14.com. (2017). Community: Raspberry Pi 3. [online] Available at:
https://www.element14.com/community/community/raspberry-
pi/raspberrypi3/content?filterID=contentstatus[published]~objecttype~objecttype[docum
ent]&filterID=contentstatus[published]~language~language%5Bcpl%5D [Accessed 21
Oct. 2017].
GitHub. (2017). iashris/Face-Detection-OpenCV. [online] Available at:
https://github.com/iashris/Face-Detection-OpenCV/blob/master/FaceDet.py [Accessed
19 Oct. 2017].
Opencv-python-tutroals.readthedocs.io. (2017). Getting Started with Images — OpenCV-
Python Tutorials 1 documentation. [online] Available at: http://opencv-python-
tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_image_display/py_image_displa
y.html [Accessed 19 Oct. 2017].
Projects.raspberrypi.org. (2017). Cite a Website - Cite This For Me. [online] Available at:
https://projects.raspberrypi.org/en/projects/getting-started-with-guis [Accessed 18 Oct.
2017].
Raja, R. (2017). Face Detection using OpenCV and Python.. [online] SuperDataScience - Big
Data | Analytics Careers | Mentors | Success. Available at:
https://www.superdatascience.com/opencv-face-recognition/ [Accessed 19 Oct. 2017].
Raspberry Pi. (2017). Download NOOBS for Raspberry Pi. [online] Available at:
https://www.raspberrypi.org/downloads/noobs/ [Accessed 19 Oct. 2017].
Rosebrock, A. (2017). Accessing the Raspberry Pi Camera with OpenCV and Python -
PyImageSearch. [online] PyImageSearch. Available at:
https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-
opencv-and-python/ [Accessed 19 Oct. 2017].
Rosebrock, A. (2017). How to install OpenCV 3 on Raspbian Jessie - PyImageSearch.
[online] PyImageSearch. Available at:
https://www.pyimagesearch.com/2015/10/26/how-to-install-opencv-3-on-raspbian-
jessie/ [Accessed 18 Oct. 2017].
Rosebrock, A. (2017). Practical Python and OpenCV: Learn Computer Vision in a Single
Weekend. [online] Pyimagesearch.com. Available at:
https://www.pyimagesearch.com/practical-python-opencv/?src=sidebar-face-detection
[Accessed 18 Oct. 2017].