Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

A PROJECT REPORT

ON

“OUTLAWS DETECTION – FACE RECOGNITION”

BY
AMIRTHAVARSHINI MURUGAN NADAR
NADAR

UNDER THE GUIDANCE OF

Dr. MANOJ SINGH

IN PARTIAL FULFILLMENT OF REQUIREMENTS FOR

THE DEGREE

M.SC. COMPUTER SCIENCE


OF

MARCH 2023-24

S.I.E.S COLLEGE OF ARTS, SCIENCE AND COMMERCE

(AUTONOMOUS), SION (W), MUMBAI- 400 022


SIES College of Arts, Science and Commerce (Autonomous)
Sion (W), Mumbai – 40022

CERTIFICATE

This is to certify that the project entitled “Outlaws Detection – Face


Recognition” is a bonafide work of Miss Amirthavarshini Murugan Nadar
bearing Roll No. SMCS2324012 submitted to the college for partial fulfilment
for the post- graduation degree in Master of Science (Computer Science),
academic year 2023-24.

Prof. In-Charge Head of the Department

Dr. Manoj Singh Dr. Manoj Singh

Examination Date: Examiner’s Signature:

College Seal
Preface

It gives me great pleasure to present the project on “Outlaws Detection – Face Recognition”
prepared sincerely, punctually and with utmost efforts.

The contents of this book are presented into many chapters, to ease reading. The project has
been illustrated with precise data elucidated with neat UML Diagrams that simplify the
understanding of the project. The project includes software development tools like etc.

Meticulous care has been taken to make this project perfect and useful in every respect.

Amirthavarshini Nadar
Acknowledgment

I am honoured to take this opportunity to express my sincere gratitude and indebtedness to my


esteemed project guide, Dr. Manoj Singh, for providing me with the invaluable opportunity to
accomplish this project. Their guidance, mentorship, and support were crucial in ensuring the
success of this project.
I am also deeply grateful to Dr. Manoj Singh, Head of Department, for their resourcefulness,
kindness, and helpfulness throughout the project. Their unwavering faith in me, positive
attitude, and unassailable optimism were a constant source of motivation and inspiration
whenever I encountered challenges.
Furthermore, I would like to extend my thanks to all our professors, friends, and seniors who
provided us with valuable insights and support that directly or indirectly contributed to the
completion of this project. Their assistance was invaluable in helping us to achieve our
objectives.
Lastly, I would like to express my heartfelt appreciation to my family, whose unwavering
support, motivation, and encouragement was instrumental in the successful completion of this
project. Without their support, this would not have been possible.
Contents

Preliminary Investigation 6
Organisational Overview 6
What is Face Recognition 6
Problem Statement 7
Existing Process 7
Why Face Recognizer 8
Stakeholders 8
Modules 8
Image Processing 10
OpenCV Model 10
Face Recognition 11
System Flow 12
System Requirements 12
Maintenance & Estimated Cost 13
Benefits of Proposed system 14
Gantt Chart 14

System Analysis 15
Event Table 15
Sequence Diagram 17
Use Case 19
ER Diagram 21
Code 22
Design 30

Scope for Future Enhancement 35


Bibliography 36
Preliminary Investigation

Organisational Overview
Face detection, also called facial detection, is an artificial intelligence (AI)-based computer
technology used to find and identify human faces in digital images and video. Face detection
technology is often used for surveillance and tracking people in real time. It is used in various
fields including security, biometrics, law enforcement, entertainment and social media.

What is Face Recognition?

The process of detecting and locating faces from a single or series of images and identifying
the face is known as face recognition (1)
Biometric Recognition is the statistical data analysis of people's unique behavioural and
physical characteristics which is mainly used for security and identification which includes
fingerprints, facial features, retina, iris, voice, gaits palm print etc. Among these methods face
detection is considered to be most precise and safe. Facial recognition is an activity of
discovering a peep's face by estimating and evaluating motifs on the exclusive facial markers
of the face. Biometric software is used for this purpose (2).
Face recognition is not a new topic it has been already used round the globe in various factors
from unlocking phone by authenticating to Google photos that recognise faces and group
them together.

In this Outlaws detection we will be easily and quickly catch hold of any outlaws and we will
ensure the security. We are mainly focusing on the airport security and alerting system that
can embed our outlaw detecting system. This face detection will be mainly done in the area
where each individual gets checked after metal detecting system, security staff usually checks
them, there is where the process is mainly focused.
Actually, we can make use of this system anywhere the camera placed but for the best
accuracy we are choosing hat particular area.

In short, the process will be like, the passengers get checked themselves by the security staff
the camera will capture the image of passengers and compare it with the images that are
already available in our database. If the image is matched, then system will automatically
alert the administrator and the security staff and if the image is not matched there will be no
buzzers. Administrators are authorised person they can be police or any such higher
organization person, they will be providing the image of the outlaws and their information so
that we will be having the details required prior.

Problem Statement

In heavily crowded airport, it is extremely difficult to recognize wanted person. It is not


possible to keep track of them as the process of check-in must be quick and it is not easy to
remember faces of bandits. But only to make the process fast we can’t take risk safety and
security.
How can we solve this problem?

Existing Process

To recognize the wanted person the process is done manually. The security staff have image
of outlaws and they have to be always alert and have to check each and every passenger. If
some suspicious or wanted person is found, they report their higher department. This process
becomes very difficult when it comes to crowded areas. There is no automation in the
existing way of doing work.

To solve this problem, we will make use of Artificial Intelligence and smart devices. Our
System itself will catch outlaws autonomously.
Why Face Recognizer?

For best accuracy we can go for iris recognizer, but it is not possible while implementing it in
heavily crowded area where there are 1000 flights handled by an airport per day, so imagine
the number of passengers. For iris detection a clear high-quality picture should be taken and
for that it requires best quality camera with proper lighting and it also takes lot of time to
capture proper photo more over processing time is high as well.
Instead we will make use of face recognizer for fast and efficient recognising.

Our Outlaw detecting system is smart and works


automatically. We are directly connecting everyone for
security and ensure safety.

Once image is captured of passenger we are able to


make out if the person is bandit or nor and will
alert the area and also notify approprite admin.

This process is very efficient and provides security.


The accuracy is equally high so current system should
make use of our Outlaw detecting system.

Stakeholders

Admin - They will be providing photos of outlaws and details associated with it. Admin can
be police inspector and any high authorized person.
Airport Security Staff - They will be continuously using outlaws detection to recognize the
outlaw and will be alerted.

Modules
1. Authentication:
2. Admin Management:
3. Suspect Management:
4. Airport Management:
5. Device Management:
6. Notification:
7. Suspect Detection:
Authentication
 User should login using their credentials.
 Based on user role they will be redirected to admin panel or security panel.
 There will be tkinter login page as well for devices that are present on the airport, here
credentials and token will be checked to know details about the device

Admin Management
 View All Admins - Displays all admin users only visible to Admin.
 Add Admin - Renders the form to add a new admin user.
 Edit Admin - Renders the form to edit an admin user.
 Delete Admin - Deletes an admin user.
Direct registration will not be provided since one authorized admin will be created by
the developer directly, then this admin can add several admins to ensure safety

Suspect Management

 View All Suspects - It is a view that displays Image and Important details of bandit.
 Add Suspect – Only Admin can add suspects
 View Suspect Details – In Depth information details of each suspect will be displayed
to admin and security staff
 Edit Suspect – Only admin can edit the suspect’s details
 Delete Suspect – Only admin can remove suspect.

Airport Management

 View All Airports – Displays all enrolled airports only visible to airport security staff
 Add Airport – Only security staff can add new airports
 Edit Airport - Renders the form to edit an airport
 Airport Status – Update the status of airport as active or in active

 We will use pre-trained model cascade classifier to detect face from a live camera.
 Once face is detected we will be converting the image as required for the classifier.
 Then match it with each and every bandit images that we have in database.

Device Management

 View All Devices – Displays all devices


 Add Device - Device will be added with respect to it’s airport
 Update Device Status - Update the status of device as active or in active
Notification

 Notifys with image captured by the security staff of bandit and place, date-time such
details

Suspect Detection

This process is implemented using tkinter after login, exclusively accessible to


security staff. The primary function is to detect outlaws among passengers. Security staff
captures the image of passengers, triggering a pop-up notification indicating whether the
person is wanted or not. If a wanted individual is detected, immediate alerts are issued to the
security staff through various methods, as specified by the admin during suspect registration.
Alerts may include buzzer sounds or pop-up notifications, tailored to the wanted level of the
outlaw.

Detection is also limited to specific states where suspects are wanted. If a suspect is found at
an airport in a state where they are not wanted, no alert is triggered. This ensures that alerts
are only generated in relevant scenarios, optimizing security measures.

While implementation in real world we will be capturing image automatically when the
boarding pass is scanned.

Image Processing

Image processing is the process of transforming an image into a digital form and performing
certain operations to get some useful information from it.

OpenCV Model

CV component contains the basic image processing and higher-level computer vision
algorithms.
ML is the machine learning library, which includes many statistical classifiers and clustering
tools.

HighGUI contains I/O routines and functions for storing and loading video and images.

CXCore contains the basic data structures and content.

Face Recognition

Recognize and manipulate faces from Python or from the command line with
the world’s simplest face recognition library.
Built using dlib’s state-of-the-art face recognition
built with deep learning. The model has an accuracy of 99.38% on the
Labeled Faces in the Wild benchmark.
This also provides a simple face_recognition command line tool that lets
you do face recognition on a folder of images from the command line![5]
System Flow

 The initial step is registration of both admin and airport security staff.
 For security purpose developer will create the first admin for the authorization.
 Once an admin is created then that admin add multiple admins.
 While Loging in we authenticate the user and check the role of the user, based on that we
display the required panel.
 In admin panel, admin can add outlaws, updated their information and also have notification
view where they can see if there was any wanted person detected.
 In airport security panel, security will login with the airport credential and a view will open
up with live camera and a button to capture image, just click the capture button and image
will we captured and in backend processing of image will be done, The model will be
fetching the images of the wanted images and compare these captured images of the
passenger and if image is matched appropriate action will happen.
 Like buzzer will alert the area or just a popup notification for the security staff so that they
can have an eye on them.
 Alerting particular admin can also be done, so that only the admin that is on control of that
area will be alerted.

System Requirements
Hardware Requirements (Minimum)
Processor : Intel i3 Processor and above.
Primary Memory : 4GB RAM (Random Access Memory) and above.
Storage : 8GB hard disk and above.
Webcam : Screen Size 3.5 Inches & Optical Zoom 4 x
Software Requirements

Operating System : Microsoft Windows (7,8, and 10), Linux, and Mac OS.
Software : Python IDLE, XAMPP.
Software Requirement for Development of Outlaw Detection:

Front-end : Php Laravel and Python Tkinter


Python Package : OpenCV, NumPy, Face_recognition
Database : MySQL.
Software : Python, XAMPP, Php Laravel.
Maintenance and Estimated Costs

The maintenance costs would be charged after 2 months, i.e., the first 2 months’ maintenance
would be free of cost and charges would apply from the third month onwards (Rs. 50,000).

● Price (per month salary) : Rs. 65,000


● 3 month’s salary : Rs. 1,95,000

LIST COST

Hardware System Requirement 1,00,000

Software System Requirement 2,00,000


Hosting 9,000
Server 2,00,000

Designing Charge 60,000

Functionality Charge 60,000

Designer & Developer Team Salary 1,95,000(for three months)

Security and Maintenance 50,000/month

Third Party Testers Charge 70,000

Other Charges 50,000

Tax (18%) 1,78,920

Total Amount 11,72,920

The estimated cost is approximately calculated, actual cost will be determined by multiple
factors such as the availability of hardware, Infrastructure of airport etc.
Negotiation will be done.
Benefits of outlaw detecting system
 Security staff doesn’t have to constantly have to keep track of bandit. They don’t
have to remember each and every bandit face.
 The process is automated so no human error will occur.
 Respective admin will know if the wanted person is spotted or not.
 If bandit is found system will directly notify the admin so we don’t need to wait for
security staff to inform
 Quick Processing
 High Accuracy – Haar Cascade classifiers gives us 96.24% accuracy which is best till
date.
 User-Friendly – For both security staff and admin.
 Time Efficient

Gantt Chart
System Analysis

Event Table

Login

Events Activity Source Trigger Response Destination


Login Logging In Admin, Validate and Login Admin,
Security if successful Successfully/ Security
Staff redirect to Unsuccessful Staff
respective
Home Page
Logout Logging out Admin, Redirect to You have Admin,
Security Login Page Logout Security
Staff Staff

Front-end

Events Activity Source Trigger Response Destination


View Display all Admin/Security Get all Listing and Admin/Security
Outlaws outlaw Staff outlaw view page of Staff
outlaw
Add Add New Admin Save Details New Outlaw Admin
Outlaws Outlaws added
Update Update Admin Update Success/ Admin
Outlaws Outlaws Details Unsuccessful
detail
Delete Remove Admin Delete Deleted Admin
Outlaw Outlaw Outlaw Successfully
Add Admin Add New Admin Save Details Success/ Admin
Admin Unsuccessful
Update Edit Admin Admin Update Success/ Admin
Admin Details Changes Unsuccessful
Delete Remove Admin Delete Deleted Admin
Admin Admin Admin Successfully
Notification View Admin/Security Retrieve Shows only Admin/Security
Notification Staff suspect data specific Staff
by role and notification
state, auto-
refresh page
every 10
seconds.
View All Display all Security Staff On click of Success/ Security Staff
Airport airports action button Unsuccessful
with action change
button status as
active or
inactive
Add Fill airport Security Staff Save Details Success/ Security Staff
Airport details Unsuccessful
View All Display all Security Staff On click of Success/ Security Staff
Devices device with action button Unsuccessful
action change
button status as
active or
inactive
Add Fill device Security Staff Save Details Success/ Security Staff
Device details with Unsuccessful
respect to
the airport

Security Panel

Events Activity Source Trigger Response Destination


Login Check Security Validate Login Security
credential Staff Credential Successfully/ Staff
and check Unsuccessful
Capture Take Picture Security Machine All Clear/ Security
Staff Learning Alert(Buzzer Staff/ If
or Pop-up) bandit found
notify admin
Sequence Diagram

Registration

Login
Admin Panel

Admin Panel
Security Panel

Use Case Diagram

Admin Use Case


Security Staff Use Case
Entity Relation Diagram
Code
Route - web.php
<?php

use App\Http\Controllers\ProfileController;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\AdminController;
use App\Http\Controllers\SuspectController;
use App\Http\Controllers\AirportController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
return view('welcome');
});

require __DIR__.'/auth.php';

Route::get('/login', [LoginController::class, 'login']);


Route::post('/auth', [LoginController::class, 'auth']);
Route::get('/logout', [LoginController::class, 'logout']);

Route::middleware('auth.session')->group(function () {
Route::get('/all-admin',[AdminController::class, 'allAdmin']);
Route::get('/add-admin',[AdminController::class, 'addAdmin']);
Route::post('/store-admin',[AdminController::class, 'storeAdmin']);
Route::get('/edit-admin/{id}', [AdminController::class, 'editAdmin']);
Route::post('/update-admin', [AdminController::class, 'updateAdmin']);
Route::get('/delete-admin/{id}', [AdminController::class, 'deleteAdmin']);

Route::get('/all-suspect',[SuspectController::class, 'allSuspect']);
Route::get('/add-suspect',[SuspectController::class, 'addSuspect']);
Route::post('/get-city',[SuspectController::class, 'getCity']);
Route::post('/store-suspect',[SuspectController::class, 'storeSuspect']);
Route::get('/view-suspect/{id}', [SuspectController::class, 'viewSuspect']);
Route::get('/edit-suspect/{id}', [SuspectController::class, 'editSuspect']);
Route::post('/update-suspect', [SuspectController::class, 'updateSuspect']);
Route::get('/delete-suspect/{id}', [SuspectController::class,
'deleteSuspect']);

Route::get('/all-airport',[AirportController::class, 'allAirport']);
Route::get('/add-airport',[AirportController::class, 'addAirport']);
Route::post('/store-airport',[AirportController::class, 'storeAirport']);
Route::get('/status-airport/{id}',[AirportController::class,
'statusAirport']);
Route::get('/edit-airport/{id}', [AirportController::class, 'editAirport']);
Route::post('/update-airport', [AirportController::class, 'updateAirport']);

Route::get('/all-device',[AirportController::class, 'allDevice']);
Route::get('/add-device',[AirportController::class, 'addDevice']);
Route::post('/store-device',[AirportController::class, 'storeDevice']);
Route::get('/status-device/{id}',[AirportController::class, 'statusDevice']);

Route::get('/notification',[SuspectController::class, 'notification']);
Route::get('/get-notification',[SuspectController::class, 'getNotification']);
});

Main.py

from tkinter import *


import tkinter as tk
import mysql.connector
from functools import partial
from PIL import Image, ImageTk
import cv2
import face_recognition
from pygame import mixer
import os
import shutil
import random
import threading

mixer.init()
class CameraApp:
def __init__(self, window, window_title):
self.window = window
self.window.title(window_title)

# Create a button
self.btn_snapshot = tk.Button(window, text="Capture", width=20, command=self.snapshot)
self.btn_snapshot.pack(anchor=tk.CENTER, expand=True)

# Open the camera


self.cap = cv2.VideoCapture(0)
self.video_display = tk.Label(window)
self.video_display.pack(anchor=tk.CENTER, expand=True)

self.update_camera()

self.window.mainloop()

def update_camera(self):
ret, frame = self.cap.read()
if ret:
self.photo = ImageTk.PhotoImage(image=Image.fromarray(cv2.cvtColor(frame,
cv2.COLOR_BGR2RGB)))
self.video_display.config(image=self.photo)
self.video_display.image = self.photo
self.window.after(10, self.update_camera)

def play_sound(self,suspect):
alert=tk.Tk()
alert.title("Alert")

suspect_name=str(suspect[1])
msg="This is an alert! Suspect " + suspect_name + " has been found"
label=tk.Label(alert,text=msg)
label.pack()
button=tk.Button(alert,text="Close",command=lambda: alert.destroy())
button.pack()
mixer.music.load('alarm.wav')
mixer.music.play()
alert.mainloop()

def snapshot(self):
ret, frame = self.cap.read()
if ret:
cv2.imwrite("snapshot.jpg", frame)
folder_path =
"C:\\xampp\\htdocs\\Laravel\\Outlaws_Detection\\storage\\app\\public\\uploads\\suspect"
image_encodings = []

for filename in image_names:


# for filename in os.listdir(folder_path):
image_path = os.path.join(folder_path, filename)
image = face_recognition.load_image_file(image_path)
try:
face_encoding = face_recognition.face_encodings(image)[0]
image_encodings.append(face_encoding)
except IndexError:
print(f"No face detected in {filename}. Skipping...")

# Load unknown image


unknown_image = face_recognition.load_image_file("snapshot.jpg")
try:
unknown_face_encoding = face_recognition.face_encodings(unknown_image)[0]
except IndexError:
print("No face detected. Please click Again")
alert=tk.Tk()
alert.title("Alert")
msg="No face detected. Please click Again"
label=tk.Label(alert,text=msg)
label.pack()
button=tk.Button(alert,text="Close",command=lambda: alert.destroy())
button.pack()
alert.mainloop()
# Compare faces
results=face_recognition.face_distance(image_encodings,unknown_face_encoding)
min=results.min()
# Compare faces
# results = face_recognition.compare_faces(image_encodings, unknown_face_encoding,.6)
threshold=.6
found_suspect=""
# Check results
isNotSuspect = True
for i,result in enumerate(results):
if result < threshold and result == min:
found_suspect=image_names[i]
sql="SELECT * FROM suspect WHERE image_name = %s"
cursor.execute(sql,[found_suspect])
suspect=cursor.fetchone()
if (suspect):
isNotSuspect = False
suspect_id=suspect[0]

source_image="C:\\Users\\LEGION\\PycharmProjects\\Outlaws_Detection\\snapshot.jpg"

destination_folder="C:\\xampp\\htdocs\\Laravel\\Outlaws_Detection\\storage\\app\\public\\uploads\\f
ound_suspect"
random_name=''.join(

random.choices('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789
0',k=10))

# Get the file extension of the source image


file_extension=os.path.splitext(source_image)[1]

# Construct the destination path with the random name and original extension
destination_image=os.path.join(destination_folder,random_name + file_extension)

# Copy the image to the destination folder with the random name
shutil.copy(source_image,destination_image)
suspect_image_name=os.path.basename(destination_image)
# insert in suspect notification table and alert stuffs
f=open("C:\\xampp\\htdocs\\Laravel\\Outlaws_Detection\\storage\\app\\file.txt","r")
token=f.read()
sql="SELECT * FROM devices WHERE token = %s"
cursor.execute(sql,[token])
devices=cursor.fetchone()
device_id=devices[0]

sql_insert="INSERT INTO notification (device_id, suspect_id, suspect_image_name)


VALUES (%s, %s, %s)"
record=(device_id,suspect_id,suspect_image_name)
cursor.execute(sql_insert,record)
conn.commit()
# buzzer or silent
suspect_alert_mode=suspect[6]

if (suspect_alert_mode == "buzzer"):
threading.Thread(target=self.play_sound(suspect)).start()
break
else:
alert=tk.Tk()
alert.title("Alert")

suspect_name=str(suspect[1])
msg="This is an alert! Suspect " + suspect_name + " has been found"
label=tk.Label(alert,text=msg)
label.pack()
button=tk.Button(alert,text="Close",command=lambda: alert.destroy())
button.pack()
alert.mainloop()
else:
# continue
print("not found")
if(isNotSuspect):
alert=tk.Tk()
alert.title("")
msg="All Clear!"
label=tk.Label(alert,text=msg)
label.pack()
button=tk.Button(alert,text="Close",command=lambda: alert.destroy())
button.pack()
alert.mainloop()
def validateLogin(username, password):
username = username.get()
password = password.get()
sql = "SELECT * FROM user WHERE username = %s and password = %s and role
='security_staff' and status ='1'"
cursor.execute(sql,[(username),(password)])
# cursor.execute(sql, ['airport1@gmail.com', '1234'])
record = cursor.fetchone()
if record:
f = open("C:\\xampp\\htdocs\\Laravel\\Outlaws_Detection\\storage\\app\\file.txt", "r")
token = f.read()
sql = "SELECT * FROM devices WHERE token = %s and status ='1'"
cursor.execute(sql,[(token)])
record = cursor.fetchone()
if record:
msgLabel = Label(tkWindow, text="Successfully Logged in", fg="green", font=('arial',
12)).grid(row=8, column=1)
tkWindow.destroy()
root = tk.Tk()
app = CameraApp(root, "Camera App")
#Open new window -> open camera and detect
else:
emptyLabel=Label(tkWindow,text="Invalid User",fg="red",font=('arial',12))
emptyLabel.grid(row=4,columnspan=2)

else:
emptyLabel=Label(tkWindow,text="Invalid User",fg="red",font=('arial',12))
emptyLabel.grid(row=4,columnspan=2)
return

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='outlaws_detection')
cursor = conn.cursor()
sql = "SELECT * FROM suspect WHERE status ='1'"
cursor.execute(sql)
records = cursor.fetchall()
image_names = []

# Loop through the fetched records and extract image_name column


for record in records:
#check all_states == 1
if(record[15] == "1"):
image_names.append(record[8])
else:
f = open("C:\\xampp\\htdocs\\Laravel\\Outlaws_Detection\\storage\\app\\file.txt", "r")

token = f.read()
sql = "SELECT a.state_id FROM devices AS d INNER JOIN airport AS a ON d.airport_id = a.id
WHERE d.token = %s"
cursor.execute(sql, [token])
devices = cursor.fetchone()
state_id = devices[0]
sql = "SELECT suspect_id FROM wanted_states WHERE state_id = %s"
cursor.execute(sql,[state_id])
wanted_states = cursor.fetchall()
suspect_ids = [wanted_state[0] for wanted_state in wanted_states]
if(suspect_ids):
sql = "SELECT image_name FROM suspect WHERE status ='1' AND id IN (%s)"
if suspect_ids:
placeholders = ', '.join(['%s' for _ in suspect_ids])
else:
placeholders = '%s'
sql = sql % placeholders
cursor.execute(sql, suspect_ids)
results = cursor.fetchall()
for result in results:
image_names.append(result[0])
# image_names.append()

# Window
tkWindow = Tk()
tkWindow.title('Airport Security Staff Login')

# Load the image


img = Image.open("airport_security.jpg")
img = img.resize((150, 150))

# Convert the image to PhotoImage


photo = ImageTk.PhotoImage(img)

# Display the image


imageLabel = Label(tkWindow, image=photo)
imageLabel.grid(row=0, columnspan=2, padx=10, pady=10)

# Heading label
titleLabel = Label(tkWindow, text="Airport Security Staff Login", font=('arial', 14, 'bold'))
titleLabel.grid(row=1, columnspan=2, pady=5)

# Username label and text entry box


usernameLabel = Label(tkWindow, text="User Name:", font=('arial', 12))
usernameLabel.grid(row=2, column=0, padx=10, pady=5)
username = StringVar()
usernameEntry = Entry(tkWindow, textvariable=username, width=30)
usernameEntry.grid(row=2, column=1, padx=10, pady=5)
# Password label and password entry box
passwordLabel = Label(tkWindow, text="Password:", font=('arial', 12))
passwordLabel.grid(row=3, column=0, padx=10, pady=5)
password = StringVar()
passwordEntry = Entry(tkWindow, textvariable=password, show='*', width=30)
passwordEntry.grid(row=3, column=1, padx=10, pady=5)

# Empty label for spacing


emptyLabel = Label(tkWindow, text="", font=('arial', 12))
emptyLabel.grid(row=4, columnspan=2)

validateLogin = partial(validateLogin, username, password)

# Login button
loginButton = Button(tkWindow, text="Login", command=validateLogin, font=('arial', 12))
loginButton.grid(row=5, columnspan=2, pady=10)

# Calculate window size based on content


window_width = max(imageLabel.winfo_reqwidth(), titleLabel.winfo_reqwidth())
window_height = imageLabel.winfo_reqheight() + titleLabel.winfo_reqheight() + 100 # Extra
padding

# Set window size


tkWindow.geometry("350x350")

tkWindow.mainloop()
Design
Front-end Login Page:

All Suspects

All Admin
Add Suspect

Add Admin

Notification
Edit Suspect

View Suspect

Edit Admin
Add Airport

All Airport

Edit Airport

Add Device

All Device
Security Panel

Login -

Live Camera -

Pop-up Alert -
Future Scope
Since the OpenCV library has high accuracy, we can simply embed the application in any
sector. For home surveillance one can feed the system with intruder images. By using high
quality camera and strong algorithm we can verify the person from distance. More the
security more the safety and less the crime.

To improve even more accuracy, we need to pass many images of same person so that we can
train and test the model, which will be giving high accuracy. As we just pass single image of
a person the model may confuse and may detect wrong person.

To improve the experience, we can check in live basis like there will be no staffs as the
person scans their boarding pass image will be taken and compared against the photos of
bandit that is already available – this is the process that will be everyone looking for.
But to improvise more we can also make our system smarter such as all the CCTV cameras
will capture the data in live basis and check is the bandit is found or not. If found, then
camera will keep track of them and keep on updating the system also admin and security staff
in such a way that bandit will have no idea that others are alert of them.
References

[1] https://www.sciencedirect.com/science/article/pii/S2666285X21000728
[2] https://www.scirp.org/journal/paperinformation.aspx?paperid=108333
[3] https://learningopencv.wordpress.com/2010/05/23/opencv-structure-and-content-
overview/
[4] https://pypi.org/project/face-recognition/

You might also like