Criminal Detection
Criminal Detection
Identification System
Submitted by
SADAF KHAN
[EA2332251010555]
DIRECTORATE OF ONLINE
EDUCATION SRM INSTITUTE OF SCIENCE
AND TECHNOLOGY
KATTANKULATHUR
BONAFIDE CERTIFICATE
SADAF KHAN
SADAF KHAN
CONTENTS
*Acknowledgement
*Abstract
1. INTRODUCTION
1.1 Organization Profile
1.2 Face Identification
2. SYSTEM ANALYSIS
2.1 Existing System
2.2 Proposed System
2.3 Feasibility Study
3. MODULE DESCRIPTION
3.1 Add Image
3.2 Construct Image
3.3 Identification
3.4 Sample
3.5 Training
4. SYSTEM REQUIREMENTS
4.1 Software Requirements
4.2 Hardware Requirements
5. OVERVIEW OF PYTHON
6. MYSQL – INTRODUCTION
7. SYSTEM DESIGN
5.1 Detailed Design
5.1.1 UML Diagrams
5.2 Database Design
5.2.1 Dataflow Diagrams
5.2.2 Database Tables
5.2.3 Screens.
8. TESTING
9. IMPLEMENTATION
10. CONCLUSION
11. BIBLIOGRAPHY
INTRODUCTION
Face recognition is one of the few biometric methods that possess the
merits of both accuracy and low intrusiveness.For this reason since the
early 70s, face recognition has drawn the attention of researchers in
fields from security and image processing to computer vision. Face
recognition has also proven useful in multimedia information
processing areas. Face recognition is the task of identifying an already
detected object as a known or unknown face. Often the problem of
face recognition is confused with the problem of face detection. On the
other hand is to decide if the face is someone known, or unknown,
using for this purpose a database of faces in order to validate this input
face. This project main objective is to create an efficient architecture
for face recognition in playing videos using Neural Network. This
product which two self contained Neural Network (CNNs) which are
used to detect and recognize faces in regions containing a dense
grouping of features from Accelerated Segment Test (FAST).
Determining if the image of the face of any given person matches any
of the face images stored in a database. This problem is hard to solve
automatically due to the changes that various factors, such as facial
expression, aging and even lighting, can cause on the image. Among the
different biometric techniques facial recognition may not be the most
reliable but it has several advantages over the others[2].It is widely
used in various areas such as security and access control, forensic
medicine, police controls and in attendance management system. The
various techniques for
marking person are: 1) Signature based System 2) Finger print based
System 3) Iris Recognition 4) RFID based System 5) Face Recognition
Amongst the above techniques, Face Recognition is natural, easy to use
and does not require aid from the test subject.. It is a series of several
related problems which are solved step by step: 1. To capture a picture
and discern all the faces in it. 2.Concentrate on one face at a time and
understand that even if a face is turned in a strange direction or in bad
lighting, it is still the same person. 3. Determine various unique features
of the face that can help in distinguishing it from the face of any other
person. These characteristics could be the size eyes, nose, length of
face, skin colour, etc. 4. Compare these distinctive features of that face
to all the faces of people we already know to find out the persons
name. Our brain, as a human is made to do all of this automatically and
instantaneously. Computers are incapable of this kind of high-level
generalization, so we need to teach or program each step of face
recognition separately. Face recognition systems fall into two
categories: verification and identification. Face verificat
Identification can be done in various ways like finger print, eyes, DNA
etc. One in all applications
automatic face recognition system for criminal info was proposed using
known Principal
Component Analysis approach. And there implementation of this
techniques are going to be ready
April 2014.
APPLICATIONS
124
the camera with the pictures of the Criminals which are stored in the
database. There system has
a distance and web cams. They implemented improved PCA rule that
removes facial expressions
APPLICATIONS
126
physical and chemical processing techniques and saved as the
database. This images collected
from the crime scene are usually incomplete and hence difficult to
categorize. So they
images. Trivial details are extracted from the fingerprint images. The
features of preprocessed data
are fed into the CNN as input to train and test the network. So there
experimental results
The development of face identification has been past from the year to
years. In recent years to identify any student face they used to make a
sketch or draw a image based on the eyewitnesses. It used to take more
amount of time and it was very difficult task for any investigation
department to easily catch the students within a stipulated time. In order
to catch the students first they used to search their record whether to find
out is there any record about that particular person in the past. In olden
days each and every record was maintained in the books or registers or
files which used to contain information about previous students with
their names, alias name, gender, age, crime involved, etc. Here each and
every task used to take the help of the person because they used to write
in them and it needed very much of manual effort.
There are three major research groups, which propose three different
approaches to the face recognition problem. The largest group has dealt
with facial characteristics. The second group performs human face
identification based on feature vectors extracted from profile silhouettes.
The third group uses feature vectors extracted from a frontal view of the
face. The first method is based on the information theory concepts in
other words on the principal component analysis methods. In this
approach, the most relevant information that best describes a face is
derived from the entire face image. The second method is based on
extracting feature vectors from the basic parts of a face such as eyes,
nose, mouth and chin.
DRAWBACKS IN EXISTING SYSTEM:
PROPOSED SYSTEM
FEASIBILITY STUDY
TECHNICAL FEASIBILITY
In Technical Feasibility study, one has to test
Whether the proposed system can be developed using existing
technology or not. It is planned to implement the proposed system using
java technology. It is evident that the necessary hardware and software
are available for development and implementation of the proposed
system. Hence, the solution is technically feasible.
ECONOMICAL FEASIBILITY
OPERATIONAL FEASIBILITY
It is a standard that ensures interoperability
Without stifling competition and innovation among users, to the benefit
of the public both in terms of cost and service quality. The proposed
system is acceptable to users. So the proposed system is operationally
feasible.
MODULES
Add Image
Clip Image
Construct Image
Identification
A module is a small part of our project. This plays a very important role
in the project and in coding concepts. In Software Engineering concept
we treat it has a small part of a system but whereas in our programming
language it is a small part of the program, which we also called as
function in, some cases which constitute the main program.
IDENTIFICATION
SOFTWARE REQUIREMENTS:
HARDWARE REQUIREMENTS:
Processor : Pentium IV
RAM : 256MB
OVERVIEW OF PYTHON
Python was developed by Guido van Rossum in the late eighties and
early nineties at the National Research Institute for Mathematics and
Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, Modula-
3, C, C++, Algol-68, Smalltalk, and Unix shell and other scripting
languages.
Python is copyrighted. Like Perl, Python source code is now available
under the GNU General Public License (GPL).
Python is now maintained by a core development team at the institute,
although Guido van Rossum still holds a vital role in directing its
progress.
Python Features
Python's features include −
Easy-to-learn − Python has few keywords, simple structure,
and a clearly defined syntax. This allows the student to pick
up the language quickly.
Easy-to-read − Python code is more clearly defined and
visible to the eyes.
Easy-to-maintain − Python's source code is fairly easy-to-
maintain.
A broad standard library − Python's bulk of the library is
very portable and cross-platform compatible on UNIX,
Windows, and Macintosh.
Interactive Mode − Python has support for an interactive
mode which allows interactive testing and debugging of
snippets of code.
Portable − Python can run on a wide variety of hardware
platforms and has the same interface on all platforms.
Extendable − You can add low-level modules to the Python
interpreter. These modules enable programmers to add to or
customize their tools to be more efficient.
Databases − Python provides interfaces to all major
commercial databases.
GUI Programming − Python supports GUI applications that
can be created and ported to many system calls, libraries and
windows systems, such as Windows MFC, Macintosh, and
the X Window system of Unix.
Scalable − Python provides a better structure and support for
large programs than shell scripting.
Apart from the above-mentioned features, Python has a big list of good
features, few are listed below −
It supports functional and structured programming methods
as well as OOP.
It can be used as a scripting language or can be compiled to
byte-code for building large applications.
It provides very high-level dynamic data types and supports
dynamic type checking.
It supports automatic garbage collection.
It can be easily integrated with C, C++, COM, ActiveX,
CORBA, and Java.
Getting Python
Installing Python
Windows Installation
Setting up PATH
To add the Python directory to the path for a particular session in Unix −
In the csh shell − type setenv PATH
"$PATH:/usr/local/bin/python" and press Enter.
In the bash shell (Linux) − type export
PATH="$PATH:/usr/local/bin/python" and press Enter.
In the sh or ksh shell − type
PATH="$PATH:/usr/local/bin/python" and press Enter.
Note − /usr/local/bin/python is the path of the Python
directory
Setting path at Windows
To add the Python directory to the path for a particular session in
Windows −
At the command prompt − type path %path%;C:\Python and press
Enter.
Note − C:\Python is the path of the Python directory
MySQL – Introduction
What is a Database?
A database is a separate application that stores a collection of data. Each
database has one or more distinct APIs for creating, accessing,
managing, searching and replicating the data it holds.
Other kinds of data stores can also be used, such as files on the file
system or large hash tables in memory but data fetching and writing
would not be so fast and easy with those type of systems.
Nowadays, we use relational database management systems (RDBMS)
to store and manage huge volume of data. This is called relational
database because all the data is stored into different tables and relations
are established using primary keys or other keys known as Foreign
Keys.
A Relational Database Management System (RDBMS) is a software
that −
Enables you to implement a database with tables, columns
and indexes.
Guarantees the Referential Integrity between rows of various
tables.
Updates the indexes automatically.
Interprets an SQL query and combines information from
various tables.
RDBMS Terminology
MySQL is a fast, easy-to-use RDBMS being used for many small and
big businesses. MySQL is developed, marketed and supported by
MySQL AB, which is a Swedish company. MySQL is becoming so
popular because of many good reasons −
MySQL is released under an open-source license. So you
have nothing to pay to use it.
MySQL is a very powerful program in its own right. It
handles a large subset of the functionality of the most
expensive and powerful database packages.
MySQL uses a standard form of the well-known SQL data
language.
MySQL works on many operating systems and with many
languages including PHP, PERL, C, C++, JAVA, etc.
MySQL works very quickly and works well even with large
data sets.
MySQL is very friendly to PHP, the most appreciated
language for web development.
MySQL supports large databases, up to 50 million rows or
more in a table. The default file size limit for a table is 4GB,
but you can increase this (if your operating system can handle
it) to a theoretical limit of 8 million terabytes (TB).
MySQL is customizable. The open-source GPL license
allows programmers to modify the MySQL software to fit
their own specific environments.
Now, you will need to adhere to the steps given below, to proceed with
the installation −
You can find all the MySQL related binaries in /usr/bin and /usr/sbin.
All the tables and databases will be created in the /var/lib/mysql
directory.
The following code box has an optional but recommended step to install
the remaining RPMs in the same manner −
The default installer setup.exe will walk you through the trivial process
and by default will install everything under C:\mysql.
Test the server by firing it up from the command prompt the first time.
Go to the location of the MySQL server which is probably C:\mysql\bin,
and type −
mysqld.exe --console
NOTE − If you are on NT, then you will have to use mysqld-nt.exe
instead of mysqld.exe
If all went well, you will see some messages about startup and inorb. If
not, you may have a permissions issue. Make sure that the directory that
holds your data is accessible to whatever user (probably MySQL) the
database processes run under.
MySQL will not add itself to the start menu, and there is no particularly
nice GUI way to stop the server either. Therefore, if you tend to start the
server by double clicking the MySQL executable, you should remember
to halt the process by hand by using mysqladmin, Task List, Task
Manager, or other Windows-specific means.
[root@host]# mysql
It should be rewarded with a mysql> prompt. Now, you are connected to
the MySQL server and you can execute all the SQL commands at the
mysql> prompt as follows −
/etc/init.d/mysqld start
First check if your MySQL server is running or not. You can use the
following command to check it −
ps -ef | grep mysqld
If your MySql is running, then you will see mysqld process listed out in
your result. If server is not running, then you can start it by using the
following command −
root@host# cd /usr/bin
./safe_mysqld&
Now, if you want to shut down an already running MySQL server, then
you can do it by using the following command −
root@host# cd /usr/bin
./mysqladmin -u root -p shutdown
Enter password: ******
For adding a new user to MySQL, you just need to add a new entry to
the user table in the database mysql.
The following program is an example of adding a new user guest with
SELECT, INSERT and UPDATE privileges with the
password guest123; the SQL query is −
root@host# mysql -u root -p
Enter password:*******
mysql>usemysql;
Database changed
mysql> GRANT
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON TUTORIALS.*
-> TO 'zara'@'localhost'
-> IDENTIFIED BY 'zara123';
This will also create an entry in the MySQL database table called
as user.
NOTE − MySQL does not terminate a command until
you give a semi colon (;) at the end of the SQL command.
The /etc/my.cnf File Configuration
In most of the cases, you should not touch this file. By
default, it will have the following entries −
[mysqld]
datadir=/var/lib/mysql
socket =/var/lib/mysql/mysql.sock
[mysql.server]
user =mysql
basedir=/var/lib
[safe_mysqld]
err-log =/var/log/mysqld.log
pid-file =/var/run/mysqld/mysqld.pid
Here, you can specify a different directory for the error
log, otherwise you should not change any entry in this
table.
DATA FLOW DIAGRAMS:
A graphical tool used to describe and analyze the moment of data
through a system manual or automated including the process, stores of
data, and delays in the system. Data Flow Diagrams are the central tool
and the basis from which other components are developed. The
transformation of data from input to output, through processes, may be
described logically and independently of the physical components
associated with the system. The DFD is also know as a data flow graph
or a bubble chart.
CONTEXT DIAGRAM:
The top-level diagram is often called a “context diagram”. It contains a
single process, but it plays a very important role in studying the current
system. The context diagram defines the system that will be studied in
the sense that it determines the boundaries. Anything that is not inside
the process identified in the context diagram will not be part of the
system study. It represents the entire software element as a single
bubble with input and output data indicated by incoming and outgoing
arrows respectively.
TYPES OF DATA FLOW DIAGRAMS:
Data Flow Diagrams are of two types as follows:
1. PHYSICAL DFD:
Structured analysis states that the current system should be first
understand correctly. The physical DFD is the model of the current
system and is used to ensurethat the current system has been clearly
understood. Physical DFDs shows actual devices, departments, and
people etc., involved in the current system
2. LOGICAL DFD:
Logical DFDs are the model of the proposed system. They clearly
should show the requirements on which the new system should be
built. Later during design activity this is taken as the basis for
drawing the system’s structure charts.
BASIC NOTATION:
LOGIN PROCESS
LOGIN
User IPdROCESS SCREEN
Password
ERROR IN
Level-1
MAIN SCREEN
OPERATOR ADD IMAGE
SEARCH IMAGE
CLIP IMAGE
CONSTRUCT IMAGE
Level -2
DATABASE
ADD PROCESS
OPERATOR DATA IS ADDED
ERROR
Level-3
Description:This process clearly illustrates adding the details
of the student such as name, alias name, age, gender, location,
address, state and city along with his photo. These details are
being added to the database, if any error is generated then it will
be prompted to the operator otherwise we get message data is
successfully added.
DATABASE
DATABASE
EYES
NOSE
FACE
FACE
HAIR
FOREHEAD
Level-4
Description: This is used for clipping the image into different
slices say eyes, forehead, lips, hair and nose. The input for this is
face which is divided into some slices which are stored in the
database. Even though the image is divided into slices, the
original image remains as it is.
UPDATE PROCESS
DATABASE
UPDATE PROCESS
DATA UPDATED
OPERATOR
Level-5
Description: Update process is mainly used for updating or
modifying the details of the student or person. This is used in
situation where we have entered the details incorrectly or we
want to add some new details.
Level-6
Description: Based on the instruction given by the
eyewitnesses, the operator brings the clips of the images from
the database and then goes for the construction of the image
based on those clips.
COMPARISON PROCESS
DATABASE
RESULT
FACE COMPARISON PROCESS
Level-7
Description: The face that is constructed in the above
process is sent to the comparison process where it
searches the image in the database.
DATABASE TABLES
D.O.B Date
Age Number 5
Gender Varchar2 15
Address Varchar2 15
City Varchar2 15
State Varchar2 15
Arrested Date
Date Varchar2 15
Crime Varchar2 15
Involved In
Photo
SOURCE CODE
WELCOME PAGE:-
from tkinter import *
import time
import calendar
t.geometry("1600x800+0+0")
t.config(bg="DarkOrange1")
st=Style()
st.configure('W.TButton',font=('Arial!',25,'bold','underline'),foreground
='red',background='black',borderwidth = '4')
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=120)
ll=Label(t) img=Image.open(r"cimage\
realtime-bso.jpg")
img=img.resize((200,100))
img=ImageTk.PhotoImage(img)
ll.config(image=img)
ll.image=img
ll.place(x=5,y=10,width=200,height=100)
#---ICON_IMAGE---
icon1=Label(t)
icon1.place(x=100,y=125)
# Rotaion photo
x=1
def
a():
global x img=Image.open(r"cimage\
a"+str(x)+".jpg")
img=img.resize((1300,650))
img=ImageTk.PhotoImage(img)
icon1.config(image=img)
icon1.image=img
x=x+1
t.after(1000,a)
if x==7:
x=1
a()
def clock():
h=str(time.strftime("%H"))
m=str(time.strftime("%M"))
s=str(time.strftime("%S"))
dd=str(time.strftime("%d"))
mm=int(time.strftime("%m"))
yy=int(time.strftime("%y"))
lbldate.config(text=dd)
lblmonth.config(text=str(mm))
lblyear.config(text=str(yy))
lblnoon.config(text="PM")
if int(h)>12:
h=str((int(h)-12))
lblhr.config(text=h)
lblmin.config(text=m)
lblsec.config(text=s)
lblhr.after(200,clock)
lblhr=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblhr.place(x=1260,y=120,width=60,height=40)
lbldate=Label(t,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lbldate.place(x=1260,y=170,width=60,height=40)
lblmin=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmin.place(x=1330,y=120,width=60,height=40)
lblmonth=Label(t,text="Month",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmonth.place(x=1330,y=170,width=60,height=40)
lblsec=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblsec.place(x=1400,y=120,width=60,height=40)
lblyear=Label(t,text="Year",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblyear.place(x=1400,y=170,width=60,height=40)
lblnoon=Label(t,text="AM",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblnoon.place(x=1470,y=120,width=60,height=40)
lblcurrent=Label(t,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblcurrent.place(x=1470,y=170,width=60,height=40)
def launchLogin():
lg()
clock()
# start button
def next1():
lg()
b=Button(t,text="Töuch
M€!!!",style='W.TButton',command=launchLogin)
b.place(x=1250,y=730)
LOGIN PAGE:-
import mysql.connector
import mysql.connector as c
import time
import calendar
def lg():
t=Toplevel()
t.geometry("1600x1600+0+0")
t.title("Login!!!")
st=Style()
l=Label(t)
img=Image.open(r"cimage\b4.JPg")
img=img.resize((1600,700))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=0,y=105)
titlelbl.place(x=0,y=0,width=1600,height=120)
ll=Label(t) img2=Image.open(r"cimage\
realtime-bso.jpg")
img2=img2.resize((200,100))
img2=ImageTk.PhotoImage(img2)
ll.config(image=img2)
ll.image=img2
ll.place(x=5,y=10,width=200,height=100)
lll=Label(t) img3=Image.open(r"libimage\
logobg.jpg") img3=img3.resize((800,400))
img3=ImageTk.PhotoImage(img3)
lll.config(image=img3)
lll.image=img3
lll.place(x=385,y=400)
# Time and Date
def clock():
h=str(time.strftime("%H"))
m=str(time.strftime("%M"))
s=str(time.strftime("%S"))
dd=str(time.strftime("%d"))
mm=int(time.strftime("%m"))
yy=int(time.strftime("%y"))
lbldate.config(text=dd)
lblmonth.config(text=str(mm))
lblyear.config(text=str(yy))
lblnoon.config(text="PM")
if int(h)>12:
h=str((int(h)-12))
lblhr.config(text=h)
lblmin.config(text=m)
lblsec.config(text=s)
lblhr.after(200,clock)
lblhr=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblhr.place(x=640,y=190,width=60,height=40)
lbldate=Label(t,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lbldate.place(x=640,y=240,width=60,height=40)
lblmin=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmin.place(x=710,y=190,width=60,height=40)
lblmonth=Label(t,text="Month",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmonth.place(x=710,y=240,width=60,height=40)
lblsec=Label(t,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblsec.place(x=780,y=190,width=60,height=40)
lblyear=Label(t,text="Year",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblyear.place(x=780,y=240,width=60,height=40)
lblnoon=Label(t,text="AM",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblnoon.place(x=850,y=190,width=60,height=40)
lblcurrent=Label(t,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblcurrent.place(x=850,y=240,width=60,height=40)
clock()
#=================Heading content==========
l1.place(x=665,y=410)
#=======TEXT AREA==============
l1=Label(t,text="* User Id
:",font='18',background="black",foreground="red")
l1.place(x=550,y=520)
t1=Entry(t,font="bold")
t1.place(x=700,y=520,width=320)
l2=Label(t,text="* Password
:",font='18',background="black",foreground="red")
l2.place(x=550,y=590)
t2=Entry(t,font="bold")
t2.place(x=700,y=590,width=320)
t2.config(show="*")
#==============MySql connectivity======================
def login():
if t1.get()=="" or t2.get()=="":
messagebox.showerror("Error","All fields are required",parent=t)
else:
try:
con=c.connect(host="localhost",user="root",password="",port="3306",
database="library_db")
cur=con.cursor()
row=cur.fetchone()
if row==None:
loginclear()
t1.focus()
else:
appscreen()
con.close()
def loginclear():
t1.delete(0,END)
t2.delete(0,END)
def appscreen():
show()
# login Button
u=Label(t)
b=Button(t,image=img)
img=Image.open(r"image\l1.jpg")
img=img.resize((152,48))
img=ImageTk.PhotoImage(img)
b.config(image=img,cursor="hand2",command=login)
b.image=img
b.place(x=550,y=640)
t2.config(show="*")
# exit Button
u1=Label(t)
b=Button(t,image=img)
img=Image.open(r"image\bc.png")
img=img.resize((154,47))
img=ImageTk.PhotoImage(img)
b.config(image=img,cursor="hand2",command=t.destroy)
b.image=img
b.place(x=850,y=640)
# Update Password
def mouseClick():
rog=Toplevel()
rog.title("Change password")
rog.geometry("500x300+530+280")
rog.iconbitmap("aa.ico")
rog.resizable(0,0)
rog.configure(bg='powder blue')
label=Label(rog,text="New
password",font=("cursive",30,'bold'),background='powder
blue',foreground='red')
label.place(x=105,y=15)
user=Label(rog,text='*User ID :',background='powder
blue',foreground='black',font=("cursive",12,'bold'))
user.place(x=40,y=95)
user.place(x=40, y=170)
e1.place(x=190, y=95,width=250,height=30)
def chan_pas():
a=e1.get()
b=e2.get()
conn=c.connect(host="localhost",user="root",password="",port="3306
", database="library_db")
cursor=conn.cursor()
#conn.commit()
data=cursor.fetchone()
if data!=None:
cursor=conn.cursor()
conn.commit()
else:
# Submit Button
s=Label(rog)
b=Button(rog,image=img)
img6=Image.open(r"libimage\Submit.png")
img6=img6.resize((150,40))
img6=ImageTk.PhotoImage(img6)
b.config(image=img6,cursor="hand2",command=chan_pas)
b.image=img6
b.place(x=170,y=240)
rog.mainloop()
# Change Password Button
o1=Label(t)
b=Button(t,image=img)
img=Image.open(r"libimage\forgotpass.png")
img=img.resize((380,45))
img=ImageTk.PhotoImage(img)
b.config(image=img,cursor="hand2",command=mouseClick)
b.image=img
b.place(x=600,y=730)
#lg()
import numpy as np
import pandas as pd
import os
import cv2
def next1():
reg()
def next2():
main()
def show():
t=Toplevel()
t.geometry("2000x1800")
t.config(bg="DarkOrange1")
t.title("FACIO")
st=Style()
#----Background Image---------
l=Label(t)
img=Image.open(r"cimage\a7.jpg")
img=img.resize((800,800))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=750,y=100,relheight=1,relwidth=1)
titlelbl=Label(t,text="AI FACIAL RECOGNITION CRIMINAL
IDENTIFICATION SYSTEM",font=("times now
roman",30,"bold"),justify=CENTER,background="black",foreground="go
ld")
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=120)
ll=Label(t) img2=Image.open(r"cimage\
realtime-bso.jpg")
img2=img2.resize((200,100))
img2=ImageTk.PhotoImage(img2)
ll.config(image=img2)
ll.image=img2
ll.place(x=5,y=10,width=200,height=100)
l1.place(x=40,y=130)
l3.place(x=50,y=235)
l4.place(x=60,y=270)
l5.place(x=85,y=305)
l6.place(x=115,y=340)
l7.place(x=140,y=375)
l7=Label(t,text="registers by other name,so while MATCH
80%",font='1000px',background="Dark Orange1")
l7.place(x=160,y=410)
l72.place(x=187,y=445)
l73.place(x=210,y=500)
l8.place(x=170,y=550)
l9.place(x=115,y=585)
l11=Label(t,text="point, including location of the eyes, eyebrows
noes, mouth, chin and ears.",font='120px',background="Dark
Orange1")
l11.place(x=75,y=620)
def TrackImages():
recognizer = cv2.face.LBPHFaceRecognizer_create()
recognizer.read("Trainner.yml")
harcascadePath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(harcascadePath)
#df = pd.read_csv("UserDetails.csv")
cam = cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_SIMPLEX
while True:
ret, im = cam.read()
(x,y),(x+w,y+h),color,2)
confidence=100*(1-conf/300)
con=c.connect(host="localhost",user="root",password="",port="3306",
database="criminal_db")
cur=con.cursor()
s_name=cur.fetchone()
s_name= ''+''.join(s_name)
if confidence>85:
#cam.release()
#cv2.destroyAllWindows()
break
elif confidence>60:
else:
noOfFile = len(os.listdir("ImageUnknown"))+1
cv2.imwrite("ImageUnknown/Image"+
cv2.imshow('im', im)
if (cv2.waitKey(1)== ord('q')):
break
cam.release()
cv2.destroyAllWindows()
# Image on Reg. Button
l=Label()
b=Button(t,image=img)
img=Image.open(r"Cimage\B2.png")
img=img.resize((770,110))
img=ImageTk.PhotoImage(img)
b.config(image=img,cursor="hand2",command=TrackImages)
b.image=img
b.place(x=750,y=700)
l=Label()
b=Button(t,image=img)
img=Image.open(r"Cimage\B1.png")
img=img.resize((250,70))
img=ImageTk.PhotoImage(img)
b.config(image=img,cursor="hand2",command=next1)
b.image=img
b.place(x=70,y=700)
l=Label()
b=Button(t,image=img)
img=Image.open(r"libimage\next.jpg")
img=img.resize((200,70))
img=ImageTk.PhotoImage(img)
b.config(image=img,cursor="hand2",command=next2)
b.image=img
b.place(x=450,y=700)
#show()
REGISTER CRIMINAL:-
import mysql.connector
import mysql.connector as c
import numpy as np
import pandas as pd
import os
import cv2
from os import listdir
import mysql.connector
import mysql.connector as
def reg():
t=Toplevel()
t.geometry("2000x1800")
t.title("Registraion")
t.config(bg="powder blue")
st=Style()
def back():
t.destroy()
#----Background Image---------
l=Label(t) img=Image.open(r"C:\Users\hp\Desktop\
img.jpg") img=img.resize((800,650))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=0,y=70)
l=Label(t) img=Image.open(r"C:\Users\hp\Desktop\
passport2.jpg") img=img.resize((200,150))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=1000,y=70)
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=70)
l=Label(t) img2=Image.open(r"cimage\realtime-
bso.jpg") img2=img2.resize((90,70))
img2=ImageTk.PhotoImage(img2)
l.config(image=img2)
l.image=img2
l.place(x=20,y=0,width=80,height=70)
frame1=Label(t,background="black")
frame1.place(x=3,y=725,width=800,height=75)
l2=Label(t,text="*ID:",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l2.place(x=840,y=230)
t2=Entry(t,width=30,font="bold")
t2.place(x=1100,y=230)
l3=Label(t,text="*Full Name:",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l3.place(x=840,y=270)
t3=Entry(t,width=30,font="bold")
t3.place(x=1100,y=270)
l4=Label(t,text="*DOB{yy/mm/dd}:",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l4.place(x=840,y=310)
t4=Entry(t,width=30,font="bold")
t4.place(x=1100,y=310)
l5=Label(t,text="*Gender:",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l5.place(x=840,y=350)
t5=Entry(t,width=30,font="bold")
t5.place(x=1100,y=350)
l6=Label(t,text="*Age :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l6.place(x=840,y=390)
t6=Entry(t,width=30,font="bold")
t6.place(x=1100,y=390)
l7=Label(t,text="*Address :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l7.place(x=840,y=430)
t7=Entry(t,width=30,font="bold")
t7.place(x=1100,y=430)
l8=Label(t,text="*Adhar Number
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l8.place(x=840,y=470)
t8=Entry(t,width=30,font="bold")
t8.place(x=1100,y=470)
l9=Label(t,text="*State :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l9.place(x=840,y=510)
t9=Entry(t,width=30,font="bold")
t9.place(x=1100,y=510)
l10=Label(t,text="*Height :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l10.place(x=840,y=550)
t10=Entry(t,width=30,font="bold")
t10.place(x=1100,y=550)
l11=Label(t,text="*Phone no :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l11.place(x=840,y=590)
t11=Entry(t,width=30,font="bold")
t11.place(x=1100,y=590)
l12=Label(t,text="*Crime Done:",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l12.place(x=840,y=630)
t12=Entry(t,width=30,font="bold")
t12.place(x=1100,y=630)
l13.place(x=840,y=670)
t13=Entry(t,width=30,font="bold")
t13.place(x=1100,y=670)
l14.place(x=840,y=710)
t14=Entry(t,width=30,font="bold")
t14.place(x=1100,y=710)
l15=Label(t,text="*Arresting Officer
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l15.place(x=840,y=750)
t15=Entry(t,width=30,font="bold")
t15.place(x=1100,y=750)
def destroy_register():
t.destroy()
def is_number(s):
try:
float(s)
return True
except ValueError:
pass
try:
import unicodedata
unicodedata.numeric(s)
return True
pass
def TrainImages():
# algorithm inside OpenCV module used for training the image dataset
recognizer = cv2.face.LBPHFaceRecognizer_create()
harcascadePath =
"haarcascade_frontalface_default.xml" # creating
detector =
cv2.CascadeClassifier(harcascadePath) # Saving
faces, id = getImagesAndLabels("data")
"trainner.yml". recognizer.train(faces,
np.array(id))
recognizer.save("Trainner.yml")
def Collecting_Samples():
else:
try:
con=c.connect(host="localhost",user="root",password="",port="3306",database=
"criminal_db")
cur=con.cursor()
row=cur.fetchall()
name =(t3.get())
id= (t2.get())
cur.execute("insert into
criminal(id,name,dob,gender,age,address,adhar,state,height,phoneno,crimedone,
arrestdate,arrestplace,arrestingofficer) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s)",
(t2.get(),t3.get(),t4.get(),t5.get(),t6.get(),t7.get(),t8.get(),t9.get(),t10.get(),t11.get(
),t12.get(),t13.get(),t14.get(),t15.get()))
con.commit()
con.close()
cam = cv2.VideoCapture(0)
harcascadePath = "haarcascade_frontalface_default.xml"
detector = cv2.CascadeClassifier(harcascadePath)
# Initializing the sample number(No. of images) as 0
sampleNum = 0
while(True):
cv2.COLOR_BGR2GRAY)
sampleNum = sampleNum + 1
# saving the captured face in the dataset folder
cv2.imwrite(
cv2.imshow('frame', img)
ord('q'): break
elif sampleNum>60:
break
cam.release()
cv2.destroyAllWindows()
# writer = csv.writer(csvFile)
# writer.writerow(row)
# message.configure(text = res)
else:
if(is_number(id)):
message.configure(text = res)
if(name.isalpha()):
message.configure(text = res)
regclear()
print(es)
def getImagesAndLabels(path):
# get the path of all the files in the folder
faces =[]
Ids =[]
# now looping through all the image paths and loading the
pilImage = Image.open(imagePath).convert('L')
id = int(os.path.split(imagePath)[-1].split(".")[1])
sample faces.append(imageNp)
Ids.append(id)
def TrackImages():
recognizer = cv2.face.LBPHFaceRecognizer_create()
# Reading the trained model
recognizer.read("Trainner.yml")
harcascadePath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(harcascadePath)
#df = pd.read_csv("UserDetails.csv")
cam = cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_SIMPLEX
while True:
ret, im = cam.read()
for(x, y, w, h) in faces:
aa = df.loc[df['id'] == id]['Name'].values
tt = str(id)+"-"+aa
else:
Id ='Unknown'
tt = str(id)
noOfFile = len(os.listdir("ImageUnknown"))+1
cv2.imwrite("Image"+
cv2.imshow('im', im)
if (cv2.waitKey(1)== ord('q')):
break
cam.release()
cv2.destroyAllWindows()
def Capture_Image():
global path
cap=cv2.VideoCapture(0)
mydb=mysql.connector.connect(host="localhost",user="root",password="",port=
"3306",database="criminal_db")
my=mydb.cursor()
res=my.execute("select count(*) from criminal")
rows=my.fetchall()
x = rows[0][0]
x+=1
while True:
rect,frame=cap.read()
cv2.imshow("MY Picture",frame)
cv2.imwrite(r"e"+str(x)+".jpg",frame)
if cv2.waitKey(1)&0xff==ord('w'):
break
cap.release()
cv2.destroyAllWindows()
img_lb=Label(t)
img_lb.place(x=1200,y=70)
path="d"+str(x)+".jpg"
img=Image.open(r"e"+str(x)+".jpg")
img=img.resize((200,150))
img=ImageTk.PhotoImage(img)
img_lb.config(image=img)
img_lb.image=img
l=Label()
b=Button(t,image=img)
img=Image.open(r"C:\Users\hp\Desktop\sample2.png")
img=img.resize((200,50))
img=ImageTk.PhotoImage(img)
b.config(image=img,command=Collecting_Samples)
b.image=img
b.place(x=20,y=730)
l=Label()
b=Button(t,image=img)
img=Image.open(r"C:\Users\hp\Desktop\collecting1.png")
img=img.resize((200,50))
img=ImageTk.PhotoImage(img)
b.config(image=img,command=Capture_Image)
b.image=img
b.place(x=300,y=730)
l=Label()
b=Button(t,image=img)
img=Image.open(r"C:\Users\hp\Desktop\training.png")
img=img.resize((200,50))
img=ImageTk.PhotoImage(img)
b.config(image=img,command=TrainImages)
b.image=img
b.place(x=575,y=730)
l=Label()
b=Button(t,image=img)
img=Image.open(r"C:\Users\hp\Desktop\back2.py.png")
img=img.resize((200,50))
img=ImageTk.PhotoImage(img)
b.config(image=img,command=back)
b.image=img
b.place(x=575,y=650)
def regclear():
t2.delete(0,END)
t3.delete(0,END)
t4.delete(0,END)
t5.delete(0,END)
t6.delete(0,END)
t7.delete(0,END)
t8.delete(0,END)
t9.delete(0,END)
t10.delete(0,END)
t11.delete(0,END)
t12.delete(0,END)
t13.delete(0,END)
t14.delete(0,END)
t15.delete(0,END)
#reg()
CRIMINAL RECORD PAGE:-
ttk
import mysql.connector
import mysql.connector as c
import time
import calendar
def main():
root = Toplevel()
root.title("Library Managment")
root.minsize(width=400,height=400)
root.geometry("1600x800+0+0")
# Backgroud image
l=Label(root) img=Image.open(r"libimage\
LIB.jpg") img=img.resize((1600,700))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=0,y=105)
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=120)
ll=Label(root) img2=Image.open(r"cimage\
realtime-bso.jpg") img2=img2.resize((200,100))
img2=ImageTk.PhotoImage(img2)
ll.config(image=img2)
ll.image=img2
ll.place(x=5,y=10,width=200,height=100)
# heading2
headingFrame1 = Frame(root,bg="#FFBB00",bd=5)
headingFrame1.place(relx=0.2,rely=0.2,relwidth=0.6,relheight=0.16)
headingLabel.config(anchor=CENTER)
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)
btn2.place(relx=0.28,rely=0.55, relwidth=0.45,relheight=0.1)
btn3.place(relx=0.28,rely=0.65, relwidth=0.45,relheight=0.1)
btn4.place(relx=0.28,rely=0.75, relwidth=0.45,relheight=0.1)
def clock():
h=str(time.strftime("%H"))
m=str(time.strftime("%M"))
s=str(time.strftime("%S"))
dd=str(time.strftime("%d"))
mm=int(time.strftime("%m"))
yy=int(time.strftime("%y"))
lbldate.config(text=dd)
lblmonth.config(text=str(mm))
lblyear.config(text=str(yy))
lblnoon.config(text="PM")
if int(h)>12:
h=str((int(h)-12))
lblhr.config(text=h)
lblmin.config(text=m)
lblsec.config(text=s)
lblhr.after(200,clock)
lblhr=Label(root,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblhr.place(x=1260,y=120,width=60,height=40)
lbldate=Label(root,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lbldate.place(x=1260,y=170,width=60,height=40)
lblmin=Label(root,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmin.place(x=1330,y=120,width=60,height=40)
lblmonth=Label(root,text="Month",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblmonth.place(x=1330,y=170,width=60,height=40)
lblsec=Label(root,text="12",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblsec.place(x=1400,y=120,width=60,height=40)
lblyear=Label(root,text="Year",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblyear.place(x=1400,y=170,width=60,height=40)
lblnoon=Label(root,text="AM",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblnoon.place(x=1470,y=120,width=60,height=40)
lblcurrent=Label(root,text="Date",font=("times new
roman",15,"bold"),background="red",foreground="white")
lblcurrent.place(x=1470,y=170,width=60,height=40)
clock()
root.mainloop()
#main()
CRIMINAL SEARCH:-
import mysql.connector
import mysql.connector as c
detail
def search():
global criminalInfo1,Canvas1,con,cur,criminal,root
root = Toplevel()
root.title("Library")
root.minsize(width=400,height=400)
root.geometry("600x500+480+290")
con =
c.connect(host="localhost",user="root",password="",port="3306",database="cri
minal_db")
cur = con.cursor()
Canvas1 = Canvas(root)
Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1 = Frame(root,bg="#FFBB00",bd=5)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.4,relwidth=0.8,relheight=0.4)
# Criminal ID
lb1.place(relx=0.05,rely=0.2, relheight=0.08)
criminalInfo1 = Entry(labelFrame)
def mouseclick():
def detail():
rog=Toplevel()
rog.geometry("2000x1800")
rog.title("Registraion")
rog.iconbitmap("aa.ico")
#rog.resizable(0,0)
rog.config(bg="powder blue")
l=Label(rog) img=Image.open(r"C:\Users\hp\Desktop\
frame2.png") img=img.resize((700,500))
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
l.place(x=0,y=150)
titlelbl.config(anchor=CENTER)
titlelbl.place(x=0,y=0,width=1600,height=120)
ll=Label(rog) img2=Image.open(r"cimage\
realtime-bso.jpg") img2=img2.resize((200,100))
img2=ImageTk.PhotoImage(img2)
ll.config(image=img2)
ll.image=img2
ll.place(x=5,y=10,width=200,height=100)
l1=Label(rog,text="Criminal
id:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l1.place(x=880,y=170)
l2=Label(rog,text="Full
Name:",font=('arial',15,"bold"),background="powder blue",foreground="dim
gray")
l2.place(x=880,y=210)
l4=Label(rog,text="DOB{yy/mm/dd}:",font=('arial',15,"bold"),background="powde
r blue",foreground="dim gray")
l4.place(x=880,y=250)
l5=Label(rog,text="Gender:",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l5.place(x=880,y=290)
l6=Label(rog,text="Age :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l6.place(x=880,y=330)
l7=Label(rog,text="Adhar Number
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l7.place(x=880,y=370)
l8=Label(rog,text="Address :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l8.place(x=880,y=410)
l9=Label(rog,text="Height :",font=('arial',15,"bold"),background="powder
blue",foreground="dim gray")
l9.place(x=880,y=450)
l10=Label(rog,text="Phone no
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l10.place(x=880,y=490)
l11=Label(rog,text="Crime Doe
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l11.place(x=880,y=530)
l12=Label(rog,text="Arresr
Date:",font=('arial',15,"bold"),background="powder blue",foreground="dim
gray")
l12.place(x=880,y=570)
l13=Label(rog,text="Arrest Place
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l13.place(x=880,y=610)
l14=Label(rog,text="Arrest Officer
:",font=('arial',15,"bold"),background="powder blue",foreground="dim gray")
l14.place(x=880,y=650)
x=criminalInfo1.get()
con=c.connect(host="localhost",user="root",password="",port="3306",
database="criminal_db")
cur=con.cursor()
rows=cur.fetchall()
# print(rows)
for i in rows:
t1=Label(rog,text=i[0],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t1.place(x=1140,y=170)
t2=Label(rog,text=i[1],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t2.place(x=1140,y=210)
t4=Label(rog,text=i[2],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t4.place(x=1140,y=210)
t5=Label(rog,text=i[3],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t4.place(x=1140,y=250)
t6=Label(rog,text=i[4],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t6.place(x=1140,y=290)
t7=Label(rog,text=i[5],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t7.place(x=1140,y=330)
t8=Label(rog,text=i[6],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t8.place(x=1140,y=370)
t9=Label(rog,text=i[7],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t9.place(x=1140,y=410)
t10=Label(rog,text=[8],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t10.place(x=1140,y=450)
t11=Label(rog,text=i[9],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t11.place(x=1140,y=490)
t12=Label(rog,text=i[10],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t12.place(x=1140,y=530)
t13=Label(rog,text=i[11],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t13.place(x=1140,y=570)
t14=Label(rog,text=i[12],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t14.place(x=1140,y=610)
t15=Label(rog,text=i[13],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t15.place(x=1140,y=650)
t16=Label(rog,text=i[14],font=('arial',15,"bold"),background="powder
blue",foreground="orange")
t16.place(x=1140,y=690)
con.commit()
con.close()
img_lb=Label(rog)
img_lb.place(x=200,y=300)
path="e"+str(x)+".jpg"
img=Image.open(r"e"+str(x)+".jpg")
img=img.resize((320,250),Image.Resampling.LANCZOS)
img=ImageTk.PhotoImage(img)
img_lb.config(image=img)
img_lb.image=img
detail()
#Submit Button
SubmitBtn = Button(root,text="SUBMIT",bg='#d1ccc0',
fg='black',command=mouseclick)
SubmitBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
#search()
CRIMINAL DETAILS :-
from tkinter import*
import mysql.connector
import mysql.connector as c
def view():
t=Tk()
t.geometry("900x500")
t.config(bg="gold")
con=c.connect(host="localhost",user="root",password="",port="3306",
database="criminal_db")
cur=con.cursor()
tree=ttk.Treeview(t)
tree['show'] = 'headings'
s = ttk.Style(t)
s.theme_use("clam")
s.configure("DLLs",font=('Helvetica',12))
s.configure("Treeview.Heading", foreground='red',font=('Helvetica',12,"bold"))
#Define no of columns
tree["columns"]=("id","name","dob","gender","age","adhar","phoneno","crimedo
ne","arrestdate","arrestingofficer")
tree.column("id",width=100,minwidth=100,anchor=CENTER)
tree.column("name",width=300,minwidth=300,anchor=CENTER)
tree.column("dob",width=100,minwidth=100,anchor=CENTER)
tree.column("gender",width=100,minwidth=100,anchor=CENTER)
tree.column("age",width=50,minwidth=50,anchor=CENTER)
tree.column("adhar",width=150,minwidth=150,anchor=CENTER)
tree.column("phoneno",width=150,minwidth=150,anchor=CENTER)
tree.column("crimedone",width=200,minwidth=200,anchor=CENTER)
tree.column("arrestdate",width=160,minwidth=160,anchor=CENTER)
tree.column("arrestingofficer",width=220,minwidth=220,anchor=CENTER)
#Assign the heading names to the respective columns
tree.heading("id",text="Criminal ID",anchor=CENTER)
tree.heading("name",text="FULL NAME",anchor=CENTER)
tree.heading("dob",text="DOB",anchor=CENTER)
tree.heading("gender",text="GENDER",anchor=CENTER)
tree.heading("age",text="AGE",anchor=CENTER)
tree.heading("adhar",text="ADHAR NO",anchor=CENTER)
tree.heading("phoneno",text="CONTACT NO",anchor=CENTER)
tree.heading("crimedone",text="CRIMEDONE",anchor=CENTER)
tree.heading("arrestdate",text="ARRESTING DATE",anchor=CENTER)
tree.heading("arrestingofficer",text="ARRESTING OFFICER",anchor=CENTER)
i=0
for ro in cur:
i = i +1
hsb = ttk.Scrollbar(t,orient="horizontal")
hsb.configure(command=tree.xview)
tree.configure(xscrollcommand=hsb.set)
hsb.pack(fill=X,side = BOTTOM)
tree.pack()
con.commit()
con.close()
#alldetail()
DELETE CRIMINAL:-
from tkinter import *
import mysql.connector
import mysql.connector as c
con =
c.connect(host="localhost",user="root",password="",port="3306",database="cri
minal_db")
cur = con.cursor()
def deletecriminal():
bid = criminalInfo1.get()
try:
cur.execute(deleteSql)
con.commit()
cur.execute(deleteIssue)
con.commit()
messagebox.showinfo('Success',"Book Record Deleted
Successfully",parent=root)
except:
criminalInfo1.delete(0, END)
root.destroy()
def deleteCriminal():
global criminalInfo1,Canvas1,con,cur,criminal,root
root = Toplevel()
root.title("Library")
#root.minsize(width=400,height=400)
root.geometry("600x500+480+290")
Canvas1 = Canvas(root)
Canvas1.config(bg="DarkOrange1")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1 = Frame(root,bg="#FFBB00",bd=5)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)
# Book ID to Delete
lb2.place(relx=0.05,rely=0.5)
criminalInfo1 = Entry(labelFrame)
criminalInfo1.place(relx=0.3,rely=0.5, relwidth=0.62)
#Submit Button
SubmitBtn = Button(root,text="SUBMIT",bg='#d1ccc0',
fg='black',command=deletecriminal)
SubmitBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)
quitBtn = Button(root,text="Quit",bg='#f7f1e3', fg='black',
command=root.destroy)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
#deleteCriminal()
CONCLUSION
The purpose of face Recognition criminal identification
system is to identify criminal. In past years this process is
carried out by humans. This process gives the exact
image of the criminal but it is very difficult to identify the
criminal details and also it requires much amount of
human burden.
The main aim of our project is to over come
the drawbacks of human based system by using the
machine-based face identification process. In this process
we store the details of criminal into the database along
with his photo or image. Then we make the image into
different clips containing hair, forehead, eyes, nose, lips
and chin and store these clips into the database. When any
duplication occurs, we compare the details given by the
eyewitness with the clips already stored in the database
and we will identify the criminals. This project can be
extended to adjust the gaps between the clips after
construction of the image to be a perfect photograph using
Image processing Techniques.
BIBLIOGRAPHY
BOOKS REFERRED
1. https://www.python.org/
2.https://www.w3schools.com/python/python_intro.a
sp
3.https://www.geeksforgeeks.org/python-
programming-language/