SlideShare a Scribd company logo
1 of 66
1
1.1 OVERVIEW
This project is aimed to identify the criminals in any investigation department. Here the
technique is we already store some images of the criminals in our database along with his
details and that images are segmented into many slices say eyes, hairs, lips, nose, etc. These
images are again stored in another database record so to identify any criminals;
eyewitnesses will see the images or slices that appear on the screen by using it we develop
the face, which may or may not be matched with our images. If any image is matched up to
99% then we predict that he is only the criminal. Thus using this project it provides a very
friendly environment for both operator and eyewitness to easily design any face can identify
criminals very easy.
Face detection can be regarded as a specific case of object-class detection. In object-
class detection, the task is to find the locations and sizes of all objects in an image that
belong to a given class. Examples include upper torsos, pedestrians, and cars. That is, the
detection of faces that are either rotated along the axis from the face to the observer (in-
plane rotation), or rotated along the vertical or left-right axis (out-of-plane rotation), or both.
The newer algorithms take into account variations in the image or video by factors such as
face appearance, lighting, and pose.
2
1.2 OBJECTIVE
This project is intended to identify a person using the images previously taken. The
Identification will be done according the previous images of different persons. Face
detection is gaining the interest of marketers. A webcam can be integrated into a television
and detect any face that walks by. The system then calculates the race, gender, and age
range of the face. Once the information is collected, a series of advertisements can be
played that is specific toward the detected race/gender/age.
Good face recognition algorithms and appropriate preprocessing of the images can
compensate for noise and slight variations in orientation, scale and illumination. Finally,
technologies that require multiple individuals to use the same equipment to capture their
biological characteristics potentially expose the user to the transmission of germs and
impurities from other users. However, face recognition is totally non-intrusive and does not
carry any such health risks.
3
1.3 ADVANTAGES
 Very fast and accurate.
 No need of any extra manual effort.
 No fever of data loss.
 Just need a little knowledge to operate the system.
 Doesn’t require any extra hardware device.
 At last very easy to find the criminals.
1.4 DISADVANTAGES
 Need of extra manual effort.
 It used to take much time to find any criminals.
 Not very much accurate.
 Danger of losing the files in some cases.
 Need Good Knowledge in drawing.
4
2.1 OVERVIEW
 Construction and updating of the criminal record and face. Addition, Clipping.
 Comparing the image with the faces that are there in our database.
 If any new images are found then it should be entered into our database by add
image module and then it should be segmented into different slices.
 You can also have a option to change the password.
 Segmentation is performed by comparing.
5
2.2 FEASIBILITY STUDY
Once the problem is clearly understood, the next step is to conduct feasibility study,
which is high-level capsule version of the entered systems and design process. The
objective is to determine whether or not the proposed system is feasible. The three tests of
feasibility have been carried out.
2.2.1 Technical Feasibility
2.2.2 Economical Feasibility
2.2.3 Operational Feasibility
2.2.1 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.
2.2.2 ECONOMICAL FEASIBILITY
As part of this, the costs and benefits associated with the proposed system
compared and the project is economically feasible only if tangible or intangible
benefits outweigh costs. The system development costs will be significant. So the
proposed system is economically feasible.
2.2.3 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.
6
2.3 SUMMARY
Face Identification is a technique that is mainly used to identify criminals based on the
clues given by the eyewitnesses. Based on the clues we develop an image by using the
image that we have in our database and then we compare it with the images already we
have. To identify any criminals we must have a record that generally contains name, age,
location, previous crime, gender, photo, etc.
7
3 PROBLEM DEFINITION
The face recognition problem can be formulated as follows: Given an input face image
and a database of face images of known individuals, how can we verify or determine the
identity of the person in the input image.
Furthermore, the human face is not a unique, rigid object. Indeed, there are numerous
factors that cause the appearance of the face to vary. The sources of variation in the facial
appearance can be categorized into two groups: intrinsic factors and extrinsic ones. Intrinsic
factors are due purely to the physical nature of the face and are independent of the observer.
 Determine the identity of a face in an image
 The image can be a frame from a video
 Processing needs to be fast
 Classification problem
 Need faces images for training
8
4.1 HARDWARE REQUIREMENTS
Processor : 500 MHz above
Hard disk : 500 MB
RAM : 256 MB
4.2 SOFTWARE REQUIREMENTS
Operating System : Windows XP
Database Server : SQLite
Programming Language : Java 7
Frame Work : Swing
4.3 PERIFERAL
Webcam : 1.3 MP and above
9
5.1 FLOWCHART/UML/CLASSES
Fig.5.1.1:- Flow Chart
10
Fig.5.1.2:- Class Diagram
Fig.5.1.3:- Object Diagram
11
Fig.5.1.4:- ER Diagram
12
Fig.5.1.5:- Sequence Diagram
13
5.2 SNAPSHOTS
LOGIN FORM
The inputs to the process are User Id and Password given by the developer to
allow the software available for the user environment. After giving the inputs the code
checks whether the entered ones are valid are not. It displays screen if match occurs
otherwise error message if they are not matched.
Fig.5.2.1:- Login Form
MAIN FORM
This process mainly explains the different screens that are available for the
operator. Here the selection of the screen depends on the operator and he can select
whatever screen he wants.
Fig.5.2.2:- Main Form
14
NEW CRIMINAL FORM
This process clearly illustrates adding the details of the criminal such as name,
alias name, age, gender, location, address, state and city along with his photo.
Fig.5.2.3:- New Criminal Form
CLIP IMAGE FORM
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.
Fig.5.2.4:- Clip Image Form
15
CONSTRUCT FACE FORM
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.
Fig.5.2.5:- Construct Face Form
FIND FACE FORM
In this process we are finding the criminal’s face the image constructed before
and stored in the database.
Fig.5.2.6:- Find Face Form
16
MOST SUITABLE SUSPECT FORM
In this form the image of the most possible suspect is displayed which had been
constructed before this process. It is done on the basis of probability of matching clips to
stored images.
Fig.5.2.7:- Most Suitable Suspect Form
17
5.3:CODING
LOGIN FORM
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.StyledEditorKit.BoldAction;
import java.awt.event.*;
import java.sql.*;
import javax.swing.JPasswordField.*;
class Login extends JFrame implements ActionListener
{
JLabel l,l1,l2;
JTextField t1,t2;
JButton b1,b2;
Login()
{
super("Login Page");
l=new JLabel("Login to Face");
l.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,20));
l1=new JLabel(" User Name ");
l2=new JLabel(" Password ");
t1=new JTextField(10);
t2=new JPasswordField(10);
b1=new JButton(" Submit ");
b2=new JButton(" Cancel");
18
JPanel p1=new JPanel();
JPanel p2=new JPanel();
Container c=getContentPane();
c.setLayout(null);
c.add(p1);
c.add(p2);
setSize(400,500);
setResizable(false);
java.awt.Dimension
screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize();
java.awt.Rectangle frame=getBounds();
this.setLocation((screen.width-frame.width)/2,(screen.height-frame.height)/2);
p1.setBounds(20,20,300,300);
p2.setBounds(20,350,300,100);
l.setBounds(70,10,200,30);
l1.setBounds(40,80,100,30);
t1.setBounds(180,80,100,30);
l2.setBounds(40,160,100,30);
t2.setBounds(180,160,100,30);
p1.setLayout(null);
p1.add(l);
p1.add(l1);p1.add(t1);
p1.add(l2);p1.add(t2);
19
b1.setBounds(50,40,80,30);
b2.setBounds(200,40,80,30);
t1.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,18));
t2.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,18));
p2.setLayout(null);
p2.add(b1);p2.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
int login_attempts=1;
public void actionPerformed(ActionEvent ae)
{
JButton b=(JButton)ae.getSource();
if(b==b1)
{
String s1=t1.getText();
String s2=t2.getText();
try
{
Connection con;
Statement stmt;
Class.forName("org.sqlite.JDBC");
con=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite");
stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select pwd from users where
name='"+t1.getText() + "'");
20
Boolean logfailed=true;
if(rs.next())
{
if((t2.getText()).equals(rs.getString(1)))
{
setVisible(false);
dispose();
new FaceMenu().show();
logfailed=false;
}
}
if(logfailed)
{
JOptionPane.showMessageDialog(this, "Invalid Username or Password",
"Sign In", JOptionPane.WARNING_MESSAGE);
if( login_attempts == 3)
{
System.exit(0);
}
login_attempts++;
t2.setText("");
t2.requestFocus();
}
con.close();
}catch(Exception e){
JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
}
}
21
if(b==b2)
{
System.exit(0);
}
}
}
public class LoginDemo
{
public static void main(String ar[])
{
Login ob1=new Login();
ob1.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
ob1.show()
}
}
22
CLIP IMAGE
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.io.*;
import java.awt.image.*;
class ClipImageAnand extends JFrame implements ActionListener
{
Connection cn;
Statement stmt;
int x1,x2,y1,y2;
int w,h,pixels[];
Image orgimg=null;
Image clipimg=null;
SourceImageCanvas sourceimgcan=new SourceImageCanvas();
ClipImagePanel clipimgcan=new ClipImagePanel();
JButton
btnForeHead,btnEyes,btnNose,btnLips,btnChin,btnHair,btnSave,btnCancel,btnPhoto,
btnClip;
JButton clearHair,clearForeHead,clearEyes,clearNose,clearLips,clearChin,btnClear;
JComboBox jcbCrimId;
String imgfile="";
boolean imgstatus=false;
boolean clipstatus=false;
JLabel lblHair,lblForeHead,lblEyes,lblNose,lblLips,lblChin,note;
23
int htHair=0, htForeHead=0, htEyes=0, htNose=0, htLips=0, htChin=0;
File f1;
String selcrimid="";
ClipImageAnand()
{
super("Clipping Face Screen");
Container cp=getContentPane();
cp.setLayout(null);
setSize(800,700);
java.awt.Dimension screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize();
java.awt.Rectangle frame=getBounds();
this.setLocation((screen.width-frame.width)/2,(screen.height-frame.height)/2);
clearHair=new JButton("Clear Hair");
clearHair.setToolTipText("Clear Hair Clip");
clearForeHead=new JButton("Clear Forehead");
clearForeHead.setToolTipText("Clear Forehead Clip");
clearEyes=new JButton("Clear Eyes");
clearEyes.setToolTipText("Clear Eyes Clip");
clearNose=new JButton("Clear Nose");
clearNose.setToolTipText("Clear Nose Clip");
clearLips=new JButton("Clear Lips");
clearLips.setToolTipText("Clear Lips Clip");
clearChin=new JButton("Clear Chin");
clearChin.setToolTipText("Clear Chin Clip");
btnForeHead=new JButton("Forehead ");
btnEyes=new JButton("Eyes ");
btnNose=new JButton("Nose");
btnLips=new JButton("Lips ");
24
btnChin=new JButton("Chin");
btnHair=new JButton("Hair ");
btnPhoto=new JButton("Photo");
btnSave=new JButton("Save");
btnCancel=new JButton("Cancel");
btnClear=new JButton("Clear");
jcbCrimId=new JComboBox();
btnHair.setBounds(20,25,120,30);
btnForeHead.setBounds(150,25,120,30);
btnEyes.setBounds(280,25,120,30);
btnNose.setBounds(410,25,120,30);
btnLips.setBounds(540,25,120,30);
btnChin.setBounds(670,25,120,30);
clearHair.setBounds(20,580,120,30);
clearForeHead.setBounds(150,580,120,30);
clearEyes.setBounds(280,580,120,30);
clearNose.setBounds(410,580,120,30);
clearLips.setBounds(540,580,120,30);
clearChin.setBounds(670,580,120,30);
btnClear.setBounds(660,520,100,30);
cp.add(clearForeHead);
cp.add(clearEyes);
cp.add(clearNose);
cp.add(clearLips);
cp.add(clearChin);
cp.add(clearHair);
btnSave.setBounds(400,520,100,30);
cp.add(btnSave);
25
btnCancel.setBounds(530,520,100,30);
cp.add(btnCancel);
cp.add(btnClear);
jcbCrimId.setBounds(20,520,120,30);
cp.add(jcbCrimId);
note=new JLabel("Note: Minimize the screen once");
note.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,15));
btnPhoto.setBounds(170,520,100,30);
cp.add(btnPhoto);
cp.add(btnForeHead);
cp.add(btnEyes);
cp.add(btnNose);
cp.add(btnLips);
cp.add(btnChin);
cp.add(btnHair)
btnForeHead.addActionListener(this);
btnEyes.addActionListener(this);
btnNose.addActionListener(this);
btnLips.addActionListener(this);
btnChin.addActionListener(this);
btnHair.addActionListener(this);
btnSave.addActionListener(this);
btnCancel.addActionListener(this);
btnPhoto.addActionListener(this);
jcbCrimId.addItem("Select Criminal");
btnClear.addActionListener(this);
clearHair.addActionListener(this);
26
clearForeHead.addActionListener(this);
clearEyes.addActionListener(this);
clearNose.addActionListener(this);
clearLips.addActionListener(this);
clearChin.addActionListener(this);
try
{
Class.forName("org.sqlite.JDBC");
Database d1=new Database();
cn=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite");
stmt=cn.createStatement();
ResultSet rs=stmt.executeQuery("select cid from face");
while(rs.next())
{
jcbCrimId.addItem(rs.getString(1));
}
}catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.getMessage(), "Clipping
Image", JOptionPane.ERROR_MESSAGE);
}
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==btnPhoto)
{
selcrimid=jcbCrimId.getSelectedItem().toString();
if(selcrimid.equalsIgnoreCase("Select Criminal"))
JOptionPane.showMessageDialog(this,"Select the ID of the
Criminal to clip the Photo", "clipping Photograph",
JOptionPane.ERROR_MESSAGE);
27
else
{
imgstatus=true;
try
{
ResultSet rs=stmt.executeQuery("select photo from face where
CID="+Integer.parseInt(selcrimid));
if(rs.next())
{
imgfile=rs.getString(1);
JOptionPane.showMessageDialog(this,"Criminal Selected", "clipping
Photograph", JOptionPane.INFORMATION_MESSAGE);
repaint();
}
}catch(Exception e){}
}
}
if(evt.getSource()==btnHair)
{
setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal
Id"+":"+selcrimid);
clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w));
htHair=h;
lblHair.setIcon(new ImageIcon(clipimg));
try
{
FileOutputStream fout=new
FileOutputStream("Clipshairhair"+selcrimid+".gif");
DataOutputStream dout=new DataOutputStream(fout);
28
for(int i=0;i<pixels.length;i++)
{
dout.writeInt(pixels[i]);
}
dout.close();
fout.close();
}catch(Exception e)
{
JOptionPane.showMessageDialog(this, "op clodes",
"Criminal Details", JOptionPane.ERROR_MESSAGE);
}
}
if(evt.getSource()==btnEyes)
{
setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal
Id"+":"+selcrimid);
clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w));
htEyes=h;
lblEyes.setIcon(new ImageIcon(clipimg));
try
{
FileOutputStream fout=new
FileOutputStream("Clipseyeseyes"+selcrimid+".gif");
DataOutputStream dout=new DataOutputStream(fout);
for(int i=0;i<pixels.length;i++)
{
dout.writeInt(pixels[i]);
}
dout.close();
fout.close();
29
}catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage(),
"Criminal Details", JOptionPane.ERROR_MESSAGE);
}
}
if(evt.getSource()==btnForeHead)
{
setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal
Id"+":"+selcrimid);
clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w));
htForeHead=h;
lblForeHead.setIcon(new ImageIcon(clipimg));
try
{
FileOutputStream fout=new
FileOutputStream("Clipsforeheadforehead"+selcrimid+".gif");
DataOutputStream dout=new DataOutputStream(fout);
for(int i=0;i<pixels.length;i++)
{
dout.writeInt(pixels[i]);
}
dout.close();
fout.close();
}catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage(),
"Criminal Details", JOptionPane.ERROR_MESSAGE);
}
}
if(evt.getSource()==btnNose)
{
setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal
Id"+":"+selcrimid);
30
clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w));
htNose=h;
lblNose.setIcon(new ImageIcon(clipimg));
try
{
FileOutputStream fout=new
FileOutputStream("Clipsnosenose"+selcrimid+".gif");
DataOutputStream dout=new DataOutputStream(fout);
for(int i=0;i<pixels.length;i++)
{
dout.writeInt(pixels[i]);
}
dout.close();
fout.close();
}catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage(),
"Criminal Details", JOptionPane.ERROR_MESSAGE);
}
}
if(evt.getSource()==btnLips)
{
setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal
Id"+":"+selcrimid);
clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w));
htLips=h;
lblLips.setIcon(new ImageIcon(clipimg));
try
{
FileOutputStream fout=new
FileOutputStream("Clipslipslips"+selcrimid+".gif");
DataOutputStream dout=new DataOutputStream(fout);
for(int i=0;i<pixels.length;i++)
31
{
dout.writeInt(pixels[i]);
}
dout.close();
fout.close();
}catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage(),
"Criminal Details", JOptionPane.ERROR_MESSAGE);
}
}
if(evt.getSource()==btnChin)
{
setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal
Id"+":"+selcrimid);
clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w));
htChin=h;
lblChin.setIcon(new ImageIcon(clipimg));
try
{
FileOutputStream fout=new
FileOutputStream("Clipschinchin"+selcrimid+".gif");
DataOutputStream dout=new DataOutputStream(fout);
for(int i=0;i<pixels.length;i++)
{
dout.writeInt(pixels[i]);
}
dout.close();
fout.close();
}catch(Exception e)
32
{
JOptionPane.showMessageDialog(this, e.getMessage(),
"Criminal Details", JOptionPane.ERROR_MESSAGE);
}
}
if(evt.getSource()==btnSave)
{
try
{
String str="insert into face_height(cid, hair, forehead, eyes, nose,
lips, chin) values(" + selcrimid + "," + htHair + "," + htForeHead + "," + htEyes + ","
+ htNose + "," + htLips + "," + htChin + ")";
stmt.executeUpdate(str);
JOptionPane.showMessageDialog(this,"Clips Stored Successfully",
"Clipping Images", JOptionPane.INFORMATION_MESSAGE);
}catch(Exception e){}
}
if(evt.getSource()==btnCancel)
{
setVisible(false);
dispose();
}
{
lblHair.setIcon(new ImageIcon("Iconsanand.bmp"));
lblForeHead.setIcon(new ImageIcon("Iconsanand.bmp"));
lblEyes.setIcon(new ImageIcon("Iconsanand.bmp"));
lblNose.setIcon(new ImageIcon("Iconsanand.bmp"));
lblLips.setIcon(new ImageIcon("Iconsanand.bmp"));
lblChin.setIcon(new ImageIcon("Iconsanand.bmp"));
jcbCrimId.setSelectedItem("Select Criminal");
setTitle("");
33
}
}
class SourceImageCanvas extends Canvas implements MouseListener
{
Toolkit tkt;
SourceImageCanvas()
{
tkt=Toolkit.getDefaultToolkit();
addMouseListener(this);
}
public void paint(Graphics g)
{
if(imgstatus)
{
orgimg=tkt.getImage("Images"+imgfile);
g.drawImage(orgimg,0,0,this);
}
}
public void mousePressed(MouseEvent evt)
{
x1=evt.getX();
y1=evt.getY();
}
public void mouseReleased(MouseEvent evt)
{
try
{
x2=evt.getX();
y2=evt.getY();
w=200;
h=y2-y1;
34
pixels=new int[w*h];
PixelGrabber pg=new
PixelGrabber(orgimg,x1,y1,w,h,pixels,0,w);
pg.grabPixels();
clipstatus=true;
}
catch(Exception e){
JOptionPane.showMessageDialog(this,e.getMessage(),"error",1);
}
}
public void mouseClicked(MouseEvent evt)
{
}
public void mouseEntered(MouseEvent evt)
{
}
public void mouseExited(MouseEvent evt)
{
}
}
class ClipImagePanel extends Canvas
{
public void paint(Graphics g)
{
if(clipstatus)
{
g.drawImage(clipimg,0,0,this);
}
}
}
}
class ClipImage
35
{
public static void main(String args[])
{
ClipImageAnand ob=new ClipImageAnand();
ob.show();
ob.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
36
CONSTRUCT FACE
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.awt.image.*;
import java.sql.*;
import java.util.*;
class Construct extends JFrame implements ActionListener
{
String stor;
String selcrimid="";
int i,hr,fr,ey,no,lip,ch;
int ht1,ht2,ht3,ht4,ht5,ht6;
int ha1,ha2,ha3,ha4,ha5,ha6;
int cids[]=new int[6];
int finalhairht,finalfhht,finaleyesht, finalnoseht, finallipsht, finalchinht;
ArrayList hairAL=new ArrayList();
ArrayList fhAL=new ArrayList();
ArrayList eyesAL=new ArrayList();
ArrayList noseAL=new ArrayList();
ArrayList lipsAL=new ArrayList();
ArrayList chinAL=new ArrayList();
Connection con;
Statement st;
int nextheight=0;
JComboBox cHair,cForehead,cEyes,cNose,cLips,cChin;
37
JButton bSave,bCancel,bClear;
JLabel lHair,lForehead,lEyes,lNose,lLips,lChin;
JLabel lHair1,lForehead1,lEyes1,lNose1,lLips1,lChin1;
int hair,forehead,eyes,nose,lips,chin;
String s="";
Construct()
{
super("Construct Face Screen");
cHair=new JComboBox();
cForehead=new JComboBox();
cEyes=new JComboBox();
cNose=new JComboBox();
cLips=new JComboBox();
cChin=new JComboBox();
cHair.setBounds(10,40,130,30);
cForehead.setBounds(180,40,130,30);
cEyes.setBounds(330,40,130,30);
cNose.setBounds(480,40,130,30);
cLips.setBounds(630,40,130,30);
cChin.setBounds(780,40,130,30);
bSave=new JButton("Save");
bCancel=new JButton("Cancel");
bClear=new JButton("Clear");
bSave.setBounds(100,600,100,30);
bCancel.setBounds(350,600,100,30);
bClear.setBounds(600,600,100,30);
38
bClear.addActionListener(this);
bCancel.addActionListener(this);
bSave.addActionListener(this);
lHair=new JLabel(" Hair ");
lForehead=new JLabel(" Forehead ");
lEyes=new JLabel(" Eyes ");
lNose=new JLabel(" Nose ");
lLips=new JLabel(" Lips ");
lChin=new JLabel(" Chin ");
lHair1=new JLabel("");
lForehead1=new JLabel("");
lEyes1=new JLabel("");
lNose1=new JLabel("");
lLips1=new JLabel("");
lChin1=new JLabel("");
lHair.setBounds(30,10,130,30);
lForehead.setBounds(200,10,130,30);
lEyes.setBounds(350,10,130,30);
lNose.setBounds(500,10,130,30);
lLips.setBounds(650,10,130,30);
lChin.setBounds(800,10,130,30);
lHair1.setBounds(350,150,250,30);
lForehead1.setBounds(350,181,250,30);
lEyes1.setBounds(350,212,250,30);
lNose1.setBounds(350,243,250,30);
lLips1.setBounds(350,274,250,30);
lChin1.setBounds(350,305,250,30);
39
cHair.addActionListener(this);
cForehead.addActionListener(this);
cEyes.addActionListener(this);
cNose.addActionListener(this);
cLips.addActionListener(this);
cChin.addActionListener(this);
Container c=getContentPane();
c.setLayout(null);
c.add(cHair);
c.add(cForehead);
c.add(cEyes);
c.add(cNose);
c.add(cLips);
c.add(cChin);
c.add(bSave);
c.add(bCancel);
c.add(bClear);
c.add(lHair);
c.add(lForehead);
c.add(lEyes);
c.add(lNose);
c.add(lLips);
c.add(lChin);
c.add(lHair1);
c.add(lForehead1);
c.add(lEyes1);
c.add(lNose1);
c.add(lLips1);
40
c.add(lChin1);
setSize(950,700);
setResizable(false);
java.awt.Dimension
screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize();
java.awt.Rectangle frame=getBounds();
this.setLocation((screen.width-frame.width)/2,(screen.height-
frame.height)/2);
try
{
Class.forName("org.sqlite.JDBC");
Database d1=new Database();
con=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite");
st=con.createStatement();
ResultSet rs=st.executeQuery("select * from face_height");
while(rs.next())
{
JOptionPane.showMessageDialog(this,"t", "constructing
Photograph", JOptionPane.ERROR_MESSAGE);
ArrayList a1=new ArrayList();
selcrimid=rs.getString(1);
a1.add(new Integer(Integer.parseInt(selcrimid)));
if(selcrimid.equalsIgnoreCase("Select Hair"))
JOptionPane.showMessageDialog(this,"Select the hair of the Criminal to construct the
Photo", "constructing Photograph", JOptionPane.ERROR_MESSAGE);
FileInputStream hairfin=new
FileInputStream("Clipshairhair"+selcrimid+".gif");
DataInputStream hairdin=new DataInputStream(hairfin);
41
int len=hairfin.available();
int hairpixels[]=new int[len];
int i=0;
while(hairfin.available()>0)
{
hairpixels[i]=hairdin.readInt();
i++;
}
hairfin.close();
hairdin.close();
int hairht=Integer.parseInt(rs.getString(2));
a1.add(new Integer(hairht));
hairAL.add(a1);
Image hairclipimg=createImage(new
MemoryImageSource(200,hairht,hairpixels,0,200));
ImageIcon hairicn=new ImageIcon(hairclipimg);
cHair.addItem(hairicn);
ArrayList a2=new ArrayList();
FileInputStream fhfin=new
FileInputStream("Clipsforeheadforehead"+selcrimid+".gif");
DataInputStream fhdin=new DataInputStream(fhfin);
len=fhfin.available();
int fhpixels[]=new int[len];
i=0;
while(fhfin.available()>0)
{
fhpixels[i]=fhdin.readInt();
i++;
}
fhfin.close();
42
fhdin.close();
int fhht=Integer.parseInt(rs.getString(3));
a2.add(new Integer(Integer.parseInt(selcrimid)));
a2.add(new Integer(fhht));
fhAL.add(a2);
Image fhclipimg=createImage(new
MemoryImageSource(200,fhht,fhpixels,0,200));
ImageIcon fhicn=new ImageIcon(fhclipimg);
cForehead.addItem(fhicn);
ArrayList a3=new ArrayList();
FileInputStream eyesfin=new
FileInputStream("Clipseyeseyes"+selcrimid+".gif");
DataInputStream eyesdin=new DataInputStream(eyesfin);
len=eyesfin.available();
int eyespixels[]=new int[len];
i=0;
while(eyesfin.available()>0)
{
eyespixels[i]=eyesdin.readInt();
i++;
}
eyesfin.close();
eyesdin.close();
int eyesht=Integer.parseInt(rs.getString(4));
a3.add(new Integer(Integer.parseInt(selcrimid)));
a3.add(new Integer(eyesht));
eyesAL.add(a3);
Image eyesclipimg=createImage(new
MemoryImageSource(200,eyesht,eyespixels,0,200));
ImageIcon eyesicn=new ImageIcon(eyesclipimg);
cEyes.addItem(eyesicn);
43
ArrayList a4=new ArrayList();
FileInputStream nosefin=new
FileInputStream("Clipsnosenose"+selcrimid+".gif");
DataInputStream nosedin=new DataInputStream(nosefin);
len=nosefin.available();
int nosepixels[]=new int[len];
i=0;
while(nosefin.available()>0)
{
nosepixels[i]=nosedin.readInt();
i++;
}
nosefin.close();
nosedin.close();
int noseht=Integer.parseInt(rs.getString(5));
a4.add(new Integer(Integer.parseInt(selcrimid)));
a4.add(new Integer(noseht));
noseAL.add(a4);
Image noseclipimg=createImage(new
MemoryImageSource(200,noseht,nosepixels,0,200));
ImageIcon noseicn=new ImageIcon(noseclipimg);
cNose.addItem(noseicn);
ArrayList a5=new ArrayList();
FileInputStream lipsfin=new
FileInputStream("Clipslipslips"+selcrimid+".gif");
DataInputStream lipsdin=new DataInputStream(lipsfin);
len=lipsfin.available();
int lipspixels[]=new int[len];
i=0;
while(lipsfin.available()>0)
{
lipspixels[i]=lipsdin.readInt();
44
i++;
}
lipsfin.close();
lipsdin.close();
int lipsht=Integer.parseInt(rs.getString(6));
a5.add(new Integer(Integer.parseInt(selcrimid)));
a5.add(new Integer(lipsht));
lipsAL.add(a5);
Image lipsclipimg=createImage(new
MemoryImageSource(200,lipsht,lipspixels,0,200));
ImageIcon lipsicn=new ImageIcon(lipsclipimg);
cLips.addItem(lipsicn);
ArrayList a6=new ArrayList();
FileInputStream chinfin=new
FileInputStream("Clipschinchin"+selcrimid+".gif");
DataInputStream chindin=new DataInputStream(chinfin);
len=chinfin.available();
int chinpixels[]=new int[len];
i=0;
while(chinfin.available()>0)
{
chinpixels[i]=chindin.readInt();
i++;
}
chinfin.close();
chindin.close();
int chinht=Integer.parseInt(rs.getString(7));
a6.add(new Integer(Integer.parseInt(selcrimid)));
a6.add(new Integer(chinht));
chinAL.add(a6);
45
Image chinclipimg=createImage(new
MemoryImageSource(200,chinht,chinpixels,0,200));
ImageIcon chinicn=new ImageIcon(chinclipimg);
cChin.addItem(chinicn);
}
}catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.getMessage(), "Construct Face",
JOptionPane.ERROR_MESSAGE);
}
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==bClear)
{
cHair.setSelectedIndex(0);
cForehead.setSelectedIndex(0);
cEyes.setSelectedIndex(0);
cNose.setSelectedIndex(0);
cLips.setSelectedIndex(0);
cChin.setSelectedIndex(0);
}
if(ae.getSource()==bCancel)
{
setVisible(false);
dispose();
}
46
if(ae.getSource()==cHair)
{
int selind=cHair.getSelectedIndex();
ArrayList selhair=(ArrayList)hairAL.get(selind);
Integer selhairht=(Integer)selhair.get(1);
finalhairht=selhairht.intValue();
Integer selhairid=(Integer)selhair.get(0);
cids[0]=selhairid.intValue();
ImageIcon selhairicn=(ImageIcon)cHair.getSelectedItem();
Rectangle recthair=lHair1.getBounds();
lHair1.setBounds(new
Rectangle((int)recthair.getX(),(int)recthair.getY(),(int)recthair.getWidth(),
finalhairht));
lHair1.setIcon(selhairicn);
}
if(ae.getSource()==cForehead)
{
int selind=cForehead.getSelectedIndex();
ArrayList selfh=(ArrayList)fhAL.get(selind);
Integer selfhht=(Integer)selfh.get(1);
finalfhht=selfhht.intValue();
Integer selfhid=(Integer)selfh.get(0);
cids[1]=selfhid.intValue();
ImageIcon selfhicn=(ImageIcon)cForehead.getSelectedItem();
Rectangle rectfh=lForehead1.getBounds();
Rectangle recthair=lHair1.getBounds();
lForehead1.setBounds(new
Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht,(int)rectfh.getWidth(),
finalfhht));
lForehead1.setIcon(selfhicn);
}
47
if(ae.getSource()==cEyes)
{
int selind=cEyes.getSelectedIndex();
ArrayList seleyes=(ArrayList)eyesAL.get(selind);
Integer seleyesht=(Integer)seleyes.get(1);
finaleyesht=seleyesht.intValue();
Integer seleyesid=(Integer)seleyes.get(0);
cids[2]=seleyesid.intValue();
ImageIcon seleyesicn=(ImageIcon)cEyes.getSelectedItem();
Rectangle recthair=lHair1.getBounds();
Rectangle rectfh=lForehead1.getBounds();
Rectangle recteyes=lEyes1.getBounds();
lEyes1.setBounds(new
Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht,(int)rectfh.getW
idth(), finaleyesht));
lEyes1.setIcon(seleyesicn);
}
if(ae.getSource()==cNose)
{
int selind=cNose.getSelectedIndex();
ArrayList selnose=(ArrayList)noseAL.get(selind);
Integer selnoseht=(Integer)selnose.get(1);
finalnoseht=selnoseht.intValue();
Integer selnoseid=(Integer)selnose.get(0);
cids[3]=selnoseid.intValue();
ImageIcon selnoseicn=(ImageIcon)cNose.getSelectedItem();
Rectangle rectnose=lNose1.getBounds();
Rectangle recthair=lHair1.getBounds();
Rectangle rectfh=lForehead1.getBounds();
Rectangle recteyes=lEyes1.getBounds();
48
lNose1.setBounds(new
Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht+finaleyesht,(int)
rectfh.getWidth(), finalnoseht));
lNose1.setIcon(selnoseicn);
}
if(ae.getSource()==cLips)
{
/*ImageIcon sttLips=(ImageIcon)cLips.getSelectedItem();
ht5=sttLips.getIconHeight();
int wt5=sttLips.getIconWidth();
lLips1.setBounds(400,ha4,wt5,ht5);
ha5=ha4+ht5;
lLips1.setIcon(sttLips);
lip=cLips.getSelectedIndex();*/
int selind=cLips.getSelectedIndex();
ArrayList sellips=(ArrayList)lipsAL.get(selind);
Integer sellipsht=(Integer)sellips.get(1);
finallipsht=sellipsht.intValue();
Integer sellipsid=(Integer)sellips.get(0);
cids[4]=sellipsid.intValue();
ImageIcon sellipsicn=(ImageIcon)cLips.getSelectedItem();
Rectangle rectfh=lForehead1.getBounds();
Rectangle recthair=lHair1.getBounds();
Rectangle recteyes=lEyes1.getBounds();
Rectangle rectnose=lNose1.getBounds();
Rectangle rectlips=lLips1.getBounds();
49
lLips1.setBounds(new
Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht+finaleyesht+fin
alnoseht,(int)rectfh.getWidth(), finallipsht));
lLips1.setIcon(sellipsicn);
}
if(ae.getSource()==cChin)
{
int selind=cChin.getSelectedIndex();
ArrayList selchin=(ArrayList)chinAL.get(selind);
Integer selchinht=(Integer)selchin.get(1);
finalchinht=selchinht.intValue();
Integer selchinid=(Integer)selchin.get(0);
cids[5]=selchinid.intValue();
ImageIcon selchinicn=(ImageIcon)cChin.getSelectedItem();
Rectangle rectfh=lForehead1.getBounds();
Rectangle recthair=lHair1.getBounds();
Rectangle recteyes=lEyes1.getBounds();
Rectangle rectnose=lNose1.getBounds();
Rectangle rectlips=lLips1.getBounds();
Rectangle rectchin=lChin1.getBounds();
lChin1.setBounds(new
Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht+finaleyesht+fin
alnoseht+finallipsht,(int)rectfh.getWidth(), finalchinht));
lChin1.setIcon(selchinicn);
}
if(ae.getSource()==bSave)
{
Rectangle recthair=lHair1.getBounds();
50
lHair1.setBounds(new
Rectangle((int)recthair.getX(),(int)recthair.getY(),(int)recthair.getWidth(),(int)recthair.
getHeight()));
Rectangle rectfh=lForehead1.getBounds();
nextheight=(int)recthair.getY()+(int)recthair.getHeight();
lForehead1.setBounds(new
Rectangle((int)rectfh.getX(),nextheight,(int)rectfh.getWidth(),
(int)rectfh.getHeight()));
Rectangle recteyes=lEyes1.getBounds();
nextheight=nextheight+(int)rectfh.getHeight();
lEyes1.setBounds(new
Rectangle((int)recteyes.getX(),nextheight,(int)recteyes.getWidth(),
(int)recteyes.getHeight()));
Rectangle rectnose=lNose1.getBounds();
nextheight=nextheight+(int)recteyes.getHeight();
lNose1.setBounds(new
Rectangle((int)rectnose.getX(),nextheight,(int)rectnose.getWidth(),
(int)rectnose.getHeight()));
Rectangle rectlips=lLips1.getBounds();
nextheight=nextheight+(int)rectnose.getHeight();
lLips1.setBounds(new
Rectangle((int)rectlips.getX(),nextheight,(int)rectlips.getWidth(),
(int)rectlips.getHeight()));
Rectangle rectchin=lChin1.getBounds();
nextheight=nextheight+(int)rectlips.getHeight();
51
lChin.setBounds(new
Rectangle((int)rectchin.getX(),nextheight,(int)rectchin.getWidth(),
(int)rectchin.getHeight()));
nextheight=nextheight+(int)rectchin.getHeight();
int crid=0;
try
{
ResultSet rs=st.executeQuery("select max(crimeid) from
face_suspectphoto");
if(rs.next())
{
String crimeid=rs.getString(1);
if(crimeid!=null)
crid=Integer.parseInt(crimeid);
crid++;
writePhoto(cids,crid);
st.executeUpdate("insert into face_suspectphoto(crimeid,
suspectphoto, photo_height) values("+crid+",'suspect"+crid+".gif',"+nextheight+")");
for(int i=0;i<6;i++)
{
st.executeUpdate("insert into face_suspects(crimeid,
cid) values("+crid+","+cids[i]+")");
}
JOptionPane.showMessageDialog(this,"Photo saved
successfully for the Crime Identification Number: "+crid, "Crime Status",
JOptionPane.INFORMATION_MESSAGE);
}
}catch(Exception e)
{
52
JOptionPane.showMessageDialog(this, e.getMessage(), "Construct Image",
JOptionPane.ERROR_MESSAGE);
}
}
}
public void writePhoto(int a[],int crid)
{
try
{
FileOutputStream suspectfout=new
FileOutputStream("Suspectssuspect"+crid+".gif");
DataOutputStream suspectdout=new DataOutputStream(suspectfout);
FileInputStream hairfin=new
FileInputStream("Clipshairhair"+cids[0]+".gif");
DataInputStream hairdin=new DataInputStream(hairfin);
while(hairfin.available()>0)
{
suspectdout.writeInt(hairdin.readInt());
}
hairfin.close();
hairdin.close();
FileInputStream fhfin=new
FileInputStream("Clipsforeheadforehead"+cids[1]+".gif");
DataInputStream fhdin=new DataInputStream(fhfin);
while(fhfin.available()>0)
{
suspectdout.writeInt(fhdin.readInt());
}
fhfin.close();
53
fhdin.close();
FileInputStream eyesfin=new
FileInputStream("Clipseyeseyes"+cids[2]+".gif");
DataInputStream eyesdin=new DataInputStream(eyesfin);
while(eyesfin.available()>0)
{
suspectdout.writeInt(eyesdin.readInt());
}
eyesfin.close();
eyesdin.close();
FileInputStream nosefin=new
FileInputStream("Clipsnosenose"+cids[3]+".gif");
DataInputStream nosedin=new DataInputStream(nosefin);
while(nosefin.available()>0)
{
suspectdout.writeInt(nosedin.readInt());
}
nosefin.close();
nosedin.close();
FileInputStream lipsfin=new FileInputStream("Clipslipslips"+cids[4]+".gif");
DataInputStream lipsdin=new DataInputStream(lipsfin);
while(lipsfin.available()>0)
{
suspectdout.writeInt(lipsdin.readInt());
}
lipsfin.close();
lipsdin.close();
54
FileInputStream chinfin=new FileInputStream("Clipschinchin"+cids[5]+".gif");
DataInputStream chindin=new DataInputStream(chinfin);
while(chinfin.available()>0)
{
suspectdout.writeInt(chindin.readInt());
}
chinfin.close();
chindin.close();
suspectdout.close();
suspectfout.close();
}catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage());
}
}
}
class ConstructFace
{
public static void main(String ar[])
{
Construct ob=new Construct();
ob.show();
ob.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
55
FIND FACE
import java.awt.*;
import java.awt.event .*;
import javax.swing.*;
import javax.swing.event.*;
import java.sql.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.swing.border.*;
public class FindFace extends JFrame
{
Connection cn;
Statement stmt;
boolean selectstatus=false;
int cids[]=new int[6];
public FindFace()
{
initComponents();
setSize(650,650);
java.awt.Dimension
screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize();
java.awt.Rectangle frame=getBounds();
this.setLocation((screen.width-frame.width)/2,(screen.height-
frame.height)/2);
setTitle("Find Face & Criminal Details Screen");
56
setResizable(false);
try
{
Class.forName("org.sqlite.JDBC");
Database d1=new Database();
cn=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite");
stmt=cn.createStatement();
ResultSet rs=stmt.executeQuery("select *from face_suspectphoto");
cmbCrimeId.removeAllItems();
cmbCrimeId.addItem("Select");
while(rs.next())
{
cmbCrimeId.addItem(rs.getString(1));
}
}catch(Exception e)
{
javax.swing.JOptionPane.showMessageDialog(this, e.getMessage(),
"Suspect Details", javax.swing.JOptionPane.ERROR_MESSAGE);
}
selectstatus=true;
}
private void initComponents()
{
lblPhoto = new javax.swing.JLabel();
cmbCrimeId = new javax.swing.JComboBox();
lblCrimeId = new javax.swing.JLabel();
btnAllSuspects = new javax.swing.JButton();
btnMostSupspect = new javax.swing.JButton();
btnClose = new javax.swing.JButton();
57
jLabel1 = new javax.swing.JLabel();
getContentPane().setLayout(null);
addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
formMousePressed(evt);
}
});
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});
getContentPane().add(lblPhoto);
lblPhoto.setBounds(200, 200, 250, 280);
cmbCrimeId.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmbCrimeIdActionPerformed(evt);
}
});
getContentPane().add(cmbCrimeId);
cmbCrimeId.setBounds(90, 100, 160, 25);
lblCrimeId.setText("Crime ID");
getContentPane().add(lblCrimeId);
lblCrimeId.setBounds(20, 100, 150, 16);
btnAllSuspects.setText("Show All Suspects");
btnAllSuspects.addActionListener(new java.awt.event.ActionListener() {
58
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAllSuspectsActionPerformed(evt);
}
});
getContentPane().add(btnAllSuspects);
btnAllSuspects.setBounds(20, 550, 200, 30);
btnMostSupspect.setText("Show Most Suitable Supect");
btnMostSupspect.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMostSupspectActionPerformed(evt);
}
});
getContentPane().add(btnMostSupspect);
btnMostSupspect.setBounds(230, 550, 200, 30);
btnClose.setText("Close");
btnClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCloseActionPerformed(evt);
}
});
getContentPane().add(btnClose);
btnClose.setBounds(450, 550, 100, 30);
jLabel1.setFont(new java.awt.Font("Times New Roman",
Font.BOLD/Font.ITALIC, 25));
jLabel1.setText("Suspected Criminal Faces");
getContentPane().add(jLabel1);
jLabel1.setBounds(150, 10, 300, 30);
59
pack();
}
private void btnCloseActionPerformed(java.awt.event.ActionEvent evt)
{
setVisible(false);
dispose();
}
private void btnMostSupspectActionPerformed(java.awt.event.ActionEvent evt)
{
new ShowMaxPossibleSuspect(this, true, cids, false).show();
}
private void btnAllSuspectsActionPerformed(java.awt.event.ActionEvent evt)
{
new ShowMaxPossibleSuspect(this, true, cids, true).show();
}
private void cmbCrimeIdActionPerformed(java.awt.event.ActionEvent evt)
{
if(cmbCrimeId.getSelectedIndex()!=0)
{
String crimeid=cmbCrimeId.getSelectedItem().toString();
try
{
ResultSet rs=stmt.executeQuery("select * from face_suspectphoto where
crimeid=" +crimeid);
String photofile="";
int photoheight=0;
while (rs.next())
{
photofile=rs.getString(2);
60
photoheight=Integer.parseInt(rs.getString(3));
}
FileInputStream fin=new FileInputStream("Suspects" + photofile);
DataInputStream din=new DataInputStream(fin);
int len=fin.available();
int pixels[]=new int[len];
int i=0;
while(fin.available()>0)
{
pixels[i]=din.readInt();
i++;
}
fin.close();
din.close();
Image clipimg=createImage(new
MemoryImageSource(200,photoheight,pixels,0,200));
ImageIcon eyesicn=new ImageIcon(clipimg);
lblPhoto.setIcon(eyesicn);
rs.close();
rs=stmt.executeQuery("select * from face_suspects where crimeid=" +
crimeid);
i=0;
while(rs.next())
{
cids[i]=Integer.parseInt(rs.getString(2));
i++;
}
}catch(Exception e)
{
javax.swing.JOptionPane.showMessageDialog(this, e.getMessage(), "Photo
Status", javax.swing.JOptionPane.ERROR_MESSAGE);
}
}
61
}
private void formMousePressed(java.awt.event.MouseEvent evt)
{
}
private void exitForm(java.awt.event.WindowEvent evt)
{
System.exit(0);
}
public static void main(String args[]) {
new FindFace().show();
}
private javax.swing.JButton btnClose;
private javax.swing.JButton btnMostSupspect;
private javax.swing.JButton btnAllSuspects;
private javax.swing.JLabel lblPhoto;
private javax.swing.JLabel lblCrimeId;
private javax.swing.JComboBox cmbCrimeId;
private javax.swing.JLabel jLabel1;
}
62
5.4 TESTING
The completion of a system is achieved only after it has been thoroughly tested.
Though this gives a feel the project is completed, there cannot be any project without going
though this stage. Though the programmer may have taken many precautions not to commit
any mistakes that crop up during the execution stage. Hence in this stage it is decided
whether the project can under go the real time environment execution without any break
downs, therefore a package can be rejected even at this stage.
The testing phase involves the testing of the developed system using various kinds of
data. An elaborated testing of data is prepared and a system is tested using the test data.
While testing errors are noted and corrections remade, the corrections are also noted for
future use.
5.4.1 SYSTEM TESTING
Testing is a set of activities that can be planned in advance and conducted
systematically. The proposed system is tested in parallel with the software that consists
of its own phases of analysis, implementation, testing and maintenance. Following are
the tests conducted on the system.
5.4.2 UNIT TESTING
During the implementation of the system each module of the system was tested
separately to uncover errors with in its boundaries. User interface was used as a guide
in the process.
63
Table.5.4.2 Unit Testing
Sr.No. Screen Input Output Remarks
1 Login Page User Id
Password
User
validation
User will enter into
Main Screen
2 Main Screen
 File
 New
Criminal
Details are
entered
Details are
stored in
the
database
New Menu is
selected to enter new
criminal details.
3 Main Screen
 File
 Show
Details
Display option
is clicked.
Criminal
Details are
displayed
Display details menu
is selected to get
details from database.
4 Main Screen
 File
 Exit
Exit Option is
Clicked.
Screen
will be
exited
Screen will be shut
down
5 Main Screen
 Edit
 Clip Image
Criminal Image
is clipped into
different parts
The clips
are stored
in database
Clip image menu is
selected to clip image
and store them in
database
6 Main Screen
 Edit
 Update
Details
Changes in the
details of the
criminals are
entered
Details of
the
criminal
are updated
Update details menu
is selected to update
the details of the
criminals
7 Main Screen
 Identificatio
n
 Construct
Face
Different clips
of criminals are
selected and
arranged in
order
Face of
the
criminal is
constructed
Construct face menu
is to construct the
criminal face from
various clips stored in
the database.
64
8 Main Screen
 Identificatio
n
 Find Face
Show all
suspects is
checked
All
suspects
detail along
with photo
are
displayed
Show more suspect
menu is selected to
get the details of all
suspects and more
possible suspect
involved in crime.
9 Main Screen
 Help
 About
About Face
Identification is
checked
The
version and
the
overview
of the
system is
displayed
About face
identification system
menu is selected to
get the details of
above system.
65
6.1 FUTURE WORK
All current face recognition algorithms fail under the vastly varying conditions under
which humans need to and are able to identify other people. Next generation person
recognition systems will need to recognize people in real-time and in much less constrained
situations. Technology used in smart environments has to be unobtrusive and allow users to
act freely. Wearable systems in particular require their sensing technology to be small, low
powered and easily integral with the user's clothing. Considering all the requirements,
identification systems that use face recognition and speaker identification seem to us to have
the most potential for wide-spread application. Audio and video based recognition systems
have the critical advantage that they use the modalities humans use for recognition. Finally,
researchers are beginning to demonstrate that unobtrusive audio-and-video based person
identification systems can achieve high recognition rates without requiring the user to be in
highly controlled environments.
6.2 CONCLUSION
The purpose of face Identification system is to identify criminals. 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 overcome 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 crime occurs we compare the details given by the eyewitness
with the clips already stored in the database and we will identify the criminal. 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.
66
7 REFERENCES
IEEE/REPUTED JOURNAL PAPERS
[1]Yang M.H., Kriegman D.J., and Ahuja N., “Detecting Faces in Images: A Survey”,
IEEE Transaction on Pattern Analysis and Machine Intelligence, Vol.24, No.1, January
2002.
[2] Rowley H. A., Baluja S. , Kanade T., “Neural Network- Based Face Detection”,
IEEE Trans. On Pattern Analysis and Machine Intelligence, vol.20, No. 1, Page(s). 39-
51, 1998.
[3] S. Arya and D.M. Mount. Algorithms for fast vector quantization. In J. A. Storer and
M. Cohn, editors, Proceedings of DCC 93: Data Compression Conference, pages 381–
390. IEEE Press, 1993.
BOOKS
[4] Herbert Schildt,”The Complete Reference Java2”, Tata McGraw-Hill, Chapter No.1,
publishing Company Limited, Page. No.3-9.
[5] Roger S. Pressman,”Software Engineering”, A Practitioner’s Approach”, Tata
McGraw-Hill Publishing Company Limited, Page. No.6-13.
WEBSITES
[6] http://www.java.sun.com/products/java.index.php
[7] http://www.facedetec tion.org/ facedetec tion
[8] http://www.faceidentification.com.php

More Related Content

What's hot

Facial powerpoint
Facial powerpointFacial powerpoint
Facial powerpoint12202843
 
Facial recognition technology by vaibhav
Facial recognition technology by vaibhavFacial recognition technology by vaibhav
Facial recognition technology by vaibhavVaibhav P
 
Pattern recognition 3d face recognition
Pattern recognition 3d face recognitionPattern recognition 3d face recognition
Pattern recognition 3d face recognitionMazin Alwaaly
 
FACE RECOGNITION ACROSS NON-UNIFORM MOTION BLUR
FACE RECOGNITION ACROSS  NON-UNIFORM MOTION BLUR FACE RECOGNITION ACROSS  NON-UNIFORM MOTION BLUR
FACE RECOGNITION ACROSS NON-UNIFORM MOTION BLUR Koduru KrisHna
 
Face detection By Abdul Hanan
Face detection By Abdul HananFace detection By Abdul Hanan
Face detection By Abdul HananAbdul Hanan
 
Face Recognition by Sumudu Ranasinghe
Face Recognition by Sumudu RanasingheFace Recognition by Sumudu Ranasinghe
Face Recognition by Sumudu Ranasinghebiitsumudu
 
Face Recognition System for Door Unlocking
Face Recognition System for Door UnlockingFace Recognition System for Door Unlocking
Face Recognition System for Door UnlockingHassan Tariq
 
Face Detection and Recognition System
Face Detection and Recognition SystemFace Detection and Recognition System
Face Detection and Recognition SystemZara Tariq
 
Face Recognition Techniques
Face Recognition TechniquesFace Recognition Techniques
Face Recognition TechniquesDaksh Verma
 
Presentation on FACE MASK DETECTION
Presentation on FACE MASK DETECTIONPresentation on FACE MASK DETECTION
Presentation on FACE MASK DETECTIONShantaJha2
 
Face recognition system using Hidden Markov Model
Face recognition system using Hidden Markov ModelFace recognition system using Hidden Markov Model
Face recognition system using Hidden Markov ModelCharmi Chokshi
 
Face Recognition Home Security System(Slide)
Face Recognition Home Security System(Slide)Face Recognition Home Security System(Slide)
Face Recognition Home Security System(Slide)Suman Mia
 
Face recognition Face Identification
Face recognition Face IdentificationFace recognition Face Identification
Face recognition Face IdentificationKalyan Acharjya
 
FACE RECOGNITION TECHNOLOGY
FACE RECOGNITION TECHNOLOGYFACE RECOGNITION TECHNOLOGY
FACE RECOGNITION TECHNOLOGYJASHU JASWANTH
 
Face recognition system
Face recognition systemFace recognition system
Face recognition systemYogesh Lamture
 

What's hot (20)

Facial powerpoint
Facial powerpointFacial powerpoint
Facial powerpoint
 
Facial recognition technology by vaibhav
Facial recognition technology by vaibhavFacial recognition technology by vaibhav
Facial recognition technology by vaibhav
 
Pattern recognition 3d face recognition
Pattern recognition 3d face recognitionPattern recognition 3d face recognition
Pattern recognition 3d face recognition
 
FACE RECOGNITION ACROSS NON-UNIFORM MOTION BLUR
FACE RECOGNITION ACROSS  NON-UNIFORM MOTION BLUR FACE RECOGNITION ACROSS  NON-UNIFORM MOTION BLUR
FACE RECOGNITION ACROSS NON-UNIFORM MOTION BLUR
 
Face detection By Abdul Hanan
Face detection By Abdul HananFace detection By Abdul Hanan
Face detection By Abdul Hanan
 
Face Recognition by Sumudu Ranasinghe
Face Recognition by Sumudu RanasingheFace Recognition by Sumudu Ranasinghe
Face Recognition by Sumudu Ranasinghe
 
Face Recognition System for Door Unlocking
Face Recognition System for Door UnlockingFace Recognition System for Door Unlocking
Face Recognition System for Door Unlocking
 
Face recognition system
Face recognition systemFace recognition system
Face recognition system
 
Face Detection and Recognition System
Face Detection and Recognition SystemFace Detection and Recognition System
Face Detection and Recognition System
 
Face Recognition Techniques
Face Recognition TechniquesFace Recognition Techniques
Face Recognition Techniques
 
Face Recognition Technology by Vishal Garg
Face Recognition Technology by Vishal GargFace Recognition Technology by Vishal Garg
Face Recognition Technology by Vishal Garg
 
Face Detection Technology
Face Detection TechnologyFace Detection Technology
Face Detection Technology
 
Presentation on FACE MASK DETECTION
Presentation on FACE MASK DETECTIONPresentation on FACE MASK DETECTION
Presentation on FACE MASK DETECTION
 
Face recognition system using Hidden Markov Model
Face recognition system using Hidden Markov ModelFace recognition system using Hidden Markov Model
Face recognition system using Hidden Markov Model
 
Face Recognition Home Security System(Slide)
Face Recognition Home Security System(Slide)Face Recognition Home Security System(Slide)
Face Recognition Home Security System(Slide)
 
Face recognition Face Identification
Face recognition Face IdentificationFace recognition Face Identification
Face recognition Face Identification
 
FACE RECOGNITION TECHNOLOGY
FACE RECOGNITION TECHNOLOGYFACE RECOGNITION TECHNOLOGY
FACE RECOGNITION TECHNOLOGY
 
Final year ppt
Final year pptFinal year ppt
Final year ppt
 
Face recognition system
Face recognition systemFace recognition system
Face recognition system
 
face recognition
face recognitionface recognition
face recognition
 

Viewers also liked

HUMAN FACE IDENTIFICATION
HUMAN FACE IDENTIFICATION HUMAN FACE IDENTIFICATION
HUMAN FACE IDENTIFICATION bhupesh lahare
 
Grammarly presentation
Grammarly presentationGrammarly presentation
Grammarly presentationgeorgesadeh
 
Knight Mischief Entertainment
Knight Mischief EntertainmentKnight Mischief Entertainment
Knight Mischief Entertainmentrohancourage
 
September 2014 UK Commercial Bulletin
September 2014 UK Commercial BulletinSeptember 2014 UK Commercial Bulletin
September 2014 UK Commercial BulletinHML Ltd
 
EN2012: Dislocation and Exile in James Joyce's Ulysses
EN2012: Dislocation and Exile in James Joyce's UlyssesEN2012: Dislocation and Exile in James Joyce's Ulysses
EN2012: Dislocation and Exile in James Joyce's UlyssesClaire Lynch
 
Your_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_Legislation
Your_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_LegislationYour_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_Legislation
Your_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_LegislationParsons Behle & Latimer
 
Beasiswa s2 bagi guru smp 2014
Beasiswa s2 bagi guru smp 2014Beasiswa s2 bagi guru smp 2014
Beasiswa s2 bagi guru smp 2014Rustam Wabula
 
Building Distributed Systems Using Helix
Building Distributed Systems Using HelixBuilding Distributed Systems Using Helix
Building Distributed Systems Using HelixAmy W. Tang
 
Using The Legislative Process to Further Your Business
Using The Legislative Process to Further Your BusinessUsing The Legislative Process to Further Your Business
Using The Legislative Process to Further Your BusinessParsons Behle & Latimer
 
Tizen 2.0 alpha でサポートされなかった native api icebreak
Tizen 2.0 alpha でサポートされなかった native api icebreakTizen 2.0 alpha でサポートされなかった native api icebreak
Tizen 2.0 alpha でサポートされなかった native api icebreakNaruto TAKAHASHI
 
Presentasi bd2 jefri 3.6 managing data
Presentasi bd2 jefri 3.6 managing dataPresentasi bd2 jefri 3.6 managing data
Presentasi bd2 jefri 3.6 managing dataJefri Fahrian
 
Intervento renza luigi_contratto
Intervento renza luigi_contrattoIntervento renza luigi_contratto
Intervento renza luigi_contrattoRenza Cambini
 

Viewers also liked (20)

HUMAN FACE IDENTIFICATION
HUMAN FACE IDENTIFICATION HUMAN FACE IDENTIFICATION
HUMAN FACE IDENTIFICATION
 
D'avenia festa del libro
D'avenia   festa del libroD'avenia   festa del libro
D'avenia festa del libro
 
Grammarly presentation
Grammarly presentationGrammarly presentation
Grammarly presentation
 
0135067537 pp1a
0135067537 pp1a0135067537 pp1a
0135067537 pp1a
 
Presentation2
Presentation2Presentation2
Presentation2
 
Knight Mischief Entertainment
Knight Mischief EntertainmentKnight Mischief Entertainment
Knight Mischief Entertainment
 
HOME
HOMEHOME
HOME
 
Zarasai
ZarasaiZarasai
Zarasai
 
September 2014 UK Commercial Bulletin
September 2014 UK Commercial BulletinSeptember 2014 UK Commercial Bulletin
September 2014 UK Commercial Bulletin
 
EN2012: Dislocation and Exile in James Joyce's Ulysses
EN2012: Dislocation and Exile in James Joyce's UlyssesEN2012: Dislocation and Exile in James Joyce's Ulysses
EN2012: Dislocation and Exile in James Joyce's Ulysses
 
Your_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_Legislation
Your_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_LegislationYour_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_Legislation
Your_Environmental_Permit_to_Operate_Recent_Developments_in_Utah_Legislation
 
How to employ yourself today
How to employ yourself todayHow to employ yourself today
How to employ yourself today
 
Beasiswa s2 bagi guru smp 2014
Beasiswa s2 bagi guru smp 2014Beasiswa s2 bagi guru smp 2014
Beasiswa s2 bagi guru smp 2014
 
Digital Marketing
Digital MarketingDigital Marketing
Digital Marketing
 
Building Distributed Systems Using Helix
Building Distributed Systems Using HelixBuilding Distributed Systems Using Helix
Building Distributed Systems Using Helix
 
Using The Legislative Process to Further Your Business
Using The Legislative Process to Further Your BusinessUsing The Legislative Process to Further Your Business
Using The Legislative Process to Further Your Business
 
Tizen 2.0 alpha でサポートされなかった native api icebreak
Tizen 2.0 alpha でサポートされなかった native api icebreakTizen 2.0 alpha でサポートされなかった native api icebreak
Tizen 2.0 alpha でサポートされなかった native api icebreak
 
Presentasi bd2 jefri 3.6 managing data
Presentasi bd2 jefri 3.6 managing dataPresentasi bd2 jefri 3.6 managing data
Presentasi bd2 jefri 3.6 managing data
 
Curency album
Curency albumCurency album
Curency album
 
Intervento renza luigi_contratto
Intervento renza luigi_contrattoIntervento renza luigi_contratto
Intervento renza luigi_contratto
 

Similar to Human Face Identification

IRJET- IoT based Door Lock and Unlock System using Face Recognition
IRJET- IoT based Door Lock and Unlock System using Face RecognitionIRJET- IoT based Door Lock and Unlock System using Face Recognition
IRJET- IoT based Door Lock and Unlock System using Face RecognitionIRJET Journal
 
IRJET-Human Face Detection and Identification using Deep Metric Learning
IRJET-Human Face Detection and Identification using Deep Metric LearningIRJET-Human Face Detection and Identification using Deep Metric Learning
IRJET-Human Face Detection and Identification using Deep Metric LearningIRJET Journal
 
Criminal Face Identification
Criminal Face IdentificationCriminal Face Identification
Criminal Face IdentificationIRJET Journal
 
IRJET- Autonamy of Attendence using Face Recognition
IRJET- Autonamy of Attendence using Face RecognitionIRJET- Autonamy of Attendence using Face Recognition
IRJET- Autonamy of Attendence using Face RecognitionIRJET Journal
 
Attendance System using Face Recognition
Attendance System using Face RecognitionAttendance System using Face Recognition
Attendance System using Face RecognitionIRJET Journal
 
IRJET- IoT based Door Access Control using Face Recognition
IRJET- IoT based Door Access Control using Face RecognitionIRJET- IoT based Door Access Control using Face Recognition
IRJET- IoT based Door Access Control using Face RecognitionIRJET Journal
 
Progression in Large Age-Gap Face Verification
Progression in Large Age-Gap Face VerificationProgression in Large Age-Gap Face Verification
Progression in Large Age-Gap Face VerificationIRJET Journal
 
Profile Identification through Face Recognition
Profile Identification through Face RecognitionProfile Identification through Face Recognition
Profile Identification through Face Recognitionijtsrd
 
SMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AISMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AIIRJET Journal
 
Virtual Contact Discovery using Facial Recognition
Virtual Contact Discovery using Facial RecognitionVirtual Contact Discovery using Facial Recognition
Virtual Contact Discovery using Facial RecognitionIRJET Journal
 
FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...
FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...
FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...IRJET Journal
 
Age and Gender Classification using Convolutional Neural Network
Age and Gender Classification using Convolutional Neural NetworkAge and Gender Classification using Convolutional Neural Network
Age and Gender Classification using Convolutional Neural NetworkIRJET Journal
 
IRJET - Face Detection and Recognition System
IRJET -  	  Face Detection and Recognition SystemIRJET -  	  Face Detection and Recognition System
IRJET - Face Detection and Recognition SystemIRJET Journal
 
Development of Real Time Face Recognition System using OpenCV
Development of Real Time Face Recognition System using OpenCVDevelopment of Real Time Face Recognition System using OpenCV
Development of Real Time Face Recognition System using OpenCVIRJET Journal
 
Face Recognition Technology by Rohit
Face Recognition Technology by RohitFace Recognition Technology by Rohit
Face Recognition Technology by RohitRohit Shrivastava
 
Face recognition Technology By Rohit
Face recognition Technology By RohitFace recognition Technology By Rohit
Face recognition Technology By RohitRohit Shrivastava
 
Face Recognition System
Face Recognition SystemFace Recognition System
Face Recognition SystemStudentRocks
 
Face recognition technology - BEST PPT
Face recognition technology - BEST PPTFace recognition technology - BEST PPT
Face recognition technology - BEST PPTSiddharth Modi
 

Similar to Human Face Identification (20)

IRJET- IoT based Door Lock and Unlock System using Face Recognition
IRJET- IoT based Door Lock and Unlock System using Face RecognitionIRJET- IoT based Door Lock and Unlock System using Face Recognition
IRJET- IoT based Door Lock and Unlock System using Face Recognition
 
1 (1)
1 (1)1 (1)
1 (1)
 
IRJET-Human Face Detection and Identification using Deep Metric Learning
IRJET-Human Face Detection and Identification using Deep Metric LearningIRJET-Human Face Detection and Identification using Deep Metric Learning
IRJET-Human Face Detection and Identification using Deep Metric Learning
 
Criminal Face Identification
Criminal Face IdentificationCriminal Face Identification
Criminal Face Identification
 
IRJET- Autonamy of Attendence using Face Recognition
IRJET- Autonamy of Attendence using Face RecognitionIRJET- Autonamy of Attendence using Face Recognition
IRJET- Autonamy of Attendence using Face Recognition
 
Attendance System using Face Recognition
Attendance System using Face RecognitionAttendance System using Face Recognition
Attendance System using Face Recognition
 
IRJET- IoT based Door Access Control using Face Recognition
IRJET- IoT based Door Access Control using Face RecognitionIRJET- IoT based Door Access Control using Face Recognition
IRJET- IoT based Door Access Control using Face Recognition
 
Progression in Large Age-Gap Face Verification
Progression in Large Age-Gap Face VerificationProgression in Large Age-Gap Face Verification
Progression in Large Age-Gap Face Verification
 
Profile Identification through Face Recognition
Profile Identification through Face RecognitionProfile Identification through Face Recognition
Profile Identification through Face Recognition
 
SMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AISMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AI
 
Virtual Contact Discovery using Facial Recognition
Virtual Contact Discovery using Facial RecognitionVirtual Contact Discovery using Facial Recognition
Virtual Contact Discovery using Facial Recognition
 
FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...
FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...
FACE MASK DETECTION AND COUNTER IN THINGSPEAK WITH EMAIL ALERT SYSTEM FOR COV...
 
Age and Gender Classification using Convolutional Neural Network
Age and Gender Classification using Convolutional Neural NetworkAge and Gender Classification using Convolutional Neural Network
Age and Gender Classification using Convolutional Neural Network
 
IRJET - Face Detection and Recognition System
IRJET -  	  Face Detection and Recognition SystemIRJET -  	  Face Detection and Recognition System
IRJET - Face Detection and Recognition System
 
Development of Real Time Face Recognition System using OpenCV
Development of Real Time Face Recognition System using OpenCVDevelopment of Real Time Face Recognition System using OpenCV
Development of Real Time Face Recognition System using OpenCV
 
Face Recognition Technology by Rohit
Face Recognition Technology by RohitFace Recognition Technology by Rohit
Face Recognition Technology by Rohit
 
Face recognition Technology By Rohit
Face recognition Technology By RohitFace recognition Technology By Rohit
Face recognition Technology By Rohit
 
Face Recognition System
Face Recognition SystemFace Recognition System
Face Recognition System
 
Face recognition technology - BEST PPT
Face recognition technology - BEST PPTFace recognition technology - BEST PPT
Face recognition technology - BEST PPT
 
[IJET-V1I1P4]Author :Juhi Raut, Snehal Patil, Shraddha Gawade, Prof. Mamta Me...
[IJET-V1I1P4]Author :Juhi Raut, Snehal Patil, Shraddha Gawade, Prof. Mamta Me...[IJET-V1I1P4]Author :Juhi Raut, Snehal Patil, Shraddha Gawade, Prof. Mamta Me...
[IJET-V1I1P4]Author :Juhi Raut, Snehal Patil, Shraddha Gawade, Prof. Mamta Me...
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Human Face Identification

  • 1. 1 1.1 OVERVIEW This project is aimed to identify the criminals in any investigation department. Here the technique is we already store some images of the criminals in our database along with his details and that images are segmented into many slices say eyes, hairs, lips, nose, etc. These images are again stored in another database record so to identify any criminals; eyewitnesses will see the images or slices that appear on the screen by using it we develop the face, which may or may not be matched with our images. If any image is matched up to 99% then we predict that he is only the criminal. Thus using this project it provides a very friendly environment for both operator and eyewitness to easily design any face can identify criminals very easy. Face detection can be regarded as a specific case of object-class detection. In object- class detection, the task is to find the locations and sizes of all objects in an image that belong to a given class. Examples include upper torsos, pedestrians, and cars. That is, the detection of faces that are either rotated along the axis from the face to the observer (in- plane rotation), or rotated along the vertical or left-right axis (out-of-plane rotation), or both. The newer algorithms take into account variations in the image or video by factors such as face appearance, lighting, and pose.
  • 2. 2 1.2 OBJECTIVE This project is intended to identify a person using the images previously taken. The Identification will be done according the previous images of different persons. Face detection is gaining the interest of marketers. A webcam can be integrated into a television and detect any face that walks by. The system then calculates the race, gender, and age range of the face. Once the information is collected, a series of advertisements can be played that is specific toward the detected race/gender/age. Good face recognition algorithms and appropriate preprocessing of the images can compensate for noise and slight variations in orientation, scale and illumination. Finally, technologies that require multiple individuals to use the same equipment to capture their biological characteristics potentially expose the user to the transmission of germs and impurities from other users. However, face recognition is totally non-intrusive and does not carry any such health risks.
  • 3. 3 1.3 ADVANTAGES  Very fast and accurate.  No need of any extra manual effort.  No fever of data loss.  Just need a little knowledge to operate the system.  Doesn’t require any extra hardware device.  At last very easy to find the criminals. 1.4 DISADVANTAGES  Need of extra manual effort.  It used to take much time to find any criminals.  Not very much accurate.  Danger of losing the files in some cases.  Need Good Knowledge in drawing.
  • 4. 4 2.1 OVERVIEW  Construction and updating of the criminal record and face. Addition, Clipping.  Comparing the image with the faces that are there in our database.  If any new images are found then it should be entered into our database by add image module and then it should be segmented into different slices.  You can also have a option to change the password.  Segmentation is performed by comparing.
  • 5. 5 2.2 FEASIBILITY STUDY Once the problem is clearly understood, the next step is to conduct feasibility study, which is high-level capsule version of the entered systems and design process. The objective is to determine whether or not the proposed system is feasible. The three tests of feasibility have been carried out. 2.2.1 Technical Feasibility 2.2.2 Economical Feasibility 2.2.3 Operational Feasibility 2.2.1 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. 2.2.2 ECONOMICAL FEASIBILITY As part of this, the costs and benefits associated with the proposed system compared and the project is economically feasible only if tangible or intangible benefits outweigh costs. The system development costs will be significant. So the proposed system is economically feasible. 2.2.3 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.
  • 6. 6 2.3 SUMMARY Face Identification is a technique that is mainly used to identify criminals based on the clues given by the eyewitnesses. Based on the clues we develop an image by using the image that we have in our database and then we compare it with the images already we have. To identify any criminals we must have a record that generally contains name, age, location, previous crime, gender, photo, etc.
  • 7. 7 3 PROBLEM DEFINITION The face recognition problem can be formulated as follows: Given an input face image and a database of face images of known individuals, how can we verify or determine the identity of the person in the input image. Furthermore, the human face is not a unique, rigid object. Indeed, there are numerous factors that cause the appearance of the face to vary. The sources of variation in the facial appearance can be categorized into two groups: intrinsic factors and extrinsic ones. Intrinsic factors are due purely to the physical nature of the face and are independent of the observer.  Determine the identity of a face in an image  The image can be a frame from a video  Processing needs to be fast  Classification problem  Need faces images for training
  • 8. 8 4.1 HARDWARE REQUIREMENTS Processor : 500 MHz above Hard disk : 500 MB RAM : 256 MB 4.2 SOFTWARE REQUIREMENTS Operating System : Windows XP Database Server : SQLite Programming Language : Java 7 Frame Work : Swing 4.3 PERIFERAL Webcam : 1.3 MP and above
  • 13. 13 5.2 SNAPSHOTS LOGIN FORM The inputs to the process are User Id and Password given by the developer to allow the software available for the user environment. After giving the inputs the code checks whether the entered ones are valid are not. It displays screen if match occurs otherwise error message if they are not matched. Fig.5.2.1:- Login Form MAIN FORM This process mainly explains the different screens that are available for the operator. Here the selection of the screen depends on the operator and he can select whatever screen he wants. Fig.5.2.2:- Main Form
  • 14. 14 NEW CRIMINAL FORM This process clearly illustrates adding the details of the criminal such as name, alias name, age, gender, location, address, state and city along with his photo. Fig.5.2.3:- New Criminal Form CLIP IMAGE FORM 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. Fig.5.2.4:- Clip Image Form
  • 15. 15 CONSTRUCT FACE FORM 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. Fig.5.2.5:- Construct Face Form FIND FACE FORM In this process we are finding the criminal’s face the image constructed before and stored in the database. Fig.5.2.6:- Find Face Form
  • 16. 16 MOST SUITABLE SUSPECT FORM In this form the image of the most possible suspect is displayed which had been constructed before this process. It is done on the basis of probability of matching clips to stored images. Fig.5.2.7:- Most Suitable Suspect Form
  • 17. 17 5.3:CODING LOGIN FORM import java.awt.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.StyledEditorKit.BoldAction; import java.awt.event.*; import java.sql.*; import javax.swing.JPasswordField.*; class Login extends JFrame implements ActionListener { JLabel l,l1,l2; JTextField t1,t2; JButton b1,b2; Login() { super("Login Page"); l=new JLabel("Login to Face"); l.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,20)); l1=new JLabel(" User Name "); l2=new JLabel(" Password "); t1=new JTextField(10); t2=new JPasswordField(10); b1=new JButton(" Submit "); b2=new JButton(" Cancel");
  • 18. 18 JPanel p1=new JPanel(); JPanel p2=new JPanel(); Container c=getContentPane(); c.setLayout(null); c.add(p1); c.add(p2); setSize(400,500); setResizable(false); java.awt.Dimension screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize(); java.awt.Rectangle frame=getBounds(); this.setLocation((screen.width-frame.width)/2,(screen.height-frame.height)/2); p1.setBounds(20,20,300,300); p2.setBounds(20,350,300,100); l.setBounds(70,10,200,30); l1.setBounds(40,80,100,30); t1.setBounds(180,80,100,30); l2.setBounds(40,160,100,30); t2.setBounds(180,160,100,30); p1.setLayout(null); p1.add(l); p1.add(l1);p1.add(t1); p1.add(l2);p1.add(t2);
  • 19. 19 b1.setBounds(50,40,80,30); b2.setBounds(200,40,80,30); t1.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,18)); t2.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,18)); p2.setLayout(null); p2.add(b1);p2.add(b2); b1.addActionListener(this); b2.addActionListener(this); } int login_attempts=1; public void actionPerformed(ActionEvent ae) { JButton b=(JButton)ae.getSource(); if(b==b1) { String s1=t1.getText(); String s2=t2.getText(); try { Connection con; Statement stmt; Class.forName("org.sqlite.JDBC"); con=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite"); stmt=con.createStatement(); ResultSet rs=stmt.executeQuery("select pwd from users where name='"+t1.getText() + "'");
  • 20. 20 Boolean logfailed=true; if(rs.next()) { if((t2.getText()).equals(rs.getString(1))) { setVisible(false); dispose(); new FaceMenu().show(); logfailed=false; } } if(logfailed) { JOptionPane.showMessageDialog(this, "Invalid Username or Password", "Sign In", JOptionPane.WARNING_MESSAGE); if( login_attempts == 3) { System.exit(0); } login_attempts++; t2.setText(""); t2.requestFocus(); } con.close(); }catch(Exception e){ JOptionPane.showMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } }
  • 21. 21 if(b==b2) { System.exit(0); } } } public class LoginDemo { public static void main(String ar[]) { Login ob1=new Login(); ob1.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); ob1.show() } }
  • 22. 22 CLIP IMAGE import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; import java.io.*; import java.awt.image.*; class ClipImageAnand extends JFrame implements ActionListener { Connection cn; Statement stmt; int x1,x2,y1,y2; int w,h,pixels[]; Image orgimg=null; Image clipimg=null; SourceImageCanvas sourceimgcan=new SourceImageCanvas(); ClipImagePanel clipimgcan=new ClipImagePanel(); JButton btnForeHead,btnEyes,btnNose,btnLips,btnChin,btnHair,btnSave,btnCancel,btnPhoto, btnClip; JButton clearHair,clearForeHead,clearEyes,clearNose,clearLips,clearChin,btnClear; JComboBox jcbCrimId; String imgfile=""; boolean imgstatus=false; boolean clipstatus=false; JLabel lblHair,lblForeHead,lblEyes,lblNose,lblLips,lblChin,note;
  • 23. 23 int htHair=0, htForeHead=0, htEyes=0, htNose=0, htLips=0, htChin=0; File f1; String selcrimid=""; ClipImageAnand() { super("Clipping Face Screen"); Container cp=getContentPane(); cp.setLayout(null); setSize(800,700); java.awt.Dimension screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize(); java.awt.Rectangle frame=getBounds(); this.setLocation((screen.width-frame.width)/2,(screen.height-frame.height)/2); clearHair=new JButton("Clear Hair"); clearHair.setToolTipText("Clear Hair Clip"); clearForeHead=new JButton("Clear Forehead"); clearForeHead.setToolTipText("Clear Forehead Clip"); clearEyes=new JButton("Clear Eyes"); clearEyes.setToolTipText("Clear Eyes Clip"); clearNose=new JButton("Clear Nose"); clearNose.setToolTipText("Clear Nose Clip"); clearLips=new JButton("Clear Lips"); clearLips.setToolTipText("Clear Lips Clip"); clearChin=new JButton("Clear Chin"); clearChin.setToolTipText("Clear Chin Clip"); btnForeHead=new JButton("Forehead "); btnEyes=new JButton("Eyes "); btnNose=new JButton("Nose"); btnLips=new JButton("Lips ");
  • 24. 24 btnChin=new JButton("Chin"); btnHair=new JButton("Hair "); btnPhoto=new JButton("Photo"); btnSave=new JButton("Save"); btnCancel=new JButton("Cancel"); btnClear=new JButton("Clear"); jcbCrimId=new JComboBox(); btnHair.setBounds(20,25,120,30); btnForeHead.setBounds(150,25,120,30); btnEyes.setBounds(280,25,120,30); btnNose.setBounds(410,25,120,30); btnLips.setBounds(540,25,120,30); btnChin.setBounds(670,25,120,30); clearHair.setBounds(20,580,120,30); clearForeHead.setBounds(150,580,120,30); clearEyes.setBounds(280,580,120,30); clearNose.setBounds(410,580,120,30); clearLips.setBounds(540,580,120,30); clearChin.setBounds(670,580,120,30); btnClear.setBounds(660,520,100,30); cp.add(clearForeHead); cp.add(clearEyes); cp.add(clearNose); cp.add(clearLips); cp.add(clearChin); cp.add(clearHair); btnSave.setBounds(400,520,100,30); cp.add(btnSave);
  • 25. 25 btnCancel.setBounds(530,520,100,30); cp.add(btnCancel); cp.add(btnClear); jcbCrimId.setBounds(20,520,120,30); cp.add(jcbCrimId); note=new JLabel("Note: Minimize the screen once"); note.setFont(new Font("Times New Roman",Font.BOLD/Font.ITALIC,15)); btnPhoto.setBounds(170,520,100,30); cp.add(btnPhoto); cp.add(btnForeHead); cp.add(btnEyes); cp.add(btnNose); cp.add(btnLips); cp.add(btnChin); cp.add(btnHair) btnForeHead.addActionListener(this); btnEyes.addActionListener(this); btnNose.addActionListener(this); btnLips.addActionListener(this); btnChin.addActionListener(this); btnHair.addActionListener(this); btnSave.addActionListener(this); btnCancel.addActionListener(this); btnPhoto.addActionListener(this); jcbCrimId.addItem("Select Criminal"); btnClear.addActionListener(this); clearHair.addActionListener(this);
  • 26. 26 clearForeHead.addActionListener(this); clearEyes.addActionListener(this); clearNose.addActionListener(this); clearLips.addActionListener(this); clearChin.addActionListener(this); try { Class.forName("org.sqlite.JDBC"); Database d1=new Database(); cn=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite"); stmt=cn.createStatement(); ResultSet rs=stmt.executeQuery("select cid from face"); while(rs.next()) { jcbCrimId.addItem(rs.getString(1)); } }catch(Exception e) { JOptionPane.showMessageDialog(this,e.getMessage(), "Clipping Image", JOptionPane.ERROR_MESSAGE); } } public void actionPerformed(ActionEvent evt) { if(evt.getSource()==btnPhoto) { selcrimid=jcbCrimId.getSelectedItem().toString(); if(selcrimid.equalsIgnoreCase("Select Criminal")) JOptionPane.showMessageDialog(this,"Select the ID of the Criminal to clip the Photo", "clipping Photograph", JOptionPane.ERROR_MESSAGE);
  • 27. 27 else { imgstatus=true; try { ResultSet rs=stmt.executeQuery("select photo from face where CID="+Integer.parseInt(selcrimid)); if(rs.next()) { imgfile=rs.getString(1); JOptionPane.showMessageDialog(this,"Criminal Selected", "clipping Photograph", JOptionPane.INFORMATION_MESSAGE); repaint(); } }catch(Exception e){} } } if(evt.getSource()==btnHair) { setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal Id"+":"+selcrimid); clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w)); htHair=h; lblHair.setIcon(new ImageIcon(clipimg)); try { FileOutputStream fout=new FileOutputStream("Clipshairhair"+selcrimid+".gif"); DataOutputStream dout=new DataOutputStream(fout);
  • 28. 28 for(int i=0;i<pixels.length;i++) { dout.writeInt(pixels[i]); } dout.close(); fout.close(); }catch(Exception e) { JOptionPane.showMessageDialog(this, "op clodes", "Criminal Details", JOptionPane.ERROR_MESSAGE); } } if(evt.getSource()==btnEyes) { setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal Id"+":"+selcrimid); clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w)); htEyes=h; lblEyes.setIcon(new ImageIcon(clipimg)); try { FileOutputStream fout=new FileOutputStream("Clipseyeseyes"+selcrimid+".gif"); DataOutputStream dout=new DataOutputStream(fout); for(int i=0;i<pixels.length;i++) { dout.writeInt(pixels[i]); } dout.close(); fout.close();
  • 29. 29 }catch(Exception e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Criminal Details", JOptionPane.ERROR_MESSAGE); } } if(evt.getSource()==btnForeHead) { setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal Id"+":"+selcrimid); clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w)); htForeHead=h; lblForeHead.setIcon(new ImageIcon(clipimg)); try { FileOutputStream fout=new FileOutputStream("Clipsforeheadforehead"+selcrimid+".gif"); DataOutputStream dout=new DataOutputStream(fout); for(int i=0;i<pixels.length;i++) { dout.writeInt(pixels[i]); } dout.close(); fout.close(); }catch(Exception e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Criminal Details", JOptionPane.ERROR_MESSAGE); } } if(evt.getSource()==btnNose) { setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal Id"+":"+selcrimid);
  • 30. 30 clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w)); htNose=h; lblNose.setIcon(new ImageIcon(clipimg)); try { FileOutputStream fout=new FileOutputStream("Clipsnosenose"+selcrimid+".gif"); DataOutputStream dout=new DataOutputStream(fout); for(int i=0;i<pixels.length;i++) { dout.writeInt(pixels[i]); } dout.close(); fout.close(); }catch(Exception e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Criminal Details", JOptionPane.ERROR_MESSAGE); } } if(evt.getSource()==btnLips) { setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal Id"+":"+selcrimid); clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w)); htLips=h; lblLips.setIcon(new ImageIcon(clipimg)); try { FileOutputStream fout=new FileOutputStream("Clipslipslips"+selcrimid+".gif"); DataOutputStream dout=new DataOutputStream(fout); for(int i=0;i<pixels.length;i++)
  • 31. 31 { dout.writeInt(pixels[i]); } dout.close(); fout.close(); }catch(Exception e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Criminal Details", JOptionPane.ERROR_MESSAGE); } } if(evt.getSource()==btnChin) { setTitle(x1+":"+y1+":"+w+":"+h+":"+x2+":"+y2+":"+"Criminal Id"+":"+selcrimid); clipimg=createImage(new MemoryImageSource(w,h,pixels,0,w)); htChin=h; lblChin.setIcon(new ImageIcon(clipimg)); try { FileOutputStream fout=new FileOutputStream("Clipschinchin"+selcrimid+".gif"); DataOutputStream dout=new DataOutputStream(fout); for(int i=0;i<pixels.length;i++) { dout.writeInt(pixels[i]); } dout.close(); fout.close(); }catch(Exception e)
  • 32. 32 { JOptionPane.showMessageDialog(this, e.getMessage(), "Criminal Details", JOptionPane.ERROR_MESSAGE); } } if(evt.getSource()==btnSave) { try { String str="insert into face_height(cid, hair, forehead, eyes, nose, lips, chin) values(" + selcrimid + "," + htHair + "," + htForeHead + "," + htEyes + "," + htNose + "," + htLips + "," + htChin + ")"; stmt.executeUpdate(str); JOptionPane.showMessageDialog(this,"Clips Stored Successfully", "Clipping Images", JOptionPane.INFORMATION_MESSAGE); }catch(Exception e){} } if(evt.getSource()==btnCancel) { setVisible(false); dispose(); } { lblHair.setIcon(new ImageIcon("Iconsanand.bmp")); lblForeHead.setIcon(new ImageIcon("Iconsanand.bmp")); lblEyes.setIcon(new ImageIcon("Iconsanand.bmp")); lblNose.setIcon(new ImageIcon("Iconsanand.bmp")); lblLips.setIcon(new ImageIcon("Iconsanand.bmp")); lblChin.setIcon(new ImageIcon("Iconsanand.bmp")); jcbCrimId.setSelectedItem("Select Criminal"); setTitle("");
  • 33. 33 } } class SourceImageCanvas extends Canvas implements MouseListener { Toolkit tkt; SourceImageCanvas() { tkt=Toolkit.getDefaultToolkit(); addMouseListener(this); } public void paint(Graphics g) { if(imgstatus) { orgimg=tkt.getImage("Images"+imgfile); g.drawImage(orgimg,0,0,this); } } public void mousePressed(MouseEvent evt) { x1=evt.getX(); y1=evt.getY(); } public void mouseReleased(MouseEvent evt) { try { x2=evt.getX(); y2=evt.getY(); w=200; h=y2-y1;
  • 34. 34 pixels=new int[w*h]; PixelGrabber pg=new PixelGrabber(orgimg,x1,y1,w,h,pixels,0,w); pg.grabPixels(); clipstatus=true; } catch(Exception e){ JOptionPane.showMessageDialog(this,e.getMessage(),"error",1); } } public void mouseClicked(MouseEvent evt) { } public void mouseEntered(MouseEvent evt) { } public void mouseExited(MouseEvent evt) { } } class ClipImagePanel extends Canvas { public void paint(Graphics g) { if(clipstatus) { g.drawImage(clipimg,0,0,this); } } } } class ClipImage
  • 35. 35 { public static void main(String args[]) { ClipImageAnand ob=new ClipImageAnand(); ob.show(); ob.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } }
  • 36. 36 CONSTRUCT FACE import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import java.awt.image.*; import java.sql.*; import java.util.*; class Construct extends JFrame implements ActionListener { String stor; String selcrimid=""; int i,hr,fr,ey,no,lip,ch; int ht1,ht2,ht3,ht4,ht5,ht6; int ha1,ha2,ha3,ha4,ha5,ha6; int cids[]=new int[6]; int finalhairht,finalfhht,finaleyesht, finalnoseht, finallipsht, finalchinht; ArrayList hairAL=new ArrayList(); ArrayList fhAL=new ArrayList(); ArrayList eyesAL=new ArrayList(); ArrayList noseAL=new ArrayList(); ArrayList lipsAL=new ArrayList(); ArrayList chinAL=new ArrayList(); Connection con; Statement st; int nextheight=0; JComboBox cHair,cForehead,cEyes,cNose,cLips,cChin;
  • 37. 37 JButton bSave,bCancel,bClear; JLabel lHair,lForehead,lEyes,lNose,lLips,lChin; JLabel lHair1,lForehead1,lEyes1,lNose1,lLips1,lChin1; int hair,forehead,eyes,nose,lips,chin; String s=""; Construct() { super("Construct Face Screen"); cHair=new JComboBox(); cForehead=new JComboBox(); cEyes=new JComboBox(); cNose=new JComboBox(); cLips=new JComboBox(); cChin=new JComboBox(); cHair.setBounds(10,40,130,30); cForehead.setBounds(180,40,130,30); cEyes.setBounds(330,40,130,30); cNose.setBounds(480,40,130,30); cLips.setBounds(630,40,130,30); cChin.setBounds(780,40,130,30); bSave=new JButton("Save"); bCancel=new JButton("Cancel"); bClear=new JButton("Clear"); bSave.setBounds(100,600,100,30); bCancel.setBounds(350,600,100,30); bClear.setBounds(600,600,100,30);
  • 38. 38 bClear.addActionListener(this); bCancel.addActionListener(this); bSave.addActionListener(this); lHair=new JLabel(" Hair "); lForehead=new JLabel(" Forehead "); lEyes=new JLabel(" Eyes "); lNose=new JLabel(" Nose "); lLips=new JLabel(" Lips "); lChin=new JLabel(" Chin "); lHair1=new JLabel(""); lForehead1=new JLabel(""); lEyes1=new JLabel(""); lNose1=new JLabel(""); lLips1=new JLabel(""); lChin1=new JLabel(""); lHair.setBounds(30,10,130,30); lForehead.setBounds(200,10,130,30); lEyes.setBounds(350,10,130,30); lNose.setBounds(500,10,130,30); lLips.setBounds(650,10,130,30); lChin.setBounds(800,10,130,30); lHair1.setBounds(350,150,250,30); lForehead1.setBounds(350,181,250,30); lEyes1.setBounds(350,212,250,30); lNose1.setBounds(350,243,250,30); lLips1.setBounds(350,274,250,30); lChin1.setBounds(350,305,250,30);
  • 40. 40 c.add(lChin1); setSize(950,700); setResizable(false); java.awt.Dimension screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize(); java.awt.Rectangle frame=getBounds(); this.setLocation((screen.width-frame.width)/2,(screen.height- frame.height)/2); try { Class.forName("org.sqlite.JDBC"); Database d1=new Database(); con=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite"); st=con.createStatement(); ResultSet rs=st.executeQuery("select * from face_height"); while(rs.next()) { JOptionPane.showMessageDialog(this,"t", "constructing Photograph", JOptionPane.ERROR_MESSAGE); ArrayList a1=new ArrayList(); selcrimid=rs.getString(1); a1.add(new Integer(Integer.parseInt(selcrimid))); if(selcrimid.equalsIgnoreCase("Select Hair")) JOptionPane.showMessageDialog(this,"Select the hair of the Criminal to construct the Photo", "constructing Photograph", JOptionPane.ERROR_MESSAGE); FileInputStream hairfin=new FileInputStream("Clipshairhair"+selcrimid+".gif"); DataInputStream hairdin=new DataInputStream(hairfin);
  • 41. 41 int len=hairfin.available(); int hairpixels[]=new int[len]; int i=0; while(hairfin.available()>0) { hairpixels[i]=hairdin.readInt(); i++; } hairfin.close(); hairdin.close(); int hairht=Integer.parseInt(rs.getString(2)); a1.add(new Integer(hairht)); hairAL.add(a1); Image hairclipimg=createImage(new MemoryImageSource(200,hairht,hairpixels,0,200)); ImageIcon hairicn=new ImageIcon(hairclipimg); cHair.addItem(hairicn); ArrayList a2=new ArrayList(); FileInputStream fhfin=new FileInputStream("Clipsforeheadforehead"+selcrimid+".gif"); DataInputStream fhdin=new DataInputStream(fhfin); len=fhfin.available(); int fhpixels[]=new int[len]; i=0; while(fhfin.available()>0) { fhpixels[i]=fhdin.readInt(); i++; } fhfin.close();
  • 42. 42 fhdin.close(); int fhht=Integer.parseInt(rs.getString(3)); a2.add(new Integer(Integer.parseInt(selcrimid))); a2.add(new Integer(fhht)); fhAL.add(a2); Image fhclipimg=createImage(new MemoryImageSource(200,fhht,fhpixels,0,200)); ImageIcon fhicn=new ImageIcon(fhclipimg); cForehead.addItem(fhicn); ArrayList a3=new ArrayList(); FileInputStream eyesfin=new FileInputStream("Clipseyeseyes"+selcrimid+".gif"); DataInputStream eyesdin=new DataInputStream(eyesfin); len=eyesfin.available(); int eyespixels[]=new int[len]; i=0; while(eyesfin.available()>0) { eyespixels[i]=eyesdin.readInt(); i++; } eyesfin.close(); eyesdin.close(); int eyesht=Integer.parseInt(rs.getString(4)); a3.add(new Integer(Integer.parseInt(selcrimid))); a3.add(new Integer(eyesht)); eyesAL.add(a3); Image eyesclipimg=createImage(new MemoryImageSource(200,eyesht,eyespixels,0,200)); ImageIcon eyesicn=new ImageIcon(eyesclipimg); cEyes.addItem(eyesicn);
  • 43. 43 ArrayList a4=new ArrayList(); FileInputStream nosefin=new FileInputStream("Clipsnosenose"+selcrimid+".gif"); DataInputStream nosedin=new DataInputStream(nosefin); len=nosefin.available(); int nosepixels[]=new int[len]; i=0; while(nosefin.available()>0) { nosepixels[i]=nosedin.readInt(); i++; } nosefin.close(); nosedin.close(); int noseht=Integer.parseInt(rs.getString(5)); a4.add(new Integer(Integer.parseInt(selcrimid))); a4.add(new Integer(noseht)); noseAL.add(a4); Image noseclipimg=createImage(new MemoryImageSource(200,noseht,nosepixels,0,200)); ImageIcon noseicn=new ImageIcon(noseclipimg); cNose.addItem(noseicn); ArrayList a5=new ArrayList(); FileInputStream lipsfin=new FileInputStream("Clipslipslips"+selcrimid+".gif"); DataInputStream lipsdin=new DataInputStream(lipsfin); len=lipsfin.available(); int lipspixels[]=new int[len]; i=0; while(lipsfin.available()>0) { lipspixels[i]=lipsdin.readInt();
  • 44. 44 i++; } lipsfin.close(); lipsdin.close(); int lipsht=Integer.parseInt(rs.getString(6)); a5.add(new Integer(Integer.parseInt(selcrimid))); a5.add(new Integer(lipsht)); lipsAL.add(a5); Image lipsclipimg=createImage(new MemoryImageSource(200,lipsht,lipspixels,0,200)); ImageIcon lipsicn=new ImageIcon(lipsclipimg); cLips.addItem(lipsicn); ArrayList a6=new ArrayList(); FileInputStream chinfin=new FileInputStream("Clipschinchin"+selcrimid+".gif"); DataInputStream chindin=new DataInputStream(chinfin); len=chinfin.available(); int chinpixels[]=new int[len]; i=0; while(chinfin.available()>0) { chinpixels[i]=chindin.readInt(); i++; } chinfin.close(); chindin.close(); int chinht=Integer.parseInt(rs.getString(7)); a6.add(new Integer(Integer.parseInt(selcrimid))); a6.add(new Integer(chinht)); chinAL.add(a6);
  • 45. 45 Image chinclipimg=createImage(new MemoryImageSource(200,chinht,chinpixels,0,200)); ImageIcon chinicn=new ImageIcon(chinclipimg); cChin.addItem(chinicn); } }catch(Exception e) { JOptionPane.showMessageDialog(this,e.getMessage(), "Construct Face", JOptionPane.ERROR_MESSAGE); } } public void actionPerformed(ActionEvent ae) { if(ae.getSource()==bClear) { cHair.setSelectedIndex(0); cForehead.setSelectedIndex(0); cEyes.setSelectedIndex(0); cNose.setSelectedIndex(0); cLips.setSelectedIndex(0); cChin.setSelectedIndex(0); } if(ae.getSource()==bCancel) { setVisible(false); dispose(); }
  • 46. 46 if(ae.getSource()==cHair) { int selind=cHair.getSelectedIndex(); ArrayList selhair=(ArrayList)hairAL.get(selind); Integer selhairht=(Integer)selhair.get(1); finalhairht=selhairht.intValue(); Integer selhairid=(Integer)selhair.get(0); cids[0]=selhairid.intValue(); ImageIcon selhairicn=(ImageIcon)cHair.getSelectedItem(); Rectangle recthair=lHair1.getBounds(); lHair1.setBounds(new Rectangle((int)recthair.getX(),(int)recthair.getY(),(int)recthair.getWidth(), finalhairht)); lHair1.setIcon(selhairicn); } if(ae.getSource()==cForehead) { int selind=cForehead.getSelectedIndex(); ArrayList selfh=(ArrayList)fhAL.get(selind); Integer selfhht=(Integer)selfh.get(1); finalfhht=selfhht.intValue(); Integer selfhid=(Integer)selfh.get(0); cids[1]=selfhid.intValue(); ImageIcon selfhicn=(ImageIcon)cForehead.getSelectedItem(); Rectangle rectfh=lForehead1.getBounds(); Rectangle recthair=lHair1.getBounds(); lForehead1.setBounds(new Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht,(int)rectfh.getWidth(), finalfhht)); lForehead1.setIcon(selfhicn); }
  • 47. 47 if(ae.getSource()==cEyes) { int selind=cEyes.getSelectedIndex(); ArrayList seleyes=(ArrayList)eyesAL.get(selind); Integer seleyesht=(Integer)seleyes.get(1); finaleyesht=seleyesht.intValue(); Integer seleyesid=(Integer)seleyes.get(0); cids[2]=seleyesid.intValue(); ImageIcon seleyesicn=(ImageIcon)cEyes.getSelectedItem(); Rectangle recthair=lHair1.getBounds(); Rectangle rectfh=lForehead1.getBounds(); Rectangle recteyes=lEyes1.getBounds(); lEyes1.setBounds(new Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht,(int)rectfh.getW idth(), finaleyesht)); lEyes1.setIcon(seleyesicn); } if(ae.getSource()==cNose) { int selind=cNose.getSelectedIndex(); ArrayList selnose=(ArrayList)noseAL.get(selind); Integer selnoseht=(Integer)selnose.get(1); finalnoseht=selnoseht.intValue(); Integer selnoseid=(Integer)selnose.get(0); cids[3]=selnoseid.intValue(); ImageIcon selnoseicn=(ImageIcon)cNose.getSelectedItem(); Rectangle rectnose=lNose1.getBounds(); Rectangle recthair=lHair1.getBounds(); Rectangle rectfh=lForehead1.getBounds(); Rectangle recteyes=lEyes1.getBounds();
  • 48. 48 lNose1.setBounds(new Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht+finaleyesht,(int) rectfh.getWidth(), finalnoseht)); lNose1.setIcon(selnoseicn); } if(ae.getSource()==cLips) { /*ImageIcon sttLips=(ImageIcon)cLips.getSelectedItem(); ht5=sttLips.getIconHeight(); int wt5=sttLips.getIconWidth(); lLips1.setBounds(400,ha4,wt5,ht5); ha5=ha4+ht5; lLips1.setIcon(sttLips); lip=cLips.getSelectedIndex();*/ int selind=cLips.getSelectedIndex(); ArrayList sellips=(ArrayList)lipsAL.get(selind); Integer sellipsht=(Integer)sellips.get(1); finallipsht=sellipsht.intValue(); Integer sellipsid=(Integer)sellips.get(0); cids[4]=sellipsid.intValue(); ImageIcon sellipsicn=(ImageIcon)cLips.getSelectedItem(); Rectangle rectfh=lForehead1.getBounds(); Rectangle recthair=lHair1.getBounds(); Rectangle recteyes=lEyes1.getBounds(); Rectangle rectnose=lNose1.getBounds(); Rectangle rectlips=lLips1.getBounds();
  • 49. 49 lLips1.setBounds(new Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht+finaleyesht+fin alnoseht,(int)rectfh.getWidth(), finallipsht)); lLips1.setIcon(sellipsicn); } if(ae.getSource()==cChin) { int selind=cChin.getSelectedIndex(); ArrayList selchin=(ArrayList)chinAL.get(selind); Integer selchinht=(Integer)selchin.get(1); finalchinht=selchinht.intValue(); Integer selchinid=(Integer)selchin.get(0); cids[5]=selchinid.intValue(); ImageIcon selchinicn=(ImageIcon)cChin.getSelectedItem(); Rectangle rectfh=lForehead1.getBounds(); Rectangle recthair=lHair1.getBounds(); Rectangle recteyes=lEyes1.getBounds(); Rectangle rectnose=lNose1.getBounds(); Rectangle rectlips=lLips1.getBounds(); Rectangle rectchin=lChin1.getBounds(); lChin1.setBounds(new Rectangle((int)rectfh.getX(),(int)recthair.getY()+finalhairht+finalfhht+finaleyesht+fin alnoseht+finallipsht,(int)rectfh.getWidth(), finalchinht)); lChin1.setIcon(selchinicn); } if(ae.getSource()==bSave) { Rectangle recthair=lHair1.getBounds();
  • 50. 50 lHair1.setBounds(new Rectangle((int)recthair.getX(),(int)recthair.getY(),(int)recthair.getWidth(),(int)recthair. getHeight())); Rectangle rectfh=lForehead1.getBounds(); nextheight=(int)recthair.getY()+(int)recthair.getHeight(); lForehead1.setBounds(new Rectangle((int)rectfh.getX(),nextheight,(int)rectfh.getWidth(), (int)rectfh.getHeight())); Rectangle recteyes=lEyes1.getBounds(); nextheight=nextheight+(int)rectfh.getHeight(); lEyes1.setBounds(new Rectangle((int)recteyes.getX(),nextheight,(int)recteyes.getWidth(), (int)recteyes.getHeight())); Rectangle rectnose=lNose1.getBounds(); nextheight=nextheight+(int)recteyes.getHeight(); lNose1.setBounds(new Rectangle((int)rectnose.getX(),nextheight,(int)rectnose.getWidth(), (int)rectnose.getHeight())); Rectangle rectlips=lLips1.getBounds(); nextheight=nextheight+(int)rectnose.getHeight(); lLips1.setBounds(new Rectangle((int)rectlips.getX(),nextheight,(int)rectlips.getWidth(), (int)rectlips.getHeight())); Rectangle rectchin=lChin1.getBounds(); nextheight=nextheight+(int)rectlips.getHeight();
  • 51. 51 lChin.setBounds(new Rectangle((int)rectchin.getX(),nextheight,(int)rectchin.getWidth(), (int)rectchin.getHeight())); nextheight=nextheight+(int)rectchin.getHeight(); int crid=0; try { ResultSet rs=st.executeQuery("select max(crimeid) from face_suspectphoto"); if(rs.next()) { String crimeid=rs.getString(1); if(crimeid!=null) crid=Integer.parseInt(crimeid); crid++; writePhoto(cids,crid); st.executeUpdate("insert into face_suspectphoto(crimeid, suspectphoto, photo_height) values("+crid+",'suspect"+crid+".gif',"+nextheight+")"); for(int i=0;i<6;i++) { st.executeUpdate("insert into face_suspects(crimeid, cid) values("+crid+","+cids[i]+")"); } JOptionPane.showMessageDialog(this,"Photo saved successfully for the Crime Identification Number: "+crid, "Crime Status", JOptionPane.INFORMATION_MESSAGE); } }catch(Exception e) {
  • 52. 52 JOptionPane.showMessageDialog(this, e.getMessage(), "Construct Image", JOptionPane.ERROR_MESSAGE); } } } public void writePhoto(int a[],int crid) { try { FileOutputStream suspectfout=new FileOutputStream("Suspectssuspect"+crid+".gif"); DataOutputStream suspectdout=new DataOutputStream(suspectfout); FileInputStream hairfin=new FileInputStream("Clipshairhair"+cids[0]+".gif"); DataInputStream hairdin=new DataInputStream(hairfin); while(hairfin.available()>0) { suspectdout.writeInt(hairdin.readInt()); } hairfin.close(); hairdin.close(); FileInputStream fhfin=new FileInputStream("Clipsforeheadforehead"+cids[1]+".gif"); DataInputStream fhdin=new DataInputStream(fhfin); while(fhfin.available()>0) { suspectdout.writeInt(fhdin.readInt()); } fhfin.close();
  • 53. 53 fhdin.close(); FileInputStream eyesfin=new FileInputStream("Clipseyeseyes"+cids[2]+".gif"); DataInputStream eyesdin=new DataInputStream(eyesfin); while(eyesfin.available()>0) { suspectdout.writeInt(eyesdin.readInt()); } eyesfin.close(); eyesdin.close(); FileInputStream nosefin=new FileInputStream("Clipsnosenose"+cids[3]+".gif"); DataInputStream nosedin=new DataInputStream(nosefin); while(nosefin.available()>0) { suspectdout.writeInt(nosedin.readInt()); } nosefin.close(); nosedin.close(); FileInputStream lipsfin=new FileInputStream("Clipslipslips"+cids[4]+".gif"); DataInputStream lipsdin=new DataInputStream(lipsfin); while(lipsfin.available()>0) { suspectdout.writeInt(lipsdin.readInt()); } lipsfin.close(); lipsdin.close();
  • 54. 54 FileInputStream chinfin=new FileInputStream("Clipschinchin"+cids[5]+".gif"); DataInputStream chindin=new DataInputStream(chinfin); while(chinfin.available()>0) { suspectdout.writeInt(chindin.readInt()); } chinfin.close(); chindin.close(); suspectdout.close(); suspectfout.close(); }catch(Exception e) { JOptionPane.showMessageDialog(this, e.getMessage()); } } } class ConstructFace { public static void main(String ar[]) { Construct ob=new Construct(); ob.show(); ob.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } }
  • 55. 55 FIND FACE import java.awt.*; import java.awt.event .*; import javax.swing.*; import javax.swing.event.*; import java.sql.*; import java.awt.image.*; import java.io.*; import java.util.*; import javax.swing.border.*; public class FindFace extends JFrame { Connection cn; Statement stmt; boolean selectstatus=false; int cids[]=new int[6]; public FindFace() { initComponents(); setSize(650,650); java.awt.Dimension screen=java.awt.Toolkit.getDefaultToolkit().getScreenSize(); java.awt.Rectangle frame=getBounds(); this.setLocation((screen.width-frame.width)/2,(screen.height- frame.height)/2); setTitle("Find Face & Criminal Details Screen");
  • 56. 56 setResizable(false); try { Class.forName("org.sqlite.JDBC"); Database d1=new Database(); cn=DriverManager.getConnection("jdbc:sqlite:mydb.sqlite"); stmt=cn.createStatement(); ResultSet rs=stmt.executeQuery("select *from face_suspectphoto"); cmbCrimeId.removeAllItems(); cmbCrimeId.addItem("Select"); while(rs.next()) { cmbCrimeId.addItem(rs.getString(1)); } }catch(Exception e) { javax.swing.JOptionPane.showMessageDialog(this, e.getMessage(), "Suspect Details", javax.swing.JOptionPane.ERROR_MESSAGE); } selectstatus=true; } private void initComponents() { lblPhoto = new javax.swing.JLabel(); cmbCrimeId = new javax.swing.JComboBox(); lblCrimeId = new javax.swing.JLabel(); btnAllSuspects = new javax.swing.JButton(); btnMostSupspect = new javax.swing.JButton(); btnClose = new javax.swing.JButton();
  • 57. 57 jLabel1 = new javax.swing.JLabel(); getContentPane().setLayout(null); addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt); } }); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); getContentPane().add(lblPhoto); lblPhoto.setBounds(200, 200, 250, 280); cmbCrimeId.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbCrimeIdActionPerformed(evt); } }); getContentPane().add(cmbCrimeId); cmbCrimeId.setBounds(90, 100, 160, 25); lblCrimeId.setText("Crime ID"); getContentPane().add(lblCrimeId); lblCrimeId.setBounds(20, 100, 150, 16); btnAllSuspects.setText("Show All Suspects"); btnAllSuspects.addActionListener(new java.awt.event.ActionListener() {
  • 58. 58 public void actionPerformed(java.awt.event.ActionEvent evt) { btnAllSuspectsActionPerformed(evt); } }); getContentPane().add(btnAllSuspects); btnAllSuspects.setBounds(20, 550, 200, 30); btnMostSupspect.setText("Show Most Suitable Supect"); btnMostSupspect.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnMostSupspectActionPerformed(evt); } }); getContentPane().add(btnMostSupspect); btnMostSupspect.setBounds(230, 550, 200, 30); btnClose.setText("Close"); btnClose.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCloseActionPerformed(evt); } }); getContentPane().add(btnClose); btnClose.setBounds(450, 550, 100, 30); jLabel1.setFont(new java.awt.Font("Times New Roman", Font.BOLD/Font.ITALIC, 25)); jLabel1.setText("Suspected Criminal Faces"); getContentPane().add(jLabel1); jLabel1.setBounds(150, 10, 300, 30);
  • 59. 59 pack(); } private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) { setVisible(false); dispose(); } private void btnMostSupspectActionPerformed(java.awt.event.ActionEvent evt) { new ShowMaxPossibleSuspect(this, true, cids, false).show(); } private void btnAllSuspectsActionPerformed(java.awt.event.ActionEvent evt) { new ShowMaxPossibleSuspect(this, true, cids, true).show(); } private void cmbCrimeIdActionPerformed(java.awt.event.ActionEvent evt) { if(cmbCrimeId.getSelectedIndex()!=0) { String crimeid=cmbCrimeId.getSelectedItem().toString(); try { ResultSet rs=stmt.executeQuery("select * from face_suspectphoto where crimeid=" +crimeid); String photofile=""; int photoheight=0; while (rs.next()) { photofile=rs.getString(2);
  • 60. 60 photoheight=Integer.parseInt(rs.getString(3)); } FileInputStream fin=new FileInputStream("Suspects" + photofile); DataInputStream din=new DataInputStream(fin); int len=fin.available(); int pixels[]=new int[len]; int i=0; while(fin.available()>0) { pixels[i]=din.readInt(); i++; } fin.close(); din.close(); Image clipimg=createImage(new MemoryImageSource(200,photoheight,pixels,0,200)); ImageIcon eyesicn=new ImageIcon(clipimg); lblPhoto.setIcon(eyesicn); rs.close(); rs=stmt.executeQuery("select * from face_suspects where crimeid=" + crimeid); i=0; while(rs.next()) { cids[i]=Integer.parseInt(rs.getString(2)); i++; } }catch(Exception e) { javax.swing.JOptionPane.showMessageDialog(this, e.getMessage(), "Photo Status", javax.swing.JOptionPane.ERROR_MESSAGE); } }
  • 61. 61 } private void formMousePressed(java.awt.event.MouseEvent evt) { } private void exitForm(java.awt.event.WindowEvent evt) { System.exit(0); } public static void main(String args[]) { new FindFace().show(); } private javax.swing.JButton btnClose; private javax.swing.JButton btnMostSupspect; private javax.swing.JButton btnAllSuspects; private javax.swing.JLabel lblPhoto; private javax.swing.JLabel lblCrimeId; private javax.swing.JComboBox cmbCrimeId; private javax.swing.JLabel jLabel1; }
  • 62. 62 5.4 TESTING The completion of a system is achieved only after it has been thoroughly tested. Though this gives a feel the project is completed, there cannot be any project without going though this stage. Though the programmer may have taken many precautions not to commit any mistakes that crop up during the execution stage. Hence in this stage it is decided whether the project can under go the real time environment execution without any break downs, therefore a package can be rejected even at this stage. The testing phase involves the testing of the developed system using various kinds of data. An elaborated testing of data is prepared and a system is tested using the test data. While testing errors are noted and corrections remade, the corrections are also noted for future use. 5.4.1 SYSTEM TESTING Testing is a set of activities that can be planned in advance and conducted systematically. The proposed system is tested in parallel with the software that consists of its own phases of analysis, implementation, testing and maintenance. Following are the tests conducted on the system. 5.4.2 UNIT TESTING During the implementation of the system each module of the system was tested separately to uncover errors with in its boundaries. User interface was used as a guide in the process.
  • 63. 63 Table.5.4.2 Unit Testing Sr.No. Screen Input Output Remarks 1 Login Page User Id Password User validation User will enter into Main Screen 2 Main Screen  File  New Criminal Details are entered Details are stored in the database New Menu is selected to enter new criminal details. 3 Main Screen  File  Show Details Display option is clicked. Criminal Details are displayed Display details menu is selected to get details from database. 4 Main Screen  File  Exit Exit Option is Clicked. Screen will be exited Screen will be shut down 5 Main Screen  Edit  Clip Image Criminal Image is clipped into different parts The clips are stored in database Clip image menu is selected to clip image and store them in database 6 Main Screen  Edit  Update Details Changes in the details of the criminals are entered Details of the criminal are updated Update details menu is selected to update the details of the criminals 7 Main Screen  Identificatio n  Construct Face Different clips of criminals are selected and arranged in order Face of the criminal is constructed Construct face menu is to construct the criminal face from various clips stored in the database.
  • 64. 64 8 Main Screen  Identificatio n  Find Face Show all suspects is checked All suspects detail along with photo are displayed Show more suspect menu is selected to get the details of all suspects and more possible suspect involved in crime. 9 Main Screen  Help  About About Face Identification is checked The version and the overview of the system is displayed About face identification system menu is selected to get the details of above system.
  • 65. 65 6.1 FUTURE WORK All current face recognition algorithms fail under the vastly varying conditions under which humans need to and are able to identify other people. Next generation person recognition systems will need to recognize people in real-time and in much less constrained situations. Technology used in smart environments has to be unobtrusive and allow users to act freely. Wearable systems in particular require their sensing technology to be small, low powered and easily integral with the user's clothing. Considering all the requirements, identification systems that use face recognition and speaker identification seem to us to have the most potential for wide-spread application. Audio and video based recognition systems have the critical advantage that they use the modalities humans use for recognition. Finally, researchers are beginning to demonstrate that unobtrusive audio-and-video based person identification systems can achieve high recognition rates without requiring the user to be in highly controlled environments. 6.2 CONCLUSION The purpose of face Identification system is to identify criminals. 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 overcome 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 crime occurs we compare the details given by the eyewitness with the clips already stored in the database and we will identify the criminal. 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.
  • 66. 66 7 REFERENCES IEEE/REPUTED JOURNAL PAPERS [1]Yang M.H., Kriegman D.J., and Ahuja N., “Detecting Faces in Images: A Survey”, IEEE Transaction on Pattern Analysis and Machine Intelligence, Vol.24, No.1, January 2002. [2] Rowley H. A., Baluja S. , Kanade T., “Neural Network- Based Face Detection”, IEEE Trans. On Pattern Analysis and Machine Intelligence, vol.20, No. 1, Page(s). 39- 51, 1998. [3] S. Arya and D.M. Mount. Algorithms for fast vector quantization. In J. A. Storer and M. Cohn, editors, Proceedings of DCC 93: Data Compression Conference, pages 381– 390. IEEE Press, 1993. BOOKS [4] Herbert Schildt,”The Complete Reference Java2”, Tata McGraw-Hill, Chapter No.1, publishing Company Limited, Page. No.3-9. [5] Roger S. Pressman,”Software Engineering”, A Practitioner’s Approach”, Tata McGraw-Hill Publishing Company Limited, Page. No.6-13. WEBSITES [6] http://www.java.sun.com/products/java.index.php [7] http://www.facedetec tion.org/ facedetec tion [8] http://www.faceidentification.com.php