Main Document
Main Document
By
Joseph Kalunga
LUSAKA
Date 2015
DECLARATION
I, Joseph Kalunga, do declare that this dissertation is entirely my own work, except
as specified in acknowledgements, and that neither the dissertation nor original work
contained herein has been submitted to this or any other institution for the higher
degree.
Signed …………………………………………
Date……………………………………………..
Lusaka, Zambia.
i
NOTICE OF COPYRIGHT
ix
CERTIFICATE OF APPROVAL
This thesis by Joseph Kalunga has been approved as fulfilling the requirements for the
award of the Masters of Engineering degree in ICT Security by the University of
Zambia.
NAME SIGNATURE
…………………………………. …………………………….
Supervisor
…………..…………………………… ………………………………….
Internal Examiner 1
……………………………………….. ……………………………………..
Internal Examiner 2
………………………………………... ………………………………………..
External Examiner
x
ABSTRACT
xi
ACKNOWLEDGEMENT
xii
DEDICATION
xiii
TABLE OF CONTENT
DECLARATION ....................................................................................... i
CERTIFICATE OF APPROVAL........................................................... x
ACKNOWLEDGEMENT .....................................................................xii
CHAPTER 1. INTRODUCTION............................................................ 1
1.1 Background .......................................................................................................... 1
xiv
1.11.3 Chapter 3: Methodology .............................................................................5
xv
3.1 Introduction ........................................................................................................ 23
xvi
4.5 Product Perspective ............................................................................................ 34
xvii
5.5.1 Enrolment ....................................................................................................61
6.4.2 Configurations.............................................................................................76
xviii
6.6.4 Bitmap Formatting ......................................................................................81
xix
7.6.1 Military Personnel Masters Record Report...............................................102
xx
REFERENCES ..................................................................................... 114
APPENDIX A: SECURITY CLEARANCE ........................................................ 119
C.3 Criminal Security Vetting Police reply Letter ( FZA MP 12A) ..................128
Appendix F.3 Service Personel Master Record Input Form Codes .................140
xxi
LIST OF TABLES
xxii
LIST OF FIGURES
xxiii
Figure 31: Fingerprint Enrollment Process Results ..................................................... 95
Figure 32: Fingerprint Verification Results ................................................................. 96
Figure 33: (a) Fingerprint Image Acquisition Form .................................................... 97
Figure 34: Criminal Vetting automated form .............................................................. 97
Figure 35: Master Record Military Personnel Data Input Form .................................. 98
Figure 36: Master Record Civilian Personnel input form ............................................ 99
Figure 37: Service men Case History Input form ...................................................... 100
Figure 38: Civilian Personnel Case Record Input form ............................................. 100
Figure 39: Fingerprint Analysis form ........................................................................ 101
Figure 40: Service Bio Identity Card ......................................................................... 102
Figure 41: Military Personnel Master Report ............................................................ 102
Figure 42: Rank Report .............................................................................................. 103
Figure 43: Criminal Vetting Fingerprint Report ........................................................ 103
Figure 44: Service Personel Man Number Master Record ........................................ 104
Figure 45: Service Personel Master Record Inquiry Report ...................................... 105
Figure 46: Disciplinary Record Report Sorted by Unit ............................................. 106
xxiv
LIST OF ABBREVIATIONS
xxv
SDK System Development Kit
SSL Secure Sockets Layer
TIS Top Sharpening Index
SNR Signal- to-Noise Ratio
TSA Template Synthesis Algorithm
UML Unified Modeling Language
SDLC System Development Methodology
XML Extensive Mark-up Language
xxvi
CHAPTER 1. INTRODUCTION
1.1 Background
The current method for human identity authentication and verification in the Zambia
Army is manual. Military Police (MP) uses National Registration Card of the guest to
authenticate and verify the true identity of an individual. This approach has security
concerns such as impersonation and masquerading as possessing someone else’s
identity. Biometrics identifiers cannot be easily misplaced, forged, or shared and they
are considered to be more reliable for personal recognition than traditional token (e.g.
key or card) or knowledge (e.g. password or pin) based method. Additionally,
Military police records and employment vetting procedures are manually performed
and stored on hard copies. Thus, Manual procedures are associated with a lot of
problems such as huge operational cost, technological obsolesce, storage issues,
redundancies, inaccuracy, tediousness and labour intensiveness.
1
1.2 Aim
The aim of this research was to improve security in the barracks through development
and deployment of security applications that integrates fingerprint biometrics into the
military police database.
As stated ealier, military police security procedures in Zambia are manual. This
entails that human identity identification is done through the usage of code words,
service identity cards, national registration cards, driving licence or travelling
passports for guests. Service men and women are identified by service IDs which
lacks proper security features. Moreover, civilian visitors are required to produce a
national registration card for security clearance every time they are visiting military
barracks. In the same regard, foreigners may use travelling passports but before that,
they must seek national security clearance from the Ministry of Defence (MOD).
Furthermore, the current system for office procedures and record keeping is manual.
This is to suggest that criminal investigations and analysis of evidence is also done
manually. Apart from that, the database for the current serving and retired officers is
not in existence. This situation makes it hard for military police to investigate certain
cases of fraud and impersonations. Finanally, in terms of employment; criminal
vetting procedures for new officers and men is also manual.
The current system is associated with a lot of problems include: (i) Cost: Government
is spending huge sums of money on security vetting of new employees joining the
system due to manual procedure; (ii) Technological Obsolete: The current
technologies employed in fingerprinting were old and in some cases obsolete due to
introduction of new technologies on the market today; (iii) Storage Problem: Vetting
forms (FZA MP 12A) have been in use for many years. In case of Zambia, these
forms have been accumulated for more than fifty years which have created storage
problems; (iv) Inefficient, Duplication of work, time consuming and Labour
intensive: The current system is deemed inefficient and labour intensive because of
high percentage of human intervention, and (v) Security Concerns: The current
system procedures have a lot of security vulnerabilities in terms of mechanism and
2
application and (vi) Identity Verification problem: the current system has
challenges interms of verifying identities of similar personalitities such as resembled
and identical twins.
1.5 Motivation
The motivation was derived from the increase in demand of biometrics systems
globally and the desire to improve the security situation in the Zambia Army through
the development of a military police database that integrates fingerprint biometrics
systems into the aforementioned database. Therefore, the developed application is
planned to be deployed at sentry posts (gates) and military police headquarters for
storage, retrieval and analysis of military police data.
1.7 Objectives
3
1.8 Methodology
The study adopted angile software development strategy with system development
life cycle (SDLC) methodology. The combination of model includes stages such as
requirement gathering, analysis, design, development and product testing for errors.
The two models were choosen because of their characteristics centered on clear, fixed
and well documented requirements. Additionally, product definations and tehnologies
are well known (fingerprint biometrics and c sharp programming language) stable and
not dynamic.
4
1.11.1 Chapter 1: Introduction
Chapter one gives the background to the research, defined problem statement, aims,
motivation, specific objectives and scope of study.
Methodology described the techniques used in the study to achieve the desired results.
This chapter provided detailed examination of the elements and structures of the
developed system.
This chapter designed architecture, modules and interfaces of the developed system.
System Development chapter translated the design document into computer language.
It involved development of data input forms, reports and routines.
5
CHAPTER 2. LITERATURE REVIEW
2.1 Introduction
The background information analyses the biometrics systems with respect to human
biological and behavioural characteristics.
6
less systems, chip card interface device (CCID), USB that allow smart card to connect
to the computer, student identification, ticket system, medical care and pay television.
Most of it is applicable in pre-paid transactions.
However, the technology has suffered massively in terms of security. There are three
categories of security problems on smart Technology (Boswell, 2009). The security
vulnerability include: (i) Logical Attacks: exploits that use bugs in the software
implementation, (ii) Physical Attacks: exploits that use analysis or modification of the
smartcard hardware and (iii) Side Channel Attacks: exploits that use physical
phenomena to analyse or modify the smartcard behaviour. These problems most often
have resulted in eavesdropping, interruption of service, denial of service and
counterfeit (KO & Claytiles, 2011). The vulnerabilities like these ones have paved
way for biometric authentication developments (Jimoh et al., 2011).
7
practical problems like noise in sensor, non-universality, lack of distinctiveness in
biometric traits, an acceptable error rate and spoof attacks ( Fons, & Cantó, 2012; Jain
et al., 2005). Additionally, Each biometric system has its benefits and defects in so
far as no single biometric can effectively meet all requirements (Chao,Yi-Xian,Xin-
Xin, 2006).
Among the biometrics technologies, the fingerprint system is the most mature, widely
used, acceptable, less costly and considered proof of evidence in the courts of laws all
over the world (Jain et al., 2002). Fingerprints are commonly used because their
configuration does not change throughout an individual’s life time (Chaudhari et al.,
2014; Jain et al., 2002). Even when fingerprints temporarily change slightly due to
cuts and bruises, they tend to reappear after the healing process (Bhattacharya & Mali,
2013). This makes the fingerprints suitable for human identity verification and
authentication (Jain et al., 2002 & Maltoni, Maio,Jain,Prabhakar, 2002 ). However,
the use of fingerprint has remained predominately for police purposes (O’Gorman,
1999). But this will soon change because of a combination of factors that favours the
use of fingerprints for the much larger market of personal authentication. These
factors include: small and inexpensive fingerprint capture devices, fast and less
expensive computing hardware, the explosive growth of network and Internet
transactions, increase authentication rate , speed to meet the needs of many
applications, and the heightened awareness of the need for ease-of-use essential
component of reliable security (O’Gorman, 1999).
8
2.2.4 Biometrics Deployed with other Security Mechanism
Because of the problems associated with single identifier biometrics systems, some
researchers have proposed the employment of multimode biometrics traits and others
have proposed for the combination of the biometrics with traditional security
mechanisms. Multimodal biometrics systems are more robust than unimodal
biometrics (Ak Jain & Kumar, 2010; Zhu & Zhang, 2010). Multimode biometrics
systems take advantage of multiple traits to improve the performance in many aspects
including accuracy, noise resistance, universality, spoof attacks and reduced
performance degradation in large databases (Zhu & Zhang, 2010). Additionally,
biometrics has been employed in police forensic references where fingerprints are
identified against criminal record in the process called criminal vetting (Lewis, 2014).
In travelling industry, biometrics have been used with smart chips embedded passport
and facial image(Bolle, Senior, Ratha, & Pankanti, 2006; Lewis, 2014; Y. Liu, 2011).
However, even the security system with all those trait combination can be breached
somehow (Boswell, 2009; Breebaart, Buhan, De Groot, & Kelkboom, 2011;
Martinez-Diaz, Fierrez, Galbally, & Ortega-Garcia, 2011).
The deployment of a fingerprint system is not new to security organisations. Since the
year 1960, police forces have used fingerprints for security vetting and forensic
investigation. Many are times when police collect fingerprint impressions from the
crime site and taken them to Universities or forensics labs for enhancement and
comparison with a National fingerprint database for criminal identification. This
technology and many other advanced security tools were developed in the military
and then off-loaded to the police for enhancement of urban public safety (Nunn,
2001). Some other governments have developed standard security application for their
law enforcement organisations in particular Canada which has developed MorphoBis,
the next generation fingerprint biometric system for Calgary Police Service and
Edmonton Police Service (Caldwel, 2011).
Biometric applications have been deployed in military both in peace and war times.
The following were success stories of biometric system in military: (i) Identifying
9
Non-Military Personnel: The US, UK Ministry of Defence and NATO forces used
biometrics systems to identify non-military personnel in countries where their troops
have been deployed(Gold, 2010), (ii) Identify Prisoners: US Army used biometrics
system to identify prisoners of war captured in Iraq and Afghanistan ( Gold, 2010;
Mansfield-Devine, 2012, 2012; Nunn, 2001), (iii) Actionable Intelligence: Biometrics
has been used to detect enemy forces infiltrating ground of Tactical Importance
(GTI). In other applications, fingerprints taken from the remains of detonated
Improvised Explosive Devices (IEDs) has not only resulted in identifying the bomb
maker or person who planted it but, through cross-correlation with other intelligence
information, this has led to an understanding of the structure of Insurgents cells( Gold,
2010;Mansfield-Devine, 2012 & Nguyen, 2015), (iv)Tracking Terrorist: The Loyal
Netherlands and Denmark Army used biometric in Afghanistan for tracking terrorists
and US Government have deployed biometric system at national airports world-wide
for the same purpose (Gold, 2014; (―Law enforcement agencies tap into biometrics,‖
2012; Nguyen, 2015)),(v) Identify Slain Terrorist: US Army deployed face
biometrics when identifying Osama bin laden killed in Pakistani (Biometric
Technology Today, May 2011),(vi) Biometrics Identity Card:US Marine used faces
and fingerprint traits to develop Identity Cards for service men and civilians working
for them in Afghanistan and Iraq. In the same vain, the Afghan Government has
Introduced biometrics Identity Cards for police and the military (Gold, 2010;
Mansfield-Devine, 2012) and,(vii) Protection of Military facilities: Biometrics has
been deployed in South East- Asia to protect US Army facilities (Gold, 2010;
Mansfield-Devine, 2012). Indian Army also has deployed biometric system to protect
their national border (Adams, 2000; Mansfield-Devine, 2012)
Security vetting is one of the methods security wing employees to ascertain the true
identity of applicant enlisted for national service (Prisons, 2014). Vetting process may
be conducted for employment, criminal record information, security service record
and financial irregularity assessments. In military this role is performed by the police.
Automate vetting system process was conducted in Australia, New Zealand
government and United States department of homeland security. In new land security
vetting is conducted by national Intelligency agency. The need for security vetting in
10
three nations was feasibly an anti-terrorism measures. This was to ensure that right
people were employed to handle classified information (Register et al., 2000).
Most advanced security technologies used in police and civilian applications such as
the one installed at national airports world-wide originate from military. The Defence
Advanced Research Project Agency (DARPA) and US department of Defence (DOD)
developed technologies such as photonics, thermo imaging, and behavioural
recognition system like DNA testing which originated from the military under
military-to-civilian technology transfer (Nunn, 2001).
2.2.5.4 Challenges
The main challenges many Military Establishments are facing in the implementation
of biometric systems include privacy issues, mobility of enemies, cost and legal
challenges (Gold, 2014).
Fingerprints are the skin patterns formed on the epidermis of the fingertip. These skin
patterns are sometimes referred to as fingerprint features and are represented by the
collection of ridges and valley on the surface of the fingertip (Hong & Wan, 1998;
Nagaty, 2005). Ridges and valleys are broken further into other features called
minutiae. Minutiae are the discontinuities in local ridge structure and they are used by
investigators to match two fingerprints (Chaudhari et al., 2014; Nagaty, 2005).
Scientists discovered about 150 different types of minutiae in the fingerprint
(Chaudhari et al., 2014). Among these minutiae types ―ridge ending‖ and ―ridge
bifurcation‖ are the most commonly used as all the other types of minutiae are
combinations of ridge endings and ridge bifurcations. A ridge ending is defined as the
ridge point where a ridge ends abruptly and A ridge bi-furcation is defined as the
ridge point where a ridge forks or diverges into branch ridges (Chaohong, 2007,
young, 2008 & Maltoni et al, 2003). Researchers’ have further classified fingerprint
features into secondary classification and Henley classification. Fingerprint
classification is important in large databases to simplify searching process (Awad &
Baba, 2012; Prabhakar, 2001). Figure 1 Shows fingerprint minutiae type:
11
Figure 1: Fingerprint Minutiae Type
Source: (Chaudhari et.al 2014)
Fingerprint features are organised into three levels, level 1 to level 3 (Cappelli &
Ferrara, 2012; Chaudhari et al., 2014; F. Liu, Zhao, & Zhang, 2011; Vatsa, Singh,
Noore, & Morris, 2011). These levels include: (i) Level-1(global) features: Level 1
feature refers to the global ridge orientations and singular points. This representation
relies on the ridge structure, global landmarks and ridge pattern characteristics. The
commonly used global fingerprint features are singular points which are
discontinuities in the orientation field (Bazen, 2002). There are two types of singular
points and these are core and delta (Cao, Pang, Liang, & Tian, 2013; Cappelli
&Ferrara, 2012). A core is the uppermost of the innermost curving ridge and a delta
point is the junction point where three ridge flows meet. In the Phd thesis, Chaohong,
2007 revealed that fingerprint core and delta are usually used for fingerprint
registration and classification in the biometric systems, (ii) Level-2 (local): Local
feature includes minutiae details extracted from the ridge skeleton. Level 2 features
include ridge ending, ridge bifurcation, bridge and ridge close. Level 2 feature are
used for fingerprint matching (Cao et al., 2013; Cappelli & Ferrara, 2012), and Level
3 (Fine-detail) includes intra-ridge details such as width, shape, ridge contours, sweat
pores, and creases. Based on the position on the ridges, pores are often divided into
two categories: open and closed. A closed pore is entirely enclosed by a ridge, while
12
an open pore intersects with the valley lying between two ridges. Level3 features are
used for matching the templates (Galar, M. et al 2015).
13
2.3 Design and Development
14
between them in terms of a matching score, also known as similarity score. The
matching score is compared using system threshold to make the final decision. If the
match score is higher than the threshold, the person is recognized, otherwise not and,
(v) Data storage: data sorage is dedicated for templates storage and other demographic
information. Depending on the application, the template may be stored on either
internal or external storage devices (Yoon 2014, pp.16; Maltoni, 2005; Prabhakar,
2001).
The fingerprint biometric system could be developed using one or combination of the
following methods:
The pixel-level approach uses the fact that fingerprint is made up with white and
black bounded number of pixels. The parameters are the widths of black and white
boundary of scanned fingerprint image ( Lin, Chen, & Tseng, 2011).
15
2.3.2.4 Filtering and Wavelet Approach
Filtering and wavelet development approach is a one-step method using Gabor filters
for directly extracting fingerprint features for a small-scale fingerprint recognition
system. The method uses k-NN classifiers. Block wise Fourier transform is multiplied
by its power spectrum raised to a power, thus magnifying the dominant orientation
(Montoya Zegarra et al., 2009).
16
impression. In most recent fingerprint scanners, rectangular area is sacrificed to
reduce on cost. However, a smaller area scanner do not allow whole fingerprint to be
captured, and users may encounter difficulties in representing the similar portion of
the finger. This may result in a small overlap between different acquisitions of the
same finger, leading to false acceptace and non-matching errors. (Moltoni et al,
2009& Liu et al., 2011).
2.3.3.2 Resolution
Resolution indicates the number of dots or pixels per inch (dpi). 500 dpi is the
minimum resolution for FBI-compliant scanners and is met by many commercial
devices; 250 to 300 dpi is probably the minimum resolution that allows the extraction
algorithms to locate the minutiae in fingerprint patterns ( Hong, & Wan, 1998 &
Maltoni, 2005).
The number of pixels in a fingerprint image can be simply derived by the resolution
and the fingerprint area: a scanner working at R dpi over an area of Height (h) Width
(W) inches2 has R.h×R.W pixels (Maltoni, 2005). If the area is expresses in mm2, the
formulae must include mm to inch conversions and, therefore, the number of pixels
may be computed as given in equation 1.
17
2.3.3.5 Gray-level Quantization and Gray Range
This denotes the number of bits used to encode the intensity value of each pixel. The
FBI standard for pixel bit depth is 8 bits, which yields 256 levels of gray image
(Maltoni, 2005).
The spatial frequency response denotes the ability of an acquisition device to transfer
the details of the original pattern to the output image for different frequencies. It is
well-know that the fine details corresponding to the high frequencies tend to be
smoothed out when a signal is digitally sampled. Spatial frequency response is usually
measured through Modulation Transfer Function (MTF) or Contrast Transfer
Function (CTF) as explained in Nill (2005); a specific measure for fingerprint
scanners, called Top Sharpening Index (TSI), was introduced by Ferrara, Franco, and
Maltoni (2007).
It is not easy to precisely define the quality of a fingerprint image, and it is even more
difficult to decouple the fingerprint image quality from the intrinsic finger quality or
status. In fact, when the ridge prominence is very low (especially for manual workers
and elderly people), when the fingers are too moist or too dry, or when they are
incorrectly presented, most of the scanners produce poor quality images (Maltoni,
2005)
The signal to noise ratio quantifies the magnitude of the noise with respect to the
magnitude of the signal. The signal magnitude is related to the gray-range in the
output image while the noise can be defined as the standard deviation of the gray-
levels in uniform gray patches.The above described parameters and their
specification are designed fingerprint standards for American security intelligence
body Federal Beraul of intelligency (FBI) as extracted from fingerprint biometrics
handbook (Moltoni el al, 2009). For complete reference table of FBI
Recommendation check appendix D table D.2.
18
2.4 Feature Enhancement
In pixel-wise image processing operation, the new value of each pixel only depends
on its previous value and some global parameters (but not on the value of the
neighboring pixels). Pixel-wise techniques do not produce satisfying and definitive
results for fingerprint image enhancement. However, contrast stretching, histogram
manipulation, normalization and Wiener filtering have been shown to be effective as
initial processing steps in a more sophisticated fingerprint enhancement algorithm.
The normalization approach determines the new intensity value of each pixel in an
image as illustrated in the formular below:
………………….. (2)
Wherem and v are the image mean and variance and m0 and v0 are the desired mean
and variance after the normalization (Hong, Wan& Jain, 1998, 2000 and Jain et.al
2006). Figure 3 (a) shows original image which is in enhance in Figure 3 (b)
19
(a) (b)
The most widely used technique for fingerprint image enhancement is based on
contextual filters. In conventional image filtering, only a single filter is used for
convolution throughout the image. In contextual filtering, the filter characteristics
change according to the local context. Usually, a set of filters is pre-computed and one
of them is selected for each image region. In fingerprint enhancement, the context is
often defined by the local ridge orientation and local ridge frequency. In fact, the
sinusoidal-shaped wave of ridges and valleys is mainly defined by a local orientation
and frequency that varies slowly across the fingerprint area. An appropriate filter that
is tuned to the local ridge frequency and orientation can efficiently remove undesired
noise and preserve the true ridge and valley structure. Several types of contextual
filters have been proposed in the literature for fingerprint enhancement. Although they
have different definitions, the intended behavior is almost the same and includes: (1)
provides a low-pass (averaging) effect along the ridge direction with the aim of
linking small gaps and filling impurities due to pores or noise; (2) performs a
bandpass (differentiating) effect in the direction orthogonal to the ridges to increase
the discrimination between ridges and valleys and to separate parallel linked ridges (
Cappelli & Ferrara, 2012; Jain et.al, 2006 ; Khalil, Mohamad, Khan, & Al-Nuzaili,
2010).
Based on the features used in fingerprint matching, most existing algorithms can be
classified into two categories: minutiae-based approaches and global feature-based
approaches. It is widely believed that minutiae are the most discriminating and
20
reliable features in fingerprints. Many matching methods based on minutiae have been
proposed (Maltoni et al, 2009). Since the relative transformation between two
fingerprints is unknown in advance, the correspondence between minutiae is very
ambiguous. Many researchers have tried to attach local features to minutiae to reduce
ambiguity. These local features include ridge information (Jain et al., 1997a; He et al.,
2003), local orientation features sampled around the minutiae (Tico and Kuosmanen,
2000) and local minutiae structure features (Chen et al., 2006; Ratha et al., 2000).
Recently, He et al. (2006) proposed a global comprehensive similarity-based
fingerprint matching algorithm, in which a minutiae-simplex, including a pair of
minutiae as well as their associated textures, were employed to achieve fingerprint
matching. This approach represent fingerprint as a graph, in which the
comprehensive minutiae acted as the vertex set and the local binary minutiae relations
were used to provide the edge set. Some researchers combined other local features to
increase the discriminative ability between minutiae (Cao et.al 2012).
2.5 Critique
Fingerprint Biometric system design lack prescribe standard. This was evident
in many algorithm that researcher have recommended.
According to the definition of biometric system which is defined as
―Automated method for verifying or identifying living individuals based on
physiological or behavioural characteristics ―(Abhyankar & Schuckers, 2009).
This definition is contrary to what the author reported in biometric today of
May, 2011 where it stated ―The US Military used face biometrics recognition
to identify slain al-Qaida leader Osman bin Laden‖. Biometric system does not
apply to dead human beings.
Biometrics systems developments forgo privacy and legal public concern.
The literature is silent on the provisions for disabled people, people who have
lost two hands. In the developed system, this requirement is taken care of
using the national registration card details and passport size photo of the
disabled.
21
The literature is also silent on legal framework governing the development of
biometric system.
2.6 Summary
22
CHAPTER 3. METHODOLOGY
3.1 Introduction
Methodology chapter refers to the strartegies that is used to structure, plan, and
control the process of developing an integrated fingerprint biometrics system for
military organisation. There are wide variety of such strategies and have evolved over
the years of which each of them has its own recognized strengths and weaknesses. In
this study, we have used angile method with water fall system development life cycle
methodology. Angile is used in this research because the requirements and solutions
of developed system evolve through collaboration between self- organizing cross-
functional teams.
The research was conducted at Zambia Army Headquarters Military Police Unit
department of administration branch. For research timeline and project schedule refer
to appendix section B.
The target population included the provost marshall, military police officers, military
intelligence officers, sentries and military legal officers.
23
review was also used to acquire information on the developed fingerprint biometric
system.
Data collection was conducted to provide the solution for objective 1 to 4 of our study
and the following methods were employed:
24
3.5.2 Record Inspection
Record inspection was conducted which included the review of written policy manual,
government forms, regulations, and standard operational procedures used in
organisation as guide for officers and men. This method was employed to understand
the framework or rather operating procedures for the military police. Record
inspection was used because it provides more operation details than any other
methods (senn, 1998: 117-118). In record inspection the following were conducted:
3.5.3 Observation
Observation data collection method was used to learn and verify phenomena
procedures and operation of the military police. The main strength of observation is
that it provides direct access to the social occurrences under consideration. Instead of
depending on some kind of self-report, such as asking people what they would do in a
certain situations, you actually observe and record their behaviour in that situation.
This method was used to capture classified information. However, the disadvantage of
observation method is that it is extremely time consuming and resource intensive
(Senn, 1998: 119-120). During observation method, particular attention was paid to
the following items in order of security importance:
a. Step one; observed organisation security rules, standing procedures and laws.
b. Step two; observed identification process of visitors, dependants and military
personnel in plane cloths.
c. Step three; observed the process of conducting criminal vetting for new
employees.
d. Step four; observed how military police conducted operations with an
intention to identify key players.
e. Step five; observed the roles, departments and duties of each actor.
25
f. Step six; observed security techniques or mechanisms (forms of
identification).
g. Step seven; observed how records were managed at military police
headquarters.
The existing system was studied and evaluated. Prior to detailed investigation, a
feasibility study was conducted aimed at exploring available technologies (technical
feasibility), costs (economic feasibility) and operational issues (operational
feasibility). Tools employed included unstructured interviews, observation and record
inspection as described in data collection methodologies above. The output was user
requirement elicitation.
26
3.6.2 Approach for Analysis
Analysis in this study involved overall system description which included product
view, project philosophy and description of military police procedures. The section
also analysed architectural design of the new system which include biometrics and
security vetting system. Analysis in a nutshell detailed the requirement engineering
aspect of the research. Requirement engineering phase included problem domain
definition using rich picture, behaviour modelling; using use case diagrams,
requirement elicitation; using derived requirement model that resulted in functional
and non-functional requirements specification. The process modelling was conducted
using activity diagrams. Ultimately, analysis stage gives way to system design stage.
Figure 4 shows a system development life cycle (SDLC).
The system design describes the operating environment, system and subsystem
architecture, files and database design, input formats, output layouts, human-machine
interfaces, processing logic, and external interfaces of AFBSMO. The data processing
model employed during database design stage included schema diagram and entity
relational ship diagram, While class diagram was used for business logic or
application design. The design was performed in the following manner:
27
c. Step three- Process design.
The Construction and Assembly phase focused on transforming the design into a
working system that satisfies all the requirements. Any special procedures for data
conversion and/or data warehousing was also be developed and tested during this
phase. Various technological implementations had been explained in this stage.
Application developments were executed in the following order:
System testing is categorised into two software and hardware testing. Software or
hardware testing was conducted on a complete, integrated system to evaluate the
system's compliance with its specified requirements. System testing falls within the
scope of black box testing, and as such, should require no knowledge of the inner
design of the code or logic. The testing was conducted in the following order:
a. Unit testing.
b. Modular testing.
c. Application testing.
28
3.6.6 Approach for Software Evaluation
Evaluation stage assessed the necessity, quality and matters addressed by the
developed product. The aim of system evaluation was to collect information about
the developed product as a whole, performance and any other details that are helpful
in guiding success of the developed application.
The approach for determining main module involved understanding the main
components of the project and grouping them into modules (i.e. identity verification
and military police modules). The modular application development approach was
adopted. An understanding of the relationships and inter-modular communication was
important. Inter-modular data flows were elaborated by procedures, Data Flow
Diagrams (DFDs), class diagram and database schemas diagram.
Image Segmentation
Feature Matching
Fingerprint Image
Enhancement
Image Binalisation
Thinning
Skeleton Image
29
3.8 Approaches for Database Development
3.9 Materials
Materials used in this study are categorized into hardware and software’s. Hardware
category involves physical components such as fingerprint sensor and digital camera.
Software components include visual studio, SDK kit and other software applications.
The design specification of both hardware and software are given in table 1 below.
For detailed specification and costing check appendix section B.
Software
Version 2010
- Visual Studio
- Wamp Server Version 2.2
- Microsoft Project Version 2003
- Microsoft Visual Version 2003
30
3.10 Summary
This chapter discussed research approaches used in this study. Theses approaches
include the data collection, analysis and system development methods. Furthermore,
the chapter tabulated various materials and their specifications used in the study.
31
CHAPTER 4. ANALYSIS
4.1 Introduction
The current military police procedures in the Zambia Army are manual and therefore,
the organisation was facing the following difficulties:
The current security vetting process of new employee is costly in terms of material
requirements and time. It demands for the large usage of paper, ink and stamp.
Additionally, the current process is dirty and slow because of procedure. Criminal
vetting process is currently conducted by military police in conjuction with civil
police. Civil police is collaborated in this exercise because they hold national criminal
record register. The national criminal record register is manual and hence costly in
terms of time to complete vetting exercise.
The current technologies employed in fingerprinting are old and in some cases may be
declared obsolete because of current introduction of new technologies on the market.
32
For example, the vetting process was being conducted using ink, stamp and prescribed
government forms. Fingerprint evidence analysis was being done by human
comparison of fingerprint features between the evidence print and the actual print
taken from a suspect for that purpose. Some of the technologies being used are old
and are not mentioned here for national security reasons. Additionally, there was a
concern of technological obsolete of some items being used by military police
because manufacturers had stopped production due to the new innovation or creeping
into the market demand.
Storage problems were also reported due to large volume of papers which was being
used. It was established that a lot of files were created and the documents were kept
properly in those files. Military organisation is much organised in terms of record
keeping but the study discovered that the organisation was overwhelmed with the
storage space. The filling system was traced way back to 1964. The oldest file was in
February 1964. Some files were taken to archive. A classic example is vetting form
(FZA 12A) check appendix section B.
Labour intensity is high in any manual system. The current system was deemed
inefficient and labour intensive because of high percentage of human intervention.
Human intervation resulted in Inefficient, Duplication of work, time consuming and
Labour intensive. It was also discovered that manual intervention resulted in resource
mismanagement in terms of human deployments. A lot of people were attached to a
job which can be done by a single person.
33
or barracks. This in itself presented security concern to the Zambia Army. Other
security concerns were traced from the banquet hall constructed at the heart of Army
Headquarters offices which host civil functions such as wedding and other social
meetings. This building presented a security issue at the Zambia Army Headquarters
because of social attachment to it.
The current problem domain was modelled using soft system methodology (SSM)
called rich picture. Rich picture represent traditions, customs, believes, wishes,
emotions, misunderstanding, prepositions, possible occurrences, fear and dreams of
people in an organisation. The rich picture is a flexible soft system development tool
that gives developers chance to present problem domain in pictorial form according to
the way they have understood the problem domain ( Horan, 2000). Figure B.3
Appendix shows the rich picture representing the problem domain, procedures,
emotion, behavioural, traits, wishes, expectation of people in military organisation
towards terrorism and other related crimes.
The requirements for developing a new system were divided into fingerprint
biometrics and military police database requirements. The two requirement type was
integrated to form an automated integrated fingerprint biometric system for military
organisation (AFBSMO).The integration of biometric application into military police
database provides the military organisation with the required security resilience. On
the other hand, AFBSMO would improve military police service delivery. But before
then, the product has to be described and modelled in the suitable way befitting
software development processes. This includes providing documentation of the
developed system as it transverse from one development stage to another.
The automated fingerprint biometrics system for the military organisation is a new
system that was intended to replace the current manual human identification and
security vetting systems in the Zambia Army. The context diagram in Figure 6
illustrates the external entities and system interfaces for release. The system was
34
expected to evolve over several releases, ultimately deployed at various barracks and
formations.
The philosophy behind the developed new system was to amend the security
weaknesses identified in the current manual system. The current system is associated
with various problems indicated in fact finding results of this chapter. These problems
should be alleviated in order to improve institutional security provision and service
delivery. Institutional security provision and service delivery can only be improved
through business process refinement and automation. In this research input variables
were sourced from Army form (FZA MP 12A see Appendix). The FZA MP 12A form
contains information such as applicant details, fingerprint template, recording officer
information, criminal data and human descriptive information. Examining this
information could give birth to three security layers with special application to the
military organisation. The first layer is the fingerprint biometric systems that could be
deployed at gates for human identification and access control. The second layer is the
production of automated service identification card. The last layer involved collection
35
of security information from the Guests. For the new system processes, actors and
procedure data flow refer to Figure 7.
The database for military police is used for storage of military police data both in
peace time and war times. It consists of tables, queries and store procedures dedicated
for police duties. Police database was designed to depict manual interventions
according to the roles and duties of Regimental Military Police (RMP).
The Military Police are required to provide tactical military police support to the
Zambia Army in military operations. When deployed, some of the roles the
regimental military police performs include:
36
General criminal investigation in peace time and war crime investigation in
war time.
Handling and collecting criminal evidence.
Reconnaissance patrols.
Prisoner handling.
Search operations and road blocks.
General policing duties within operational bases.
Foreign police and military training
Provide close protection operatives for senior military personnel on operations
The military police (MP) unit is responsible for maintaining law and order within the
military. In peace time, military police are deployed at entry point (gates) to control
traffic and provide security of the military offices, personnel, installations, military
stock both inside and outside the barracks. Civilian Guests are compelled to disclose
their true identity which is verified by details on their identity card or travelling
passport. Foreigners are required to obtain security clearance from Ministry of
Defence (MOD) each time they intend to visit a barrack. The technique of verifying
the identity of an individual using NRC or passport is undesirable for the military
organisation because of the reported security flaws in the mechanisms and technique.
Military police also perform criminal vetting in conjunction with civil police on
recruits and officer cadet joining the service. In vetting process the total of ten (10)
fingerprints are captured from each applicant and manually recorded on FZA 12A
forms. The tools employed in this process include Army form FZA 12A, ink, tipexand
stamp. However, this technology is old, dirty, costly, time consuming and tedious in
operation.
37
committed and identity information of both officers in active service and reserve
forces.
The process of human identification in the military goes beyond the normal
fingerprint biometric systems. The development and usage of biometrics systems in
any organisation is dependant on the policy. The biometric system developed for
military is totally different from the civil or domestic one. This is due to the fact that
the nature of the military organisation demands extreme security resilience and
accurate mechanisms. Generally, biometrics systems suffers from the problems of
false acceptance (FA) and false rejection (FR) which may be caused by orientation of
finger on the sensor, the physical condition of the sensor and the physical state of the
finger( e.g. finger may be greased, burnt, masked or scratched on the fore skin).
Therefore, as a result of these challenges, redundancy fingerprints are created. Instead
of capturing only a single print, military biometric system capture ten fingerprints
which could be easily referred to in order to clarify any issue. The same ten
fingerprints are reused for criminal vetting. On top of the 10 prints left and right
thumb are captured simultaneously and stored as a single image. Additionally, left and
right palm print are also captured and stored for extended identification. Ultimately, a
fingerprint biometrics system developed for military organisation is usually large in
scope and demand high levels of accuracy.
38
Figure 8:Fingerprint Biometrics Design
Fingerprint scanner is the device that is used to capture fingerprint images from a live
human finger. The fingerprint scanner is used as a principal security device in
fingerprint biometrics system for live human identification and authentication.
39
the image on the database table. The fingerprint scanner is used in this
process.
(ii) Normalisation; Normalization operation acts on the input fingerprint
image to standardize image pixel intensity values. In this study the
research used image brightness normaliser code. Normalisation is the pre-
processing stage in fingerprint template generation and is defined by
variance analysis as illustrated in equation 3:
(( ) )
√ ( )
( ) ......................................... (3)
(( ) )
√
{
Where:
M and V are the estimated mean and variance of image I (i; j), respectively,
and M0 and V0 are the desired mean and variance values, respectively.
(iii) Segmentation. Segmentation is performed to separate foreground from
background region. The research implemented theotsu Variance
thresholding method on normalized fingerprint images. When minutiae
extraction algorithms are applied directly to fingerprint image contains the
background, the operation tend to generate noise result in false minutiae.
The grey-level variance for a block of size W×W was calculated as shown
in equation 4:
Where:
V (k) is the variance for block k, image I (i, j) is the grey-level value at
pixel (i, j), and M (k) is the mean grey-level value for the block k.
(iv) Enhancement. The configuration of parallel ridges and valleys with well-
defined frequency and orientation in a fingerprint image provide useful
information which helps in removing undesired noise. Gabor filter was
applied because it has both frequency-selective and orientation-selective
properties and have optimal joint resolution in both spatial and frequency
domains. Therefore, it is appropriate to use Gabor filters as band pass
filters to remove the noise and preserve true ridge and valley structures.
40
(v) Binalisation. Binalisation is the final stage in fingerprint pre-processing
stages. It converts a grey level image into a binary image by improving
the contrast between the ridges and valleys in a fingerprint image, and
consequently facilitates the extraction of Minutiae. BW(x, y) represent the
binary image which could be obtained by the equation 5:
( ) { ( )
Otherwise…………………………………………………………………. (5).
(vi) Thinning. Thinning process is a morphological operation that successively
erodes away the foreground pixels in binary image until they are one pixel
wide. The Thinning operation falls under feature enhancement stage of
fingerprint image processing. Its main purpose is to create skeletonised
binary image. Image filter is applied to digitalised image.
(vii) Minutiae Detection. The skeleton image is then used in the subsequent
extraction of minutiae using cross numbering (CN) method proposed by
Rutovitz. CN is computed by equation 6:
∑ ……………………………………………. (6)
After the CN is computed , the pixelsare is classified according to the property of its
CN value (Chaudhari et al., 2014).
During the enrolment stage, biometric data are obtained, linked with identity, and
encoded for storage, retrieval and matching. Fingerprint scanners are used to collect
data and verify identities (Clodfelter, 2010).
4.6.2.3 Identification
41
tasks defined by end users or application code, for example, a batch job or Extraction
algorithm, Transformation, and Loading (ETL) processing. The basic database
operation includes insert, update, delete and search operations which were
implemented in the study. Other database relation operation includes Union, Selection
and append.
4.6.3 Database
The database component of AFBSMO is responsible for data storage. The database
consists of tables which are physical structures responsible for data storage. A table is
broken further into attributes. From the above explanation, the table can be defined as
the collection of related attributes while relational database may be defined as the
collection of relations.
42
4.6.4 Behavioural Modelling
The use-case diagram was used to envisage the behaviours of various objects in
AFBSMO. Use-case diagram depicts graphically system actors, goals and their
dependencies (Pooley & Stevens, 1999). The use-cases include; verify Identity, Enrol
Fingerprint, Identification, Criminal Vetting, Criminal Investigation, Fingerprint
Donor, Forensic Investigation and Fingerprint Analysis as shown in Figure 9:
Use cases were described by stating the associated actor or actors, preconditions,
description, exceptions and post-conditions as follows:
Preconditions: Guests must visit the barrack and submit personal identity (NRC or
passport)
43
Description: Military police is in charge of security in the barracks. When the guest
visits the barracks they are asked to identify themselves. After identification process,
Guests are told to produce their NRC or passport for the officer to verify the identity.
Exceptions: Service Personnel, Member of public not in possession with NRC and
foreigners without security clearance.
Preconditions: Guest must visit the barrack and submit personal identity (NRC or
passport) and should be Guests visiting the barracks for the first time.
4.6.5.3 Identification
Actors: The main actors are Military Police and biometric system.
Preconditions: Guest must visit the barrack and submit personal identity (NRC or
passport), fingerprint donated and should have been enrolled in the biometric system.
Fingerprint sensor must be connected to the computer.
Description: Military police enrol fingerprint of Guests on the biometric system. The
Guest fingerprint is registered in the database. In the next visit the system will
recognise the enrolled Guest.
Exceptions: Service Personnel, Member of Public not in Possession with NRC and
Foreigners without Security Clearance.
44
4.6.5.4 Fingerprint Donation (Acquisition)
Actors: The main actors are Military Police, fingerprint sensor, Guest (Job
Applicant), CIO and biometric system.
Preconditions: Guest must visit the barrack and submit personal identity (NRC or
passport) and should have been enrolled in the biometric system. Fingerprint sensor
must be connected to the computer.
Exceptions: Member of public without NRC and Foreigner Guests without security
clearance from the Ministry of Defence.
Actors: The main actors are forensic investigator and biometrics system.
Exceptions: N/A.
45
4.6.5.7 Security Vetting
Actors: The main actors are CIO, job applicant and biometric system.
Preconditions: Guest must visit the barrack and submit personal identity (NRC or
passport) and should have been enrolled in the biometric system. Fingerprint sensor
must be connected to the computer.
Description: Ten (10) fingerprints are captured and compared with those fingerprints
of people who committed criminal offence before.
Description: Capture fingerprint both for Biometrics and for criminal vetting
46
(knowledge transfer) and the reviewed literature. Other sources of requirements are
given in introduction section of this chapter. Every piece of requirements was tested
against qualification strategy model as shown in Figure 10. The Specific Derived
requirements and their qualifying strategies are given in Table 2.
Serial
Specific Requirement Name Qualifying Strategies
No
1 Capturing particulars of a Guest Strategy to identify a Guest
2 Guest time in and time out Strategy to establish Guest visit time
3 Latent print Strategy to use fingerprint optical scanner.
4 Ten (10) fingerprint Strategy to identify a criminal
5 Enrol fingerprint Strategy to extract minutiae
6 Verify identity Strategy to verify a Guest
7 Develop Minutiae based fingerprint Strategy to improve accuracy
Strategy to automate and control Service ID
8 Capture passport size photo
issue
9 Fingerprint classification Strategy for searching
10 User levels of access Strategy to escalate Privileges
11 Capture fingerprint image Strategy to acquire fingerprint for vetting
Strategy to establish the committed name of
12 Crime name
crime
13 Type of crime Strategy to define punishment
14 Punishment Strategy to define jail term
47
15 Create database Strategy for storage
16 Fingerprint scanner Strategy to capture fingerprint
18 Security of the system Strategy to secure the system
System requirements can be categorised into two types: functional and non-functional
requirements. Functional Requirement outlines functions of the system and its
components. Typically, functional requirements specify behaviour of the system. The
behaviour of the system includes the set of inputs, business logic and outputs. Non-
functional requirements describe how the system works and that include specifying
system quality characteristics or quality attributes. Non-functional requirements are
sometime referred to as technical requirement. Non-functional requirement include
system reliability, security, maintainability, usability, scalability and accuracy.
Requirements were graded according to priorities or importance. The study graded
requirements as: (i) 1 = must implement, (ii) 2=should implement (time allowing) and
(iii) 3=be nice to have. The requirements and respective grades are shown in table 3
and 4 below.
1.7 Capture human criminal record Investigate crime & digital forensic 3
1.8 Capture Guest Time In and Time Out Registration & verify identity 2
1.9 Capture ten (10) fingerprint Fingerprint capture & security vetting 1
48
1.10 Display number on minutiae in the fingerprint Fingerprint capture. 3
The automated fingerprint biometric system for military organisation consists of many
activities. Firstly, guests visiting military barracks must identify themselves before
military police officers guarding the main gate or entry points who in turn verify
visitor identity through checking details appearing on guest NRC or passport. This
process is conducted manually. The critical attributes verified are names and photo
appearing on NRC or travelling passport. Figure 11 shows the main activity diagram
of an AFBSMO.
Verification use-case activity analysed the process which takes place when the
sightseer visit the barracks or restricted area. The guest identifies their individuality to
50
military police that is deployed at the gates. The activities and action are already
describe but amplified in Figure 12.
Fingerprint capturing activity diagram shows action takes place when a person
provides fingerprints to the military. Activities and action involved in fingerprint
donor activity diagram include pressing the finger on the scanner and image
acquisition. The acquired image is divided into two (2) streams according to the
usage. The image captured may be used either for biometrics or criminal
investigation/Service Identity card production. Biometric images are processed further
before storage while the criminal investigation image is saved directly in the relational
database table. Criminal investigation images can be used further in digital forensics.
Fingerprint donor activity diagram is shown in Figure 13.
51
Figure 13:Fingerprint Donor activity diagram
The fingerprint analysis activity diagram includes activities and actions performed by
CIO and that of biometrics system. Image capture for biometric usage normally
passes through pre and post image processing stage. The two stages are important
because fingerprint images captured from fingerprint sensor are normally noise and
include false minutiae as shown in activity diagram Figure 14:
52
Figure 14:Fingerprint Analysis activity diagram
Object Oriented Analysis model real-world entities using class diagram. The class
diagram is described as a static diagram in this study. It represents the static view of
the developed application. Class diagram is not only used for visualizing, describing
and documenting different aspects of a system but also for constructing executable
code of the software application. Class diagram is used to describe the attributes and
operations of a class and also the constraints imposed on the system. The class
diagrams are widely employed in the software modelling of object oriented systems
because they are the only UML diagrams which can be mapped directly with object
oriented languages. The class diagram shows a collection of classes, interfaces,
associations, collaborations and constraints. It is also known as a structural diagram
(Langer, 2008: 248-252). Figure 15 shows class diagram of AFBSMO.
53
Figure 15:Snap Class Diagram
54
CHAPTER 5. DESIGN
5.1 Introduction
Architectural design of the developed system is based on the three-tier model. The
three-tier model consists of presentation, middle and the data service tiers. Tiers in
computer science are sometimes referred to as layers. The three layers in this
architectural design are functionally independent but inter-linked and collaborative in
processing and resource allocation. The architectural design shown in Figure 16 is
logical representation of the developed AFBSMO.
5.2.1 Presentation-Tier
55
object oriented programming language and digital Personal Fingerprint System
Developer Kit (SDK). C# environment communicate with OS and database through
other components illustrated in architectural design shown in Figure above.
5.2.2 Middle-Tier
The middle-tier includes web server, MySQL Connector and application server.
Middle-tier is sometimes referred to as middleware. Middleware software is adaptor
applications software that acts as a bridge between an operating system or database
and applications, especially in client server architecture. The web server used in this
study was WAMP Server which is the database server for MySQL. MySQL database
does not communicate directly with visual studio application instead it communicates
through the middleware programs such as MySQL Connector, SQL Connector and
ODBC Connector as shown in Figure 5.2. In desktop application an application server
works as a compiler. It converts computer program written in high level language into
low level language for computer to interpret and understand.
The data layer interacts with persistent data usually stored in a database or in
permanent storage. This is the actual DBMS access layer. It can be accessed through
the business services layer and on occasion by the user services layer. This layer
consists of data access components (rather than raw DBMS connections) to aid in
resource sharing.
Scalability—Each tier can scale horizontally. For example, you can load-
balance the Presentation tier among three servers to satisfy more Web requests
without adding servers to the Application and Data tiers.
Performance—Because the Presentation tier can cache requests, network
utilization is minimized, and the load is reduced on the Application and Data
tiers. If needed, you can load-balance any tier.
Availability—If the Application tier server is down and caching is sufficient,
the Presentation tier can process Web requests using the cache.
56
However, this design introduces some process communication complexity because
modular communication is done through other programs. This approach makes the
process of program debugging difficult because the programmer may not effectively
trace which application error occurred.
The AFBSMO hardware design architecture consists of three (3) major components
namely personal computer, digital fingerprint scanner and digital camera. Personal
computer acts as a server, hosts the drivers for peripheral devices and software
development application. Fingerprint scanner is connected to computer through USB
port. Fingerprint scanner is used to capture and verify human finger. Digital camera
connects to the computer system using USB port. Both digital camera and fingerprint
scanner interact with the computer system through a middleware program called
drivers. Figure 17 shows hardware architectural design of AFBSMO.
57
5.4 Software Design
Software Design discuss all internal software components, including Cost of the shelf
(COTS) and their configuration. Provide detailed design for all software components
being built including software integration.
This project is divided into two main modules. The module for biometrics system
which is used for human identification and the module for military police
administration duties. Military police administration modules include classes used for
security vetting and general police duties as stated earlier. Figure 18 shows various
classes found in the developed system.
58
application. The applications referred to include MySQL database Server and middle
applications. Each of this application software performs specialised function.
MySQL is the world second most widely used relational database management
system (Solid IT, 2015). It is open source, scalable and support a lot of data format.
MySQL was used in development process as the relational database management
system (RDMS). MySQL database architecture is layered. The topmost layer contains
services mostly network-based client/server amenities which include connection
handling, authentication, security, and so forth. The second layer habor the brain of
MySQL relational database. It include threads controls, query parsing, analysis,
optimization, caching, and all the built-in functions such as dates, times, month, and
encryption. Any functionality provided across storage engines exists at this level.
Layer 2 also performs handshark process with Layer 3 processes to handle data
storage mechanisms. For architectural design refer to Figures 19.
59
5.4.2.2 Middleware
Visual studio is Microsoft developer suit. By default Visual studio was created to
support SQL database which is also Microsoft appropriatory software product.
MySQL database is an open source database and does not communicate directly with
visual studio development suit. The communication is facilitated by means of
employing a third hand tool called MySQL Connector. MySQL Connector works
exactly like Open Source Data Connectivity (ODBC) adaptor. The later could not be
used during development because its driver failed to detect the existence of MySQL
database on windows 7 64 bit.
The SDK Architecture consist of four basic components include application program,
ActiveX Control OCX, device drivers and the fingerprint sensor as shown in Figure
20. The four components provide interaction and communication between internal
and external interfaces. Internal interfaces refer to other components in computer
system while external interfaces refer to devices connected to computer system.
60
5.5 Biometric System Data Flow Design
5.5.1 Enrolment
61
Start
Enroll
Capturing Image
from the Sensor
N Quality =
500ppi
Compute Feature
Set
Increment Image
Count
Y
Select best
Feature Set
Apply Template
Creation Algorithm
y IsRegister=
True ?
Best
Template
Store
Stop
5.5.2 Verification
62
Figure 21: Verification
5.5.3 Identification
In identification process, the user does not explicitly claim an identity and the system
compares the feature set (extracted from the captured biometric sample) against the
templates of all (or a subset of) the subjects in the system storage. The output is a
candidate list that may be empty (if no match is found) or contain one (or more)
identifier(s) of matching enrolment templates. Since identification of large image in
the databases is computationally expensive, a pre-selection stage is often used to filter
the number of enrolment templates that have to be matched against the input feature
set. Figure 23 shows the biometrics identification process. The comparison is made
between a finger on the sensor with the minutiae points (template) stored in the
database. If there is a match identification process is successful or otherwise the
opposite is the case.
63
Figure 22:Identification Process DFD
64
Figure 23:Template Generation DFD
Zambian law requires individuals joining the service to undergo security vetting in
order to gain access to government information. Government information in this case
is referred to such information used civil Police, military and office of the president
(OP). Vetting is intended to assure government bodies that the individuals employed
in public service have not been involved in espionage, terrorism, sabotage or actions
intended to overthrow or undermine democracy by political, industrial or violent
means. It also assures the government department (service bodies) that the recruited
individuals have not been a member of, or associated with, any organisation which
has advocated such activities or has demonstrated a lack of reliability through
dishonesty, lack of integrity or behaviour. Finally the process assures the department
that the individual will not be subject to pressure or improper influence through past
behaviour or personal circumstances. The data flow diagram of vetting process is
shown in Figure 25.
65
Figure 24:Security Vetting DFD
Database design is the process of producing a detailed data model of the project data
base structures. The database design included the relational schema and entity
relationship database design.
The relational schema describes the names and structure of tables in the relational
database (Navathe, 2011). The names of the entities together with their associated
attribute are defined. The schema help developers to remove duplicate data and
enforce integrate in the database. In nutshell, relational schema describes how real
world entities are modelled in the database. The relational schema diagram for
AFBSMO is illustrated in Figure 26.
66
Figure 25:Relational Schema
67
Figure 26: Entity Relationship Diagram (ERD)
The structure chart design shows the breakdown of the system as per user
navigational levels. The first screens on the chart welcome users to the system. After
pressing next button users are prompted to enter user name, password and select the
security levels of access. In this project users of the system are scalable and are
categorized in three application security access levels. The three levels of access are
system administrator, sentry and chief investigating officer (CIO). The detailed
system navigation design chart is shown in Figure 28.
68
Welcome
Screen
The design chapter defined the architecture, components, modules and interfaces of
developed system. This chapter involved transformation of specified requirements
into product architectural design which described the structures and system behaviour.
Requirement transformation was modelled logically using component data flow
diagram and Entity Relationship Diagram (ERD). The chapter also covered physical
design which described user process design aspect which has resulted into system
development process. The next chapter described the product development stage.
69
CHAPTER 6. DEVELOPMENT
6.1 Introduction
Conceptual design guided the study into AFBSMO development process. Software
development involved transformation of design concepts into the actual product. The
actual software product was developed in two folds. The first stage was the creation
of the database and tables as prescribed in an ERD chapter five paragraph 5.6. After
the database was created, forms were developed and respective algorithms were
coded. This chapter briefly describes application development stages and constraints
resulted from that process.
6.2.1 MySQL
MySQL database is an open source application and runs on WAMP sever. The
WAMP server was downloaded from MySQL website. The downloaded version was
5.5.24 64 bit. The 64 bit WAMP was installed on windows 7 (64 bit). The global
variable port number 80 was changed to port 8080 to avoid conflict with IIS which
was running on port 80. By default WAMP Server runs on port 80.
70
6.3 Physical Development
Wamp server is software heap for the Microsoft Windows operating system. It
contains the Apache web server, Open SSL for SSL support, MySQL database and
PHP programming language. Before the database was created WAMP server was
conFigured to make sure that it was working properly. If the environmental variables
were not configured properly WAMP server would fail to start. It normally shows
umber colour an indication that the services have not yet started. Otherwise if
everything is perfects WAMP Server icon turns green. Some important information
about WAMP server and how the database was created in MySQL Database
Management System (DBMS) are shown in Figure 29.
71
Figure 28:WAMP Configuration
72
6.3.2 Database Schema Transformation
The database schema was transformed into physical objects called database and
tables. SQL statements were used to create database, table structures, attributes and
associated relationship as expressed in subsequent SQL statements below.
This is a main table which is used to store service pesonnel identity record and was
created using SQL statement CREATE table as:
This table is main table for storing civilian identity details. It includes relational
attributes and stipulated data type. The table was created using CREATE TABLE
mastertablecivilian as:
73
varchar(44) NOT NULL, `chief` varchar(25) NOT NULL, `tribe` varchar(20) NOT
NULL, `status` varchar(35) NOT NULL, `nationality` varchar(35) NOT NULL,
`EnlistmentDate` varchar(45) NOT NULL, `pathrthumb` varchar(45) NOT NULL,
`pathphoto` varchar(24) NOT NULL, PRIMARY KEY (`nrcno`), UNIQUE KEY
`nrcno` (`nrcno`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Fingerprint military table store service personnel fingerprints. The total of ten
fingerprints is stored per each individual service personnel. The table was created as
follows:
Fingerprint civilian table store service personnel fingerprints. The total of ten
fingerprints is stored per each individual personnel. The table was created as follows:
74
6.3.2.5 Case Military
Case Military table stores detail of cases (offences) that the service personnel has
commited during his service. The table was created as follows:
Case Civilian table stores detail of cases (offences) that the civilian personnel has
commited during the service in military. The table was created as follows:
6.3.2.7 Password
Password table stores users’ authentication details. When login the system users
supply authentication parameter which are stored in this table. The table was created
as follows:
75
CREATE TABLE `password` (‘username` varchar (45) NOT NULL, `password`
varchar (30) NOT NULL,`accesslevel` varchar(34) NOT NULL, PRIMARY KEY
(`username`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
6.4.2 Configurations
Configuration in this case is referred to global and local setting of the developed
application. Local settings are configuration of an application within the application.
It describes the environment under which the developed objects interact with each
other within an application. An example of this is how objects fingerprint analysis
(form) implement fingerprint image normalisation algorithm. Global settings refer to
how application objects utilise external objects. An example to this is how the
developed application communicates with fingerprint sensor and database. The
configuration parameters of each visual studio application are stored in the file called
app.config.
76
6.4.3 App.Config File
app.config file
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add
name="CSharpAFBSMO.Properties.Settings.fingerprint_biometricsConnectionString
"
connectionString="server=localhost;user id=root;database=fingerprint-biometrics"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<startup><supportedRuntime version="v4.0"
sku=".NETFramework,Version=v4.0"/></startup></configuration>
77
-------------- Code below shows Microsoft foundational library access by the system---
Database connection in this study was implemented using MySQL data adaptor
provided by MySql.Data.MySqlClient library. Library invocation is as shown in
paragraph 6.1. The Actual database name specified in RDBMS is fingerprint-
biometrics accessed on port 3306 of the local server. The owner (username) of
created database schema is root and the schema password is1q45ghh1 as given in the
code below:
78
using System.Data.Odbc;
using MySql.Data.MySqlClient;
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password= 1q45ghh1;";
The fingerprint scanner algorithm is responsible for fingerprint connection and device
management. The algorithm functionality was defined in ZKFPclass. ZKFPclass
invoked ZKFP.dll library which contain fingerprint sensor Application Program
Interface (API). The methods invoked in class include SensorInit (), SensorFree (),
SensorOpen, SensorClose (), SensorGetCount (), SensorGetVersion (),
SensorGetParameter () SensorSetParameterEx () and SensorCapture (). The class
shown in the code below define the fingerprint scanner connection methods (Sdk et
al., 2012).
--- Code below shows ZKFPCap class that initialises functionalities of fingerprint
sensor-----
79
Source :(Sdk et al., 2012)
--- Code below shows ZKFinger10 which imports dll libraries for fingerprint
processing---
80
publicstaticexternint BIOKEY_GETLASTQUALITY();
---Code Removed here
[DllImport(ZKFPRI_NAME, EntryPoint = "BIOKEY_IDENTIFYTEMP")]
publicstaticexternint BIOKEY_IDENTIFYTEMP(IntPtr Handle, byte[] Template,
refint TID, refint Score);
[DllImport(ZKFPRI_NAME, EntryPoint = "BIOKEY_VERIFY")]
publicstaticexternint BIOKEY_VERIFY(IntPtr handle, byte[] Template1, byte[]
Template2);
}
}
Source: (Sdk et al., 2012)
The fingerprint image format was developed in bitmap format class. BitmapFormat
class was defined by three (03) structures namely BITMAPFILEHEADER, MASK
and BITMAPINFOHEADER as shown in bitmap formatting code. The data type in
each structure was defined public in order to anywhere within an application. Bitmap
class was dissected further into other methods and functions.
81
publicbyte redmask;
publicbyte greenmask;
publicbyte bluemask;
publicbyte rgbReserved;
}
publicstruct BITMAPINFOHEADER
{
publicint biSize;
publicint biWidth;
publicint biHeight;
publicushort biPlanes;
publicushort biBitCount;
publicint biCompression;
publicint biSizeImage;
publicint biXPelsPerMeter;
publicint biYPelsPerMeter;
publicint biClrUsed;
publicint biClrImportant;
}
Source: (Sdk et al., 2012)
Rotational algorithm provides image orientation by computing specific image size and
formatting. Rotational algorithm once developed computed the image structure
orientation on the sensor and screen. Rotation code is shown as illustrated in the code
below:
--- Code below shows RotatePic class position the fingerprint pictures on the form ---
public static void RotatePic(byte[] BmpBuf, int width, int height, ref byte[] ResBuf)
{
int RowLoop = 0;
int ColLoop = 0;
82
int BmpBuflen = width * height;
try
{
for (RowLoop = 0; RowLoop < BmpBuflen; )
{
for (ColLoop = 0; ColLoop < width; ColLoop++)
{
ResBuf[RowLoop + ColLoop] = BmpBuf[BmpBuflen – RowLoop – width +
ColLoop];
}
RowLoop = RowLoop + width;
}}}
Source: (Sdk et al., 2012)
The computed image structure is converted to byte data structure by method Structure
To Bytes given below. The memory is managed by .NET marshal class which is
provided for by System Runtime.Interop Services.Marshalin .NET 4.0 frameworks
(Microsoft, 2015). The structure coversion is illustrated in below:
--- Code below shows public static byte [] StructToBytes which performs marshalling
process. .NET, marshalling is used to convert .NET's data into data suitable for
storage in the memory---
83
{
NewBytes[Count] = GetBytes[Loop];
Count++;
}}
return NewBytes;
}
else
{
return GetBytes;
}}
catch (Exception ex){ return GetBytes; } }
The fingerprint image is fitted in to compute byte structure using the method Get
Bitmap. Get Bitmap image regeneration function is defined by three structure headers
namely BITMAPFILEHEADER, BITMAPINFOHEADER and MASK. The
developed get Get Bitmap function is illustrated in the code below:
-----Use the GetBitmap function to obtain a particular image in the image list as a
bitmap object. ------
GetBitmap Fuction
publicstaticvoid GetBitmap(byte[] buffer, int nWidth, int nHeight, refMemoryStream
ms)
{{
BITMAPFILEHEADER BmpHeader = newBITMAPFILEHEADER();
BITMAPINFOHEADER BmpInfoHeader = newBITMAPINFOHEADER();
MASK[] ColorMask = newMASK[m_nColorTableEntries];
BmpHeader.bfOffBits = 10 + Marshal.SizeOf(BmpInfoHeader) +
84
BmpInfoHeader.biClrUsed * 4;
BmpHeader.bfSize = BmpHeader.bfOffBits + ((((BmpInfoHeader.biWidth *
BmpInfoHeader.biBitCount + 31) / 32) * 4) * BmpInfoHeader.biHeight);
---- coded removed here
ms.Write(StructToBytes(BmpInfoHeader, Marshal.SizeOf(BmpInfoHeader)), 0,
Marshal.SizeOf(BmpInfoHeader));
Bitmap image write algorithm is the final bevioural characteristic of the bitmap class.
The output image of this method is black and white reconstructed fingerprint image.
Write Bitmap was implemented as shown in code below:
85
BmpHeader.bfType = 0x4D42;
BmpHeader.bfOffBits = 14 + Marshal.SizeOf(BmpInfoHeader) +
BmpInfoHeader.biClrUsed * 4;
BmpHeader.bfSize = BmpHeader.bfOffBits + ((((BmpInfoHeader.biWidth *
BmpInfoHeader.biBitCount + 31) / 32) * 4) * BmpInfoHeader.biHeight);
BmpHeader.bfReserved1 = 0;
BmpHeader.bfReserved2 = 0;
Stream FileStream = File.Open("finger.bmp", FileMode.Create, FileAccess.Write);
BinaryWriter TmpBinaryWriter = newBinaryWriter(FileStream);
TmpBinaryWriter.Write(StructToBytes(BmpHeader, 14));
TmpBinaryWriter.Write(StructToBytes(BmpInfoHeader,
Marshal.SizeOf(BmpInfoHeader)));
for (ColorIndex = 0; ColorIndex < m_nColorTableEntries; ColorIndex++)
{
------ ColorMask[ColorIndex] conversion code
TmpBinaryWriter.Write(StructToBytes(ColorMask[ColorIndex],
Marshal.SizeOf(ColorMask[ColorIndex])));
}
RotatePic(buffer, nWidth, nHeight, ref ResBuf);
TmpBinaryWriter.Write(ResBuf);
FileStream.Close();
TmpBinaryWriter.Close();
}
catch (Exception ex)
{}}
Source: (Sdk et al., 2012)
The insert data method was used to populate relation in the database. The methods
include database connection definitions, data command definitions and data reader
definitions as shown in insert data code. The method also includes function to open
connection and function to Execute Reader. The routine for insert data method is
show in the code below:
86
----- Below code insert data into the database table-----
Update method is used to change the value of data stored in the table of database.
Update Data Method include database connection definitions, data command and data
reader definitions as shown in update data method. The method also includes function
to open connection and function to Execute Reader as illustrated in update method
below:
Update Method
MySqlDataReader ;
Connection String;
UPDATE table_name SET column1=value1,column2=value2,... WHERE
some_column=some_value;
MySqlConnection
MySqlCommand
try
{
con.Open();
87
rddata = cmd1.ExecuteReader();
The delete method is used to erase record from the Database. It includes definitions
such as data connection string, MySQL command, open connection function and
ExecuteNonQuery function. The syntax for delete method is given in the code below:
Delete method
MySqlConnection
DELETE FROM table_name WHERE some_column=some_value;
{
con.Open();
cmd1.ExecuteNonQuery();
}
finally
{
con.Close();
The image brightness method was implemented to increase amount of light for
reflexion. The brighter the item the more light it can reflect, the dimmer an item is the
less light it can reflect. Brightness method implemented deals with RGB color space.
It takes in an image and an integer between -255 and 255 in matrix to modify the
brightness of pixel. Brightness was implemented to aid human visual sensation
(Fords & Roberts, 1998b). The code for changing image brightness is shown below:
88
{
---declaration and other code removes here
---Matrix to increase brightness of an image
float[][] FloatColorMatrix ={
newfloat[] {1, 0f, 0f, 0f, 0f},
newfloat[] {0f, 1, 0f, 0f, 0f},
newfloat[] {0f, 0f, 1, 0f, 0f},
newfloat[] {0f, 0f, 0f, 1f, 0f},
newfloat[] {FinalValue, FinalValue, FinalValue ,0f,1f}
};
---some code removes here
contrast *= contrast;
int red, green, blue;
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(newRectangle(0, 0, b.Width, b.Height),
ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
89
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte* p = (byte*)(void*)Scan0;
int nOffset = stride - b.Width * 3;
for (int y = 0; y < b.Height; ++y)
{
for (int x = 0; x < b.Width; ++x)
{
blue = p[0];
green = p[1];
red = p[2];
---Code remove
p += 3;
}
p += nOffset;
}
}
UnlockBits(bmData);
returntrue;
}
The method of counting the number of black and white pixel was employed in this
research. Pixel Count Function input image and output number of black and white
pixels and then calculates the total number of Black and white pixels. The function
Count Pixels has two parameters Bitmap and colour as given in the code below.
90
{
int matches = 0;
for (int y = 0; y < bm.Height; y++)
{
for (int x = 0; x < bm.Width; x++)
{
if (bm.GetPixel(x, y) == target_color) matches++;
}}
return matches;
}
The Chapter described the construction process of the new system which involved
technical setting, database development and application coding. The next task of the
research was to test and record the result of developed application.
91
CHAPTER 7. RESULTS AND DISCUSSION
7.1 Introduction
This chapter unveils the results of study conducted at Army Headquaters military
police Unit Lusaka Zambia. The results of this study are associated with modalities to
improve security in the barracks through development and deployment of security
application that integrate fingerprint biometrics in military police database. Prio to
system development, data was collected through unstructured interview, observation,
record inspection (Army forms e.g. FZA 12A) and literature review. The requirements
were derived by using various data analysis models, product (software) designed and
implemented. The results in this research are expressed in terms functionalities
embodied in the developed system as prescribed by analysis and design chapter of this
study.
92
7.3 Functional Requirements Implementation
Functional requirements for the developed system were defined chapter 4 paragraphs
4.4.3.10, designed in chapter 5 paragraph 5.6 and coded in c# computer language as
illustrate in chapter 6 (development chapter). These functionalities were embodied in
developed system include login (application security screen), connect fingerprint
sensor, fingerprint enrolment, human identification, human identity verification,
capture fingerprint, criminal vetting, capture military / civilian personnel record,
capture military /civilian personnel case record, and fingerprint analysis. The screen
shot below illustrates the results of the study:
7.3.1 Login
Login form is the first screen the user access when intending to access the system
resources. The developed system has capability to define three types of users that is
users defined to operate at the main gate (Sentry), users defined to operate at military
police Headquarters for criminal investigating office (CIO) and System Administrator
(Administrator). Login screen is used to verify the authorize user of the system. The
snap shot of the Login form is given in Figure 29.
93
7.3.2 Fingerprint Sensor Connection
Sentry module was developed for setries deployed at the main gates of the barracks.
As discussed in introduction chapter of this study, the current mechanism of verifying
identity of individuals visiting the barracks in Zambia Army is manual and same
chapter has clearly atticulated the problems associated to this approach. In literature
review, we learnt that security forces of the developing countries adopted biometric
systems to solve similar problems. The sentry module was developed as an addon
feature to improve human identity verification in the army. The method of developing
94
fingerprint biometric technology was learnt from literature review. The sentry module
implemented fingerprint enrollement and identification requirements.
The fingerprint enrolment was developed in order to capture and store human
fingerprint image for utilisation in human identification .The template creation unit
organizes one or more feature sets into an enrolment template that will be saved in
some persistent storage. The enrolment template is sometimes also referred to as a
reference. Enrolment is the first stage of fingerprint recognition process as learnt from
literature review. This requirement was implemented and the results are shown in
Figure 31.
95
Figure 32: Fingerprint Verification Results
Criminal investigation usually probes serious violation of military law within the
army. It operates under the command of the Army provost marshal. Criminal
investigation module encompasses criminal record and offences concerning military
personnel. This module includes the functionality of conducting criminal vetting of
potential military employees. It involves fingerprint capturing, storage and
recongnition for criminal investigations purposes.
Fingerprint acquisition form is used to capture fingerprint and store them in to the
database. A total of ten (10) human fingerprint images are captured per donor using
the form shown on Figure 34. Each captured fingerprint may be compared by the
system against the same type of finger which is pressed on the sensor. For example a
stored thumb image may be compared against live thumb captured during
identification process as shown on the Figure 33 (a) and (b). This type of deliverable
may be used during criminal investigation process to identify the fingerprints of a
criminal. The same process is also conducted during security vetting of new
employees.
96
(a) (b)
Figure 33: (a) Fingerprint Image Acquisition Form (b) Fingerprint Identification Results
The form for security vetting has been automated as shown in Figure 34.
97
7.5.3 Master Record MilitaryPersonnel
Master record military form is used to capture service personnel identification details,
birth record and personal description. Additionally, right thumb fingerprint image and
passport size photo is also capture as shown in Figure 35.
Master record civilian input form captures the details of civilian employees and stores
them in the database. Civilian employees are citizens employed by the government to
work in military as non military personnel. They provide supplementary labour to
military work force. Civilian personal details are captured for security reasons. This
requirement is important and must be implemented to optimise security in the
military. Figure 36 shows civilian employees master record input form.
98
Figure 36: Master Record Civilian Personnel input form
Military personnel case record input form is used to capture offences committed by
service personnel during the service life time. This information is important for
human resources management. Disciplinary record of an individual is very impotant
more especially in military organisation where discipline is cardinal. The military
cases record input form is shown in Figure 37.
99
Figure 37: Service men Case History Input form
Civilian personnel case input screen is used to capture cases committed by civilian
employes while enganged to work in the military service and store them in the
military police for future references. This form is different from the one used for
service personnel because civilians employed in the military are not subjected to
military law except when deployed in special cases of national interest. Civilian
personnel case input form is shown in Figure 48.
100
7.5.7 Fingerprint Analysis
101
Figure 40: Service Bio Identity Card
Data Reports is another special result which involves creation of dynamic data views.
Reports are dynamic because they are dependant on specified parameters to fielter
information of interest.
This report shows the comprehensive list of all service personnel employed in the
army. Military personnel master record report is as shown in Figure 41.
102
7.6.2 Rank Report
Rank report shows military ranks defined in the new system. The extract report view
of ranks report is given in Figure 42.
Criminal vetting general Report shows the list of people vetted for criminality
involvements. The extracted view of this report contains false record for Mr Sandross
Kumwenda is shown in Figure in Figure 43.
The service Personel man number master report displays the comprehensive list of all
service personal with their passport size photo. This report is important for planning
103
and may be used to trace those people masquerade personal identity. Figure 44 shows
service Number Register. For other service register report formats see appendix E of
this report.
104
Figure 45: Service Personel Master Record Inquiry Report
105
Figure 46: Disciplinary Record Report Sorted by Unit
7.7 Summary
This chapter displayed some of the results generated by the Developed AFBSMO.
The result indicated that the developed application is capable identify enrolled
personel using the fingerprint. Additionally, the system is embodied with intelligence
to store record on the database and subsequently retrieve the same store records and
disseminate information on demand (reporting). The fact that the developed
application is also able store passport size photos resulted in the system generating
fingerprints biometric ID. The generated biometrics ID has improved security features
106
as compared to the manual service Identity Card. In the next chapter we discuss and
evaluate the performance of the developed application.
107
CHAPTER 8. EVALUATION
8.1 INTRODUCTION
Evaluation chapter assesses the necessity, quality and matters addressed by the
developed product. This is aimed at evaluating the performance of the developed
system and collecting information helpful in guiding success implementation. System
attributes evaluated were product necessity, technological costing, quality and how
this product contributed to fingerprint biometrics knowledge gaps.
The developed product is very necessary to the Zambia Army considering the
following reasons:
108
less than 100 dollar. Considering the developed functionality or results and the cost of
technologies employed, it is suffice to say that we made the precise choice of
technology in this study.
8.4 Quality
The quality of the developed product was measured based on accuracy, reliability,
maintainability, security, reusability, integration, reporting and scalability.
Accuracy of the sofware product measures the extent to which a program fulfils its
specification. The developed application has archieved all the fuctional requirements
stipulated in analysis chapter of this study. For example to evaluate the performance
of developed system FAR and FRR were calculated. In the first batch of 10
fingerprint enrolled, the total of 10 print were identified. In the next batch of 10 no
fingerprint was rejected. In the third batch no rejection was record again. Therefore,
biometric error allowance is provided for at the rate 0.001% FAR and 0.001% FRR.
This provision is learnt from the literature reviews stated that any biometric system is
associate with errors of false acceptance and false rejection due to various factors
stipulated in same chapter. The accuracy level of biometric sub system is good. From
preliminary results, the developed database for military police has also shown good
results in terms of record management. System uptime is pited at 99.9% reliable
because it does not depend on any internet connectivity. Reliability is an extent to
which a program can be maintained so that it can fulfil its specific function.
Product Maintenance involves tracing and correction of errors. The developed system
maintainability is rated at 60% because of the three-tier architecture implemented. It
is very difficult for unexperienced programmer to trace the actual source of error in
three-tier architecture. Security is implemented in traditional way using user name and
password and is rated at 50%. The security of this application is planned to be
enforced by third hand security tool such as firewalls. Re-usability addresses the
concept of writing code so that it can be used more than once. Code in this application
is highly reusable and is rated at 70% because in most cases the structure and the
syntax of the code remains the same but what changes frequently are variable names.
109
8.4.3 Integration and Reporting
8.4.4 Scalability
Knowledge gap is highlighted in literature of this study. This section appraise the
developed product against biometric standard, privacy issues, legal framework and
disability issues reported in literature review as lacking coverage in existing biometric
application. The study has evaluated these concerns as follows:
8.5.1 Standards
The issue of biometric standard is still unresolved. The research intended to use FBI
predefined stardards. For example fingerprint image Resolution prescribed by FBI
should be (RN) ≥500 dpi but instead we archieve (RN) ≥300 dpi. Other pararameters
too are different. This differences is due to the low quality of fingerprint sensor
(digitalpesona) used in this study. For details on biometric standards check appendix
section D.
Privacy and legal framework issues sorounding biometrics system and collection of
sensitive data have been resolved in this study. The product is supported legally
because in Zambia Nation security prevails over any other law or concern. The
110
developed application aim is to improve national security through integrating
biometrics system in military police database.
In literature review chapter, we learnt that most biometric system has not provided
modalities of identifying disabled people. In our study, these people are provided for
by means of employing their NRCs which has personal details and the system allow
capturing of passport size photos. The captured photo and other personal details are
stored in the database for future references.
8.5.4 Summary
This chapter evaluated the developed system based on product necessity, technology
costing and quality. From the evaluation process the developed system is rated above
average.
CHAPTER 9. CONCLUSION
9.1 Introduction
The overall aim of this research was to improve security in the barracks through
development and deployment of security application that integrate fingerprint
111
biometrics system in to military police database. The specific objectives of this
research were to investigate the system development process of an Automatic
Fingerprint Biometrics system and fuse it in the military police database.
After application design, the design docucument were translated into the actual
computer application. The application developed was a desktop application and is
named automated fingerprint biometric system for military organisation. It is
developed using MySQL database on Dot Net framework 4.0 and C# object oriented
112
programming language. The developed computer application for military police has
the following features:
9.4 Challenges
i. Some system development kit (SDK) classes could not work on visual studio
2010 developer kit.
ii. Microsoft foundational classes found in visual studio 2010 lacked specialised
image processing classes.
iii. Thinning process could not work on Dot Net framework.
iv. The biometric system is limited to enrol and verify ten fingerprints at time.
This is due to usage of domestic SDK.
v. The quality of fingerprint image produced by digital personal scanner contains
some black spots (noise). This could increase error rates in mutuae based
fingerprint biometrics system.
vi. The research lack digital camera for capturing identity card passport sizes
photos because of the cost of camera which was unaffordable. Hence,
experimental pictures captured into the system were downloaded from the
internet.
In future Biometrics system is expected to play a major role not only in military but
also other industries, such as medicine, science, robotics, engineering, manufacturing
and all areas of vertical enterprise businesses. Biometrics offers excellent value to
various industries, but also challenges to individual privacy. Besides that, the cost of
biometric devices is also expected to go down and therefore the number of biometrics
113
devices would explode on the market. In amide of these projections, the following are
recommended:
REFERENCES
Jia. A, Cai, L., Lu, P., & Liu, X. (2007). Fingerprint matching based on weighting
method and the SVM, 70, 849–858.
Clodfelter, R (2010). Journal of Retailing and Consumer Services Biometric
technology in retailing : Will consumers accept fingerprint authentication ? Journal of
Retailing and Consumer Services, 17(3), 181–188.
Abhyankar, A., & Schuckers, S. (2009). Integrating a wavelet based perspiration
liveness check with fingerprint recognition, 42, 452–464.
114
Adams, J. (2000). Biometrics and smart cards. Biometric Technology Today, 8(7), 8–
11.
Apacs, H. (2006). The Chip and PIN success story. Card Technology Today, 18(7–8),
10–11.
Awad, A. I., & Baba, K. (2012). Singular Point Detection for Efficient Fingerprint
Classification Graduate School of Information Science and Electrical Engineering
Kyushu University Library, 2(1), 1–7.
Bazen, A. M. (2002). Fingerprint Identification - Feature Extraction , Matching , and
Database Search.
Bhattacharya, S., & Mali, K. (2013). A Bar Code Design and Encoding for
Fingerprints. Procedia Technology, 10, 672–679.
Bolle, R. M., Senior, A. W., Ratha, N. K., & Pankanti, S. (2006). Fingerprint
Minutiae : A Constructive Definition. Lecture Notes in Computer Science, 2359, 58–
66.
Boswell, T. (2009). Smart card security evaluation: Community solutions to
intractable problems. Information Security Technical Report, 14(2), 57–69.
Bracha, H. S. (2006). Human brain evolution and the ―Neuroevolutionary Time-depth
Principle:‖ Implications for the Reclassification of fear-circuitry-related traits in
DSM-V and for studying resilience to warzone-related posttraumatic stress disorder.
Progress in Neuro-Psychopharmacology & Biological Psychiatry, 30(5), 827–53.
Breebaart, J., Buhan, I., De Groot, K., & Kelkboom, E. (2011). Evaluation of a
template protection approach to integrate fingerprint biometrics in a PIN-based
payment infrastructure. Electronic Commerce Research and Applications, 10(6), 605–
614.
Canadian police get real-time fingerprint and palm ID system. (2011). Biometric
Technology Today, 2011(6), 12.
Cao, K., Pang, L., Liang, J., & Tian, J. (2013). Fingerprint classification by a
hierarchical classifier. Pattern Recognition, 46(12), 3186–3197.
Cappelli, R., & Ferrara, M. (2012). A fingerprint retrieval system based on level-1
and level-2 features. Expert Systems with Applications, 39(12), 10465–10478.
Cappelli, R., Ferrara, M., & Maltoni, D. (2015). Large-scale fingerprint identification
on GPU. Information Sciences, 306, 1–20.
Chaudhari, A. S., Patnaik, G. K., & Patil, S. S. (2014). Implementation of Minutiae
Based Fingerprint Identification System Using Crossing Number Concept.
Informatica Economica, 18(1/2014), 17–26.
Danese, G., Giachero, M., Leporati, F., & Nazzicari, N. (2011). An embedded multi-
core biometric identification system. Microprocessors and Microsystems, 35(5), 510–
521.
De Marsico, M., Nappi, M., Riccio, D., & Tortora, G. (2009). A multiexpert
collaborative biometric system for people identification. Journal of Visual Languages
& Computing, 20(2), 91–100.
Egli, N. M., Champod, C., & Margot, P. (2007). Evidence evaluation in fingerprint
comparison and automated fingerprint identification systems — Modelling within
finger variability, 167, 189–195.
115
Fons, M., Fons, F., & Cantó, E. (2012). Biometrics-based consumer applications
driven by reconfigurable hardware architectures. Future Generation Computer
Systems, 28(1), 268–286.
Gold, S. (2010). Military biometrics on the frontline. Biometric Technology Today,
2010(10), 7–9.
Gold, S. (2014). Biometrics at the border. Biometric Technology Today, 2014(10), 5–
9.
Holder, E. H., & Robinson, L. O. (2010). U.S. Department of Justice Office of Justice
Programs. Juvenile Justice, 1–63.
Horan, P. (2000). Using Rich Pictures in Information Systems Teaching. 1st
International Conference on Systems Thinking in Mangement, 2000, 1, 257–262.
Jain, A. K., Hong, L., & Kulkarni, Y. (1999). A Multimodal Biometric System Using
Fingerprint, Face, and Speech. International Conference on Audio- and Video-Based
Biometric Person Authentication (AVBPA).
Jain, A. K., Prabhakar, S., & Pankanti, S. (2002). On the similarity of identical twin
ÿngerprints, 35, 2653–2663.
Jain, A., Nandakumar, K., & Ross, A. (2005). Score normalization in multimodal
biometric systems. Pattern Recognition, 38(12), 2270–2285.
Jimoh, R. G., Olaniyi, A. S., & Adewole, K. S. (2011). Adoption of Fingerprinting as
an Automated Access Control Technique in University Hostels. ARPN Journal of
Systems and Software, 1(4), 149–153.
Khalil, M. S., Mohamad, D., Khan, M. K., & Al-Nuzaili, Q. (2010). Fingerprint
verification using statistical descriptors. Digital Signal Processing, 20(4), 1264–1273.
Kumar, A., & Wu, C. (2012). Automated human identification using ear imaging.
Pattern Recognition, 45(3), 956–968.
Lin, H., Yifei. W.,& Jain, A. (1998). Fingerprint Image Enhancement: Algorithm and
Performance Evaluation. IEEE Trans. Pattern Anal. Machine Intel, 20(8), 777–789.
Langer, A. M. (2008). Analysis and Design of Information Systems Third Edition
British Library Cataloguing in Publication Data. 3rd ed. New York, Springer. pp
248-257
Law enforcement agencies tap into biometrics. (2012). Biometric Technology Today,
2012(6), 2.
Lewis, I. (2014). Ever had your fingerprints taken? Meeting the challenges of 21st
Century access control. Biometric Technology Today, 2014(5), 9–11.
Lin, C. H., Chen, J. L., & Tseng, C. Y. (2011). Optical sensor measurement and
biometric-based fractal pattern classifier for fingerprint recognition. Expert Systems
with Applications, 38(5), 5081–5089.
Liu, F., Zhao, Q., & Zhang, D. (2011). A novel hierarchical fingerprint matching
approach. Pattern Recognition, 44(8), 1604–1613.
Liu, Y. (2011). Scenario study of biometric systems at borders. Computer Law &
Security Review, 27(1), 36–44.
116
Lumini, A., Maio, D., & Maltoni, D. (1997). Continuous versus exclusive
classification for fingerprint retrieval. Pattern Recognition Letters, 18(10), 1027–
1034.
Maltoni, D. (2005). A Tutorial on Fingerprint Recognition. Advanced Studies in
Biometrics, 3161/2005, 121–138.
Mansfield-Devine, S. (2012). Biometrics at war: The US military’s need for
identification and authentication. Biometric Technology Today, 2012(5), 5–8.
Marsico, M. De, Nappi, M., Riccio, D., & Tortora, G. (2009). Journal of Visual
Languages and Computing A multiexpert collaborative biometric system for people
identification, 20, 91–100.
Martinez-Diaz, M., Fierrez, J., Galbally, J., & Ortega-Garcia, J. (2011). An evaluation
of indirect attacks and countermeasures in fingerprint verification systems. Pattern
Recognition Letters, 32(12), 1643–1651.
Mayes, K. E., Markantonakis, K., & Hancke, G. (2009). Transport ticketing security
and fraud controls. Information Security Technical Report, 14(2), 87–95.
Montoya Zegarra, J. a., Leite, N. J., & da Silva Torres, R. (2009). Wavelet-based
fingerprint image retrieval. Journal of Computational and Applied Mathematics,
227(2), 294–307.
Nagaty, K. A. (2005). An adaptive hybrid energy-based fingerprint matching
technique. Image and Vision Computing, 23(5), 491–500.
Nguyen, N. (2015). Chokepoint: Regulating US student mobility through biometrics.
Political Geography, 46, 1–10.
Nigam, I., Vatsa, M., & Singh, R. (2015). Ocular biometrics: A survey of modalities
and fusion approaches. Information Fusion, 26, 1–35.
Nunn, S. (2001). Police technology in cities: Changes and challenges. Technology in
Society, 23(1), 11–27.
O’Gorman, L. (1999). An overview of fingerprint verification technologies.
Information Security Technical Report, 4(1), 28–29.
Rajanna, U., Erol, A., & Bebis, G. (2010). A comparative study on feature extraction
for fingerprint classification and performance improvements using rank-level fusion.
Pattern Analysis and Applications, 13(3), 263–272.
ZKTeco Inc.(2012). ZKFinger SDK development guild . Version 3.0.
Vatsa, M., Singh, R., Noore, A., & Morris, K. (2011). Simultaneous latent fingerprint
recognition, 11, 4260–4266.
William,M.,(2012). Using ESF Database Migration Toolkit to migrate MySQL,
Postgres, Oracle, SQL Server to DB2. IBM developer works, [online]. Available at:
http://www.ibm.com/developerworks/data/library/techarticle/dm-
0606khatri/[accessed 26.10.2016]
Zhu, L., & Zhang, S. (2010). Multimodal biometric identification system based on
finger geometry, knuckle print and palm print. Pattern Recognition Letters, 31(12),
1641–1649.
117
118
APPENDICES
119
A.2 Zambia Army Research Authorization Loose Minute
120
APPENDIX B: PROJECT PLANNING AND COSTING
B.1 Planning
The project started on the 1st January and is expected to be completed after hundred
and eleven (111) days less Saturdays and Sunday. The planning has not observed any
territorial or international public holidays. Project activities includes: (i) Feasibility
Study (ii) Data collection. Two data collection methods were employed record
inspection and observation. An organisation visited was Military police (provost)
Army Unit Special Investigation Branch (SIB) located at Army Headquarters (Arakan
Barracks) Lusaka Zambia. The ultimate
result was to understand the management and utilisation of fingerprint for human
identification in the Army. For sample military application employment in the public
services or non-criminal enquiry form (FZA MP 12A check the appendix section of
this report. (iii) Literature review. Examine various literatures on algorithms,
techniques and methods used in developing a fingerprint biometrics system. (iv)
Analysis. This activity involves examination of the finding discovered in both data
collection and literature review. (vi) Design. Design phase include database and
application design abstract structures.(vii) application Development and testing . This
activity involves the actual program coding and modular testing of the operation of
specific computer language code. (viii) Documentation. Documentation activity
involves the actual writing of the thesis and recording the results of an application.
For the project schedule and Gantt chart refer to table B.1.1 and Figure B.1.2
respectively.
121
Table B.1.1 Project Activity Timeline
122
B.2 Project Costing
123
- 18.0
Megapixels
- 18-55mm
lenses Capturing passport
Digital Camera 500.00 500.00
- Speed 3frs size photos
- Full-high
definition
Software
Software
development
- Visual Version 2005 and up 259.99 600.00
environment and
Studio
compiler
- Microsoft For project
Version 2003 and up 349.00 3490.00
Project planning
- Microsoft For project
Version 2003 259.99 259.99
Visual diagrams
System
Development in
Labour N/A
terms of man hours
at standard rate of
124
B.3 Rich Picture
125
APPENDIX C: Government Prescribed forms
126
C.2 Applicantion for Employment in Public Service or non-Criminal Inquiry
filled in( FZA MP 12A)
127
C.3 Criminal Security Vetting Police reply Letter ( FZA MP 12A)
128
APPENDIX D: Fingerprint Biometrics System Parameter
Specifications
129
APPENDIX E: Reports
130
E.3 Military Personnel Comprehensive Case Register
131
APPENDIX F: APPLICATION CODES
Appendix section F, contains some applications codes for the selected objects of the
developed system. The researcher considered the bulkiness of computer codes to just
pick few forms to illustrate the concept behind the forms operations. Note that if all
codes were to be inserted in this report the document could be so huge. The following
are some of the forms were code had been extracted:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Runtime.InteropServices;
using System.IO;
using System.Data.Odbc;
using MySql.Data.MySqlClient;
namespace CSharpSample
{
public partial class login : Form
{
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
MySqlConnection con;
MySqlCommand cmd;
MySqlDataReader rddata;
// OdbcDataReader rddata;
//OdbcDataReader rddata;
public login()
{
InitializeComponent();
}
con.Open();
cmd = newMySqlCommand("SELECT * FROM password WHERE username ='" +
username.Text + "'AND Password = '" + password.Text + "'", con);
rddata = cmd.ExecuteReader();
while (rddata.Read())
{
}
if (rddata.HasRows == true)
{
Menu1 f1 = newMenu1();
f1.ShowDialog(); // Shows Form2
login.ActiveForm.Close();
}
else
{
//Response.Redirect("login.aspx");
lblstatus.Text = "Login failure! type correct username and password";
//cmd.ExecuteNonQuery();
rddata.Close();
con.Close();
// lblstatus.Text = "Record picked successfully";
break;
case "Sentry":
con = newMySqlConnection(mySQLconn);
con.Open();
md = newMySqlCommand("SELECT * FROM passwords WHERE username ='" +
username.Text + "'AND Password = '" + password.Text + "'", con);
rddata = cmd.ExecuteReader();
while (rddata.Read())
{
}
if (rddata.HasRows == true)
{
ChooseScannerForm f3 = new ChooseScannerForm();
f3.ShowDialog(); // Shows Form2
login.ActiveForm.Close();
}
133
else
{
//Response.Redirect("login.aspx");
lblstatus.Text = "Login failure! type correct username and password";
//cmd.ExecuteNonQuery();
rddata.Close();
con.Close();
// lblstatus.Text = "Record picked successfully";
}
break;
case "Administrator":
con = newMySqlConnection(mySQLconn);
con.Open();
cmd = newMySqlCommand("SELECT * FROM passwordg WHERE username ='" +
username.Text + "'AND Password = '" + password.Text + "'", con);
lblstatus.Text = "User Exists";
rddata = cmd.ExecuteReader();
while (rddata.Read())
{
}
if (rddata.HasRows == true)
{
administrator f3 = new administrator();
f3.ShowDialog(); // Shows Form2
}
else
{
//Response.Redirect("login.aspx");
lblstatus.Text = "Login failure! type correct username and password";
//cmd.ExecuteNonQuery();
rddata.Close();
con.Close();
// lblstatus.Text = "Record picked successfully";
break;
}
}
134
this.Close();
}}}
/*******************************************
135
Picture Rotate
*********************************************/
public static void RotatePic(byte[] BmpBuf, int width, int height, ref byte[] ResBuf)
{
int RowLoop = 0;
int ColLoop = 0;
int BmpBuflen = width * height;
try
{
for (RowLoop = 0; RowLoop < BmpBuflen; )
{
for (ColLoop = 0; ColLoop < width; ColLoop++)
{
ResBuf[RowLoop + ColLoop] = BmpBuf[BmpBuflen - RowLoop - width + ColLoop];
}
/*******************************************
StructToBytes
*********************************************/
public static byte[] StructToBytes(object StructObj, int Size)
{
int StructSize = Marshal.SizeOf(StructObj);
byte[] GetBytes = new byte[StructSize];
try
{
IntPtr StructPtr = Marshal.AllocHGlobal(StructSize);
Marshal.StructureToPtr(StructObj, StructPtr, false);
Marshal.Copy(StructPtr, GetBytes, 0, StructSize);
Marshal.FreeHGlobal(StructPtr);
if (Size == 14)
{
byte[] NewBytes = new byte[Size];
136
int Count = 0;
int Loop = 0;
return GetBytes;
}
}
/*******************************************
GetBitmap Function
*********************************************/
public static void GetBitmap(byte[] buffer, int nWidth, int nHeight, ref MemoryStream ms)
{
int ColorIndex = 0;
ushort m_nBitCount = 8;
int m_nColorTableEntries = 256;
byte[] ResBuf = new byte[nWidth * nHeight];
try
{
BITMAPFILEHEADER BmpHeader = new BITMAPFILEHEADER();
BITMAPINFOHEADER BmpInfoHeader = new BITMAPINFOHEADER();
MASK[] ColorMask = new MASK[m_nColorTableEntries];
BmpInfoHeader.biSize = Marshal.SizeOf(BmpInfoHeader);
BmpInfoHeader.biWidth = nWidth;
BmpInfoHeader.biHeight = nHeight;
137
BmpInfoHeader.biPlanes = 1;
BmpInfoHeader.biBitCount = m_nBitCount;
BmpInfoHeader.biCompression = 0;
BmpInfoHeader.biSizeImage = 0;
BmpInfoHeader.biXPelsPerMeter = 0;
BmpInfoHeader.biYPelsPerMeter = 0;
BmpInfoHeader.biClrUsed = m_nColorTableEntries;
BmpInfoHeader.biClrImportant = m_nColorTableEntries;
BmpHeader.bfType = 0x4D42;
BmpHeader.bfOffBits = 10 + Marshal.SizeOf(BmpInfoHeader) + BmpInfoHeader.biClrUsed * 4;
BmpHeader.bfSize = BmpHeader.bfOffBits + ((((BmpInfoHeader.biWidth *
BmpInfoHeader.biBitCount + 31) / 32) * 4) * BmpInfoHeader.biHeight);
BmpHeader.bfReserved1 = 0;
BmpHeader.bfReserved2 = 0;
ms.Write(StructToBytes(BmpHeader, 14), 0, 14);
ms.Write(StructToBytes(BmpInfoHeader, Marshal.SizeOf(BmpInfoHeader)), 0,
Marshal.SizeOf(BmpInfoHeader));
for (ColorIndex = 0; ColorIndex < m_nColorTableEntries; ColorIndex++)
{
ColorMask[ColorIndex].redmask = (byte)ColorIndex;
ColorMask[ColorIndex].greenmask = (byte)ColorIndex;
ColorMask[ColorIndex].bluemask = (byte)ColorIndex;
ColorMask[ColorIndex].rgbReserved = 0;
ms.Write(StructToBytes(ColorMask[ColorIndex], Marshal.SizeOf(ColorMask[ColorIndex])), 0,
Marshal.SizeOf(ColorMask[ColorIndex]));
}
/*******************************************
WriteBitmap
*********************************************/
public static void WriteBitmap(byte[] buffer, int nWidth, int nHeight)
{
int ColorIndex = 0;
138
ushort m_nBitCount = 8;
int m_nColorTableEntries = 256;
byte[] ResBuf = new byte[nWidth * nHeight];
try
{
BITMAPFILEHEADER BmpHeader = new BITMAPFILEHEADER();
BITMAPINFOHEADER BmpInfoHeader = new BITMAPINFOHEADER();
MASK[] ColorMask = new MASK[m_nColorTableEntries];
BmpInfoHeader.biSize = Marshal.SizeOf(BmpInfoHeader);
BmpInfoHeader.biWidth = nWidth;
BmpInfoHeader.biHeight = nHeight;
BmpInfoHeader.biPlanes = 1;
BmpInfoHeader.biBitCount = m_nBitCount;
BmpInfoHeader.biCompression = 0;
BmpInfoHeader.biSizeImage = 0;
BmpInfoHeader.biXPelsPerMeter = 0;
BmpInfoHeader.biYPelsPerMeter = 0;
BmpInfoHeader.biClrUsed = m_nColorTableEntries;
BmpInfoHeader.biClrImportant = m_nColorTableEntries;
BmpHeader.bfType = 0x4D42;
BmpHeader.bfOffBits = 14 + Marshal.SizeOf(BmpInfoHeader) + BmpInfoHeader.biClrUsed * 4;
BmpHeader.bfSize = BmpHeader.bfOffBits + ((((BmpInfoHeader.biWidth * BmpInfoHeader.biBitCount + 31) /
32) * 4) * BmpInfoHeader.biHeight);
BmpHeader.bfReserved1 = 0;
BmpHeader.bfReserved2 = 0;
Stream FileStream = File.Open("finger.bmp", FileMode.Create, FileAccess.Write);
BinaryWriter TmpBinaryWriter = new BinaryWriter(FileStream);
TmpBinaryWriter.Write(StructToBytes(BmpHeader, 14));
TmpBinaryWriter.Write(StructToBytes(BmpInfoHeader, Marshal.SizeOf(BmpInfoHeader)));
for (ColorIndex = 0; ColorIndex < m_nColorTableEntries; ColorIndex++)
{
ColorMask[ColorIndex].redmask = (byte)ColorIndex;
ColorMask[ColorIndex].greenmask = (byte)ColorIndex;
ColorMask[ColorIndex].bluemask = (byte)ColorIndex;
ColorMask[ColorIndex].rgbReserved = 0;
TmpBinaryWriter.Write(StructToBytes(ColorMask[ColorIndex], Marshal.SizeOf(ColorMask[ColorIndex])));
}
RotatePic(buffer, nWidth, nHeight, ref ResBuf);
TmpBinaryWriter.Write(ResBuf);
FileStream.Close();
TmpBinaryWriter.Close();
}
catch (Exception ex)
{
139
//ZKCE.SysException.ZKCELogger logger = new ZKCE.SysException.ZKCELogger(ex);
//logger.Append();
}}}}
namespace CSharpSample
{
publicpartialclass Application_Form : Form
{
publicImage filter { get; set; }string imagename;
bool gConnected = false;
byte[] g_FPBuffer;
int g_FPBufferSize = 0;
bool g_bIsTimeToDie = false;
IntPtr g_Handle = IntPtr.Zero;
IntPtr g_biokeyHandle = IntPtr.Zero;
IntPtr g_FormHandle = IntPtr.Zero;
int g_nWidth = 0;
int g_nHeight = 0;
bool g_IsRegister = false;
int g_RegisterTimeCount = 0;
int g_RegisterCount = 0;
constint REGISTER_FINGER_COUNT = 3;
140
constint MESSAGE_FP_RECEIVED = 0x0400 + 6;
141
}
}
privatevoid fillbox1()
{
MySqlDataReader myreader;
//ma.Items.Clear();
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL = " SELECT * from RANK ";
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd = newMySqlCommand(selectSQL, con);
try
{
con.Open();
myreader = cmd.ExecuteReader();
while (myreader.Read())
{
string scountry = myreader.GetString("rankname");
rank.Items.Add(scountry);
}
myreader.Close();
}
catch (Exception err)
{
lblstatus.Text = " Error reading list";
lblstatus.Text += err.Message;
}
}
privatevoid serviceno_TextChanged(object sender, EventArgs e)
{
MySqlDataReader rddata;
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL;
selectSQL = " SELECT * from mastertablemilitary where serviceno= '" + serviceno.Text + "'";
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd1 = newMySqlCommand(selectSQL, con);
try
{
con.Open();
rddata = cmd1.ExecuteReader();
// int added = 0;
while (rddata.Read())
{
142
//usergroup.Enabled = true;
serviceno.Text = rddata["serviceno"].ToString();
fullname.Text = rddata["fullname"].ToString();
unit.Text = rddata["unit"].ToString();
nrcno.Text = rddata["nrcno"].ToString();
//dob.Text = rddata["dob"].ToString();
// enlisteddate.Text = rddata["EnlistementDate"].ToString();
chief.Text = rddata["chief"].ToString();
village.Text = rddata["village"].ToString();
district.Text = rddata["district"].ToString();
tribe.Text = rddata["tribe"].ToString();
peculiarity.Text = rddata["peculiarity"].ToString();
complexion.Text = rddata["complexion"].ToString();
hair.Text = rddata["hair"].ToString();
eyes.Text = rddata["eyes"].ToString();
height.Text = rddata["height"].ToString();
mobileno.Text = rddata["mobileno"].ToString();
corps.Text = rddata["corps"].ToString();
rank.Text = rddata["rank"].ToString();
sex.Text = rddata["sex"].ToString();
address.Text = rddata["address"].ToString();
placebirth.Text = rddata["placebirth"].ToString();
mcategory.Text = rddata["mcategory"].ToString();
byte[] imgg = (byte[])(rddata["photo"]);
byte[] imgg1 = (byte[])(rddata["rthumb"]);
if (imgg == null)
photo.Image = null;
else
{
MemoryStream mstream = newMemoryStream(imgg);
MemoryStream mstream1 = newMemoryStream(imgg1);
photo.Image = System.Drawing.Image.FromStream(mstream);
rthumb.Image = System.Drawing.Image.FromStream(mstream1);
}}
rddata.Close();
lblstatus.Text = "";
}
catch (Exception err)
{
lblstatus.Text = " Error Geting Author. ";
lblstatus.Text = err.Message;
}
finally
{
143
con.Close();
// photoimage.Image = null;
//fimage.Image = null;
}
privatevoid btnConnect_Click(object sender, EventArgs e)
{
if (!gConnected)
{
int ret = 0;
byte[] paramValue = newbyte[64];
// Enable log
Array.Clear(paramValue, 0, paramValue.Length);
paramValue[0] = 1;
ZKFPCap.sensorSetParameterEx(g_Handle, 1100, paramValue, 4);
ret = ZKFPCap.sensorInit();
if (ret != 0)
{
MessageBox.Show("Init Failed, ret=" + ret.ToString());
return;
}
g_Handle = ZKFPCap.sensorOpen(0);
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetVersion(paramValue, paramValue.Length);
ret = paramValue.Length;
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 1, paramValue, ref ret);
g_nWidth = BitConverter.ToInt32(paramValue, 0);
this.rthumb.Width = g_nWidth;
ret = paramValue.Length;
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 2, paramValue, ref ret);
g_nHeight = BitConverter.ToInt32(paramValue, 0);
this.rthumb.Height = g_nHeight;
ret = paramValue.Length;
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 106, paramValue, ref ret);
g_FPBufferSize = BitConverter.ToInt32(paramValue, 0);
g_FPBuffer = newbyte[g_FPBufferSize];
Array.Clear(g_FPBuffer, 0, g_FPBuffer.Length);
// get vid&pid
ret = paramValue.Length;
144
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 1015, paramValue, ref ret);
int nVid = BitConverter.ToInt16(paramValue, 0);
int nPid = BitConverter.ToInt16(paramValue, 2);
// Manufacturer
ret = paramValue.Length;
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 1101, paramValue, ref ret);
string manufacturer =
System.Text.Encoding.ASCII.GetString(paramValue);
// Product
ret = paramValue.Length;
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 1102, paramValue, ref ret);
string product = System.Text.Encoding.ASCII.GetString(paramValue);
// SerialNumber
ret = paramValue.Length;
Array.Clear(paramValue, 0, paramValue.Length);
ZKFPCap.sensorGetParameterEx(g_Handle, 1103, paramValue, ref ret);
string serialNumber =
System.Text.Encoding.ASCII.GetString(paramValue);
// Fingerprint Alg
short[] iSize = newshort[24];
iSize[0] = (short)g_nWidth;
iSize[1] = (short)g_nHeight;
iSize[20] = (short)g_nWidth;
iSize[21] = (short)g_nHeight; ;
g_biokeyHandle = ZKFinger10.BIOKEY_INIT(0, iSize, null, null, 0);
if (g_biokeyHandle == IntPtr.Zero)
{
MessageBox.Show("BIOKEY_INIT failed");
return;
}
// Init RegTmps
for (int i = 0; i < 3; i++)
{
145
g_RegTmps[i] = newbyte[2048];
}
gConnected = true;
// btnRegister.Enabled = true;
// btnVerify.Enabled = true;
btnConnect.Text = "Disconnect Sensor";
ZKFinger10.BIOKEY_DB_CLEAR(g_biokeyHandle);
ZKFinger10.BIOKEY_CLOSE(g_biokeyHandle);
gConnected = false;
//btnRegister.Enabled = false;
// btnVerify.Enabled = false;
btnConnect.Text = "Connect Sensor";
}
}
privatevoid FreeSensor()
{
g_bIsTimeToDie = true;
Thread.Sleep(100);
ZKFPCap.sensorClose(g_Handle);
// Disable log
byte[] paramValue = newbyte[4];
paramValue[0] = 0;
ZKFPCap.sensorSetParameterEx(g_Handle, 1100, paramValue, 4);
ZKFPCap.sensorFree();
}
privatevoid DoCapture()
146
{
while (!g_bIsTimeToDie)
{
int ret = ZKFPCap.sensorCapture(g_Handle, g_FPBuffer, g_FPBufferSize);
if (ret > 0)
{
SendMessage(g_FormHandle, MESSAGE_FP_RECEIVED, IntPtr.Zero, IntPtr.Zero);
}
Thread.Sleep(30);
}
}
protectedoverridevoid DefWndProc(refMessage m)
{
switch (m.Msg)
{
case MESSAGE_FP_RECEIVED:
{
try
{
MemoryStream ms = newMemoryStream();
BitmapFormat.GetBitmap(g_FPBuffer, g_nWidth, g_nHeight, ref ms);
Bitmap bmp = newBitmap(ms);
this.rthumb.Image = bmp;
txtStatus.Text = "IMAGE_READY";
int ret = 0;
int id = 0;
//int tempret = 0;
int score = 0;
int quality = 0;
int getb = 0;
if (g_IsRegister)
{
Array.Clear(g_RegTmp, 0, g_RegTmp.Length);
ret = ZKFinger10.BIOKEY_EXTRACT(g_biokeyHandle, g_FPBuffer, g_RegTmp, 0);
// temp1.Text = ret.ToString();
if (ret > 0)
{
Array.Copy(g_RegTmp, g_RegTmps[g_RegisterTimeCount++], ret);
147
quality = ZKFinger10.BIOKEY_GETLASTQUALITY();
txtQuality.Text = quality.ToString();
if (g_RegisterTimeCount == REGISTER_FINGER_COUNT)
{
Array.Clear(g_RegTmp, 0, g_RegTmp.Length);
int size = 0;
unsafe
{
fixed (byte* Template1 = g_RegTmps[0])
{
fixed (byte* Template2 = g_RegTmps[1])
{
fixed (byte* Template3 = g_RegTmps[2])
{
byte*[] pTemplate = newbyte*[3] { Template1, Template2, Template3 };
g_IsRegister = false;
}
else
{
txtPrompt.Text = "Register failed";
}
g_RegisterTimeCount = 0;
}
}
else
{
txtPrompt.Text = "Extract template failed";
}
148
}
else
{
Array.Clear(g_VerTmp, 0, g_VerTmp.Length);
if ((ret = ZKFinger10.BIOKEY_EXTRACT(g_biokeyHandle, g_FPBuffer, g_VerTmp, 0)) > 0)
{
// Get fingerprint quality
quality = ZKFinger10.BIOKEY_GETLASTQUALITY();
txtQuality.Text = quality.ToString();
ret = ZKFinger10.BIOKEY_IDENTIFYTEMP(g_biokeyHandle, g_VerTmp, ref id, ref score);
int tempret = ret;
if (ret > 0)
{
txtPrompt.Text = string.Format("Identification success, id={0}, score={1}", id, score);
}
else
{
txtPrompt.Text = string.Format("Identification failed, score={0}", score);
}
}
else
{
txtPrompt.Text = "Extract template failed";
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
break;
default:
base.DefWndProc(ref m);
break;
}
}
149
try
{
FileDialog fldlg = newOpenFileDialog();
150
complexion.Text + "','" + hair.Text + "','" + eyes.Text + "','" + height.Text + "','" + mobileno.Text + "','" +
address.Text + "', @IMG,@IMG1 ,'" + placebirth.Text + "','" + rank.SelectedItem.ToString() + "','" +
mcategory.Text + "' ); ";
MySqlConnection conn = newMySqlConnection(mySQLconn);
MySqlCommand cmd = newMySqlCommand(Query, conn);
MySqlDataReader myreader;
try
{
conn.Open();
cmd.Parameters.Add(newMySqlParameter("@IMG", imageBt));
cmd.Parameters.Add(newMySqlParameter("@IMG1", imageBt1));
myreader = cmd.ExecuteReader();
MessageBox.Show(" One Record Saved");
serviceno.Text = "";
fullname.Text = "";
nrcno.Text = "";
dob.Text = "";
chief.Text = "";
village.Text = "";
district.Text = "";
tribe.Text = "";
peculiarity.Text = "";
complexion.Text = "";
hair.Text = "";
eyes.Text = "";
height.Text = "";
mobileno.Text = "";
address.Text = "";
photo.Image = null;
rthumb.Image = null;
while (myreader.Read())
{}}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}}
privatevoid rank_SelectedIndexChanged(object sender, EventArgs e)
{
MySqlDataReader rddata;
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL;
selectSQL = " SELECT * from rank where rankname= '" + rank.SelectedItem.ToString() + "'";
151
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd1 = newMySqlCommand(selectSQL, con);
try
{
con.Open();
rddata = cmd1.ExecuteReader();
// int added = 0;
while (rddata.Read())
{
//usergroup.Enabled = true;
mcategory.Text = rddata["mcategory"].ToString();
//unitname.Text = rddata["unit"].ToString();
//formation1.Items.ToString() = rddata["formation1"].ToString();
}
rddata.Close();
lblstatus.Text = "";
}
catch (Exception err)
{
lblstatus.Text = " Error Geting Author. ";
lblstatus.Text = err.Message;
}
finally
{
con.Close();
// photoimage.Image = null;
//fimage.Image = null;
}}
privatevoid button1_Click(object sender, EventArgs e)
{
if (this.saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
this.rthumb.Image.Save(this.saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Png);
rthumb.Image = null;
}
try
{
152
FileDialog fldlg = newOpenFileDialog();
if (fldlg.ShowDialog() == DialogResult.OK)
{
imagename = fldlg.FileName;
rthumb.SizeMode = PictureBoxSizeMode.StretchImage;
pathrthumb.Text = imagename;
rthumb.Image = (Image)newimg;
fldlg = null;
153
}
154
MessageBox.Show(" One Record ammended");
serviceno.Text = "";
fullname.Text = "";
nrcno.Text = "";
dob.Text = "";
chief.Text = "";
village.Text = "";
district.Text = "";
tribe.Text = "";
peculiarity.Text = "";
complexion.Text = "";
hair.Text = "";
eyes.Text = "";
height.Text = "";
mobileno.Text = "";
address.Text = "";
photo.Image = null;
rthumb.Image = null;
}}
privatevoid Delete_Click(object sender, EventArgs e)
{
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
MySqlConnection con = newMySqlConnection(mySQLconn);
// MySqlCommand cmd1 = new MySqlCommand(selectSQL, con);
MySqlCommand cmd1 = newMySqlCommand("DELETE FROM mastertablemilitary WHERE serviceno = '" +
serviceno.Text + "'", con);
//MySqlCommand cmd1 = new MySqlCommand(selectSQL, con);
try
{
con.Open();
cmd1.ExecuteNonQuery();
}
finally
{
con.Close();
MessageBox.Show(" One Record Deleted");
serviceno.Text = "";
fullname.Text = "";
nrcno.Text = "";
dob.Text = "";
chief.Text = "";
village.Text = "";
district.Text = "";
155
tribe.Text = "";
peculiarity.Text = "";
complexion.Text = "";
hair.Text = "";
eyes.Text = "";
height.Text = "";
mobileno.Text = "";
address.Text = "";
photo.Image = null;
rthumb.Image = null;
}}
privatevoid Close_Click(object sender, EventArgs e)
{
this.Close();
}}}
Appendix F.3 Case Military Input Form codes
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Runtime.InteropServices;
using System.IO;
using System.Data.Odbc;
using MySql.Data.MySqlClient;
namespace CSharpSample
{
public partial class Case_Military : Form
{
public Case_Military()
{
InitializeComponent();
fillbox();
}
privatevoid fillbox()
{
MySqlDataReader myreader;
//ma.Items.Clear();
156
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL = " SELECT * from mastertablemilitary ";
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd = newMySqlCommand(selectSQL, con);
try
{
con.Open();
myreader = cmd.ExecuteReader();
while (myreader.Read())
{
string scountry = myreader.GetString("serviceno");
serviceno.Items.Add(scountry);
}
myreader.Close();
}
catch (Exception err)
{
lblstatus.Text = " Error reading list";
lblstatus.Text += err.Message;
}}
privatevoid groupBox1_Enter(object sender, EventArgs e)
{}
privatevoid Insert_Click(object sender, EventArgs e)
{
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string Query = " Insert into casemilitary(serviceno, nrcno, unit, casedate, offence,typeoffence,sentence,
description, fullname,caseno) values ('" + serviceno.Text + "','" + nrcno.Text + "','"+ unit.Text + "','" +
casedate.Text + "','" + offence.Text + "','" + offencetype.SelectedItem.ToString()+ "','" + sentence.Text + "','" +
description.Text + "','" + fullname.Text + "','"+ caseno.Text + "'); ";
MySqlConnection conn = newMySqlConnection(mySQLconn);
MySqlCommand cmd = newMySqlCommand(Query, conn);
MySqlDataReader myreader;
try
{
conn.Open();
myreader = cmd.ExecuteReader();
MessageBox.Show(" One Record Saved");
serviceno.Text = "";
nrcno.Text = "";
157
offence.Text = "";
sentence.Text = "";
description.Text = "";
fullname.Text = "";
caseno.Text = "";
unit.Text = "";
While (myreader.Read())
{}}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}}
privatevoid serviceno_SelectedIndexChanged(object sender, EventArgs e)
{
MySqlDataReader rddata;
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL;
selectSQL = " SELECT * from mastertablemilitary where serviceno= '" + serviceno.Text + "'";
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd1 = newMySqlCommand(selectSQL, con);
try
{
con.Open();
rddata = cmd1.ExecuteReader();
// int added = 0;
while (rddata.Read())
{
//usergroup.Enabled = true;
serviceno.Text = rddata["serviceno"].ToString();
fullname.Text = rddata["fullname"].ToString();
unit.Text = rddata["unit"].ToString();
nrcno.Text = rddata["nrcno"].ToString();
}
rddata.Close();
lblstatus.Text = "";
}
catch (Exception err)
{
lblstatus.Text = " Error Geting Author. ";
lblstatus.Text = err.Message;
}
finally
{
158
con.Close();
// photoimage.Image = null;
//fimage.Image = null;
}
}
159
con.Close();
// photoimage.Image = null;
//fimage.Image = null;}}
privatevoid Update_Click(object sender, EventArgs e)
{
MySqlDataReader rddata;
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL;
selectSQL = " UPDATE casemilitary SET serviceno = '" + serviceno.Text + "', nrcno ='" + nrcno.Text + "',unit ='"
+ unit.Text + "', casedate ='" + casedate.Text + "',typeoffence ='" + offencetype.SelectedItem.ToString() + "',
description ='" + description.Text + "', fullname ='" + fullname.Text + "',caseno ='" + caseno.Text + "' WHERE
caseno= '" + caseno.Text + "'";
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd1 = newMySqlCommand(selectSQL, con);
try
{
con.Open();
rddata = cmd1.ExecuteReader();
rddata.Close();
lblstatus.Text = "";
}
catch (Exception err)
{
lblstatus.Text = " Error Geting Author. ";
lblstatus.Text = err.Message;
}
finally
{
con.Close();
MessageBox.Show(" Information has been changed");
160
con.Open();
cmd1.ExecuteNonQuery();
}
finally
{
con.Close();
MessageBox.Show("one Record Deleted ");
serviceno.Text = "";
nrcno.Text = "";
offence.Text = "";
sentence.Text = "";
description.Text = "";
fullname.Text = "";
caseno.Text = "";
unit.Text = "";
}
}
161
using AForge.Imaging.Filters;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Runtime.InteropServices;
using System.IO;
using System.Data.Odbc;
using MySql.Data.MySqlClient;
using AForge.Imaging;
using AForge.Imaging.Filters;
using System.Globalization;
namespace CSharpSample
{
publicpartialclass Fingerprint_Analysis : Form
{
privateBitmap resultBitmap = null;
privateBitmap originalBitmap = null;
privateBitmap previewBitmap = null;
privateOtsu ot = newOtsu();
privateBitmap Otsuimage;
publicfloat contrast= 0;
publicBitmap NewBitmap;
public Fingerprint_Analysis()
{
InitializeComponent();
fillbox();
}
privatevoid fillbox()
{
MySqlDataReader myreader;
//ma.Items.Clear();
try
{
con.Open();
162
myreader = cmd.ExecuteReader();
while (myreader.Read())
{
string scountry = myreader.GetString("fullname");
dname.Items.Add(scountry);
}
myreader.Close();
}
catch (Exception err)
{
lblstatus.Text = " Error reading list";
lblstatus.Text += err.Message;
}
}
class ImageBrightnessNormalizer
{
privateconstfloat MIN_BRIGHTNESS = 0;
privateconstfloat MAX_BRIGHTNESS = 1;
163
Color normalizedPixelColor =
ColorConverter.ColorFromAhsb(pixelColor.A, pixelColor.GetHue(),
pixelColor.GetSaturation(), normalizedPixelBrightness);
image.SetPixel(x, y, normalizedPixelColor);
}}
return image;
}}
Privatevoid normalisation_Click(object sender, EventArgs e)
{
image2.Image = ImageBrightnessNormalizer.NormalizeImageBrightness(new
Bitmap(image1.Image));
Otsuimage = (Bitmap)image1.Image.Clone();
image2.SizeMode = PictureBoxSizeMode.CenterImage;
//ApplyFilter(true);
}
privatevoid dname_SelectedIndexChanged(object sender, EventArgs e)
{
MySqlDataReader rddata;
string mySQLconn = "datasource=localhost;Database =fingerprint-biometrics;
port=3306;username=root;password=;";
string selectSQL;
selectSQL = " SELECT * from mastertable where fullname= '" + dname.Text + "'";
MySqlConnection con = newMySqlConnection(mySQLconn);
MySqlCommand cmd1 = newMySqlCommand(selectSQL, con);
try
{
con.Open();
rddata = cmd1.ExecuteReader();
// int added = 0;
while (rddata.Read())
{
//usergroup.Enabled = true;
164
{
lblstatus.Text = " Error Geting Author. ";
lblstatus.Text = err.Message;
}
finally
{
con.Close();
// photoimage.Image = null;
}}
privateint CountPixels(Bitmap bm, Color target_color)
{
int matches = 0;
for (int y = 0; y < bm.Height; y++)
{
for (int x = 0; x < bm.Width; x++)
{
if (bm.GetPixel(x, y) == target_color) matches++;
}}
return matches;
}
privatevoid nopixel_Click(object sender, EventArgs e)
{
Bitmap bm = newBitmap(image1.Image);
Bitmap bm1 = newBitmap(image2.Image);
int black_pixels = CountPixels(bm, Color.FromArgb(255, 0, 0, 0));
int white_pixels = CountPixels(bm, Color.FromArgb(255, 255, 255, 255));
int black_pixels1 = CountPixels(bm1, Color.FromArgb(255, 0, 0, 0));
int white_pixels1 = CountPixels(bm1, Color.FromArgb(255, 255, 255, 255));
lblBlack.Text = black_pixels + " black pixels";
lblWhite.Text = white_pixels + " white pixels";
lblTotal.Text = white_pixels + black_pixels + " total pixels";
lblBlack1.Text = black_pixels1 + " black pixels";
lblWhite1.Text = white_pixels1 + " white pixels";
lblTotal1.Text = white_pixels1 + black_pixels1 + " total pixels";
}
privatevoid btnSaveNewImage_Click(object sender, EventArgs e)
{
if (resultBitmap != null)
{
SaveFileDialog sfd = newSaveFileDialog();
sfd.Title = "Specify a file name and file path";
sfd.Filter = "Png Images(*.png)|*.png|Jpeg Images(*.jpg)|*.jpg";
sfd.Filter += "|Bitmap Images(*.bmp)|*.bmp";
165
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string fileExtension = Path.GetExtension(sfd.FileName).ToUpper();
ImageFormat imgFormat = ImageFormat.Png;
if (fileExtension == "BMP")
{
imgFormat = ImageFormat.Bmp;
}
elseif (fileExtension == "JPG")
{
imgFormat = ImageFormat.Jpeg;
}StreamWriter streamWriter = newStreamWriter(sfd.FileName, false);
resultBitmap.Save(streamWriter.BaseStream, imgFormat);
streamWriter.Flush();
streamWriter.Close();
resultBitmap = null;}}
privatevoid znormz_Click(object sender, EventArgs e)
{
Bitmap temp = (Bitmap)Otsuimage.Clone();
ot.Convert2GrayScaleFast(temp);
int otsuThreshold = ot.getOtsuThreshold((Bitmap)temp);
ot.threshold(temp, otsuThreshold);
textBox1.Text = otsuThreshold.ToString();
image2.Image = temp;
}}privatevoid thinning_Click(object sender, EventArgs e)
}{
privatevoid Fingerprint_Analysis_Load(object sender, EventArgs e)
{
Otsuimage = (Bitmap)image2.Image.Clone();
}
privatevoid trcThreshold_Scroll(object sender, EventArgs e)
{
lblContrastValue.Text = trcThreshold.Value.ToString();
//image2.Image = BitmapFilter.Contrast(m_Bitmap, (Bitmap)image2.Image, trcThreshold.Value);
}
publicstaticBitmap AdjustBrightness(Bitmap Image, int Value)
{
Bitmap TempBitmap = Image;
Bitmap NewBitmap = newBitmap(TempBitmap.Width, TempBitmap.Height);
Graphics NewGraphics = Graphics.FromImage(NewBitmap);
float FinalValue = (float)0.001f;
166
float[][] FloatColorMatrix ={
newfloat[] {1, 0f, 0f, 0f, 0f},
newfloat[] {0f, 1, 0f, 0f, 0f},
newfloat[] {0f, 0f, 1, 0f, 0f},
newfloat[] {0f, 0f, 0f, 1f, 0f},
newfloat[] {FinalValue, FinalValue, FinalValue ,0f,1f}
};
ColorMatrix NewColorMatrix = newColorMatrix(FloatColorMatrix);
ImageAttributes Attributes = newImageAttributes();
Attributes.SetColorMatrix(NewColorMatrix);
NewGraphics.DrawImage(TempBitmap, newRectangle(0, 0, TempBitmap.Width, TempBitmap.Height), 0, 0,
TempBitmap.Width, TempBitmap.Height, GraphicsUnit.Pixel, Attributes);
Attributes.Dispose();
NewGraphics.Dispose();
return NewBitmap;
}
publicstaticbool Contrast(Bitmap b, sbyte nContrast)
{
if (nContrast < -100) returnfalse;
if (nContrast > 100) returnfalse;
double pixel = 0, contrast = (100.0 + nContrast) / 100.0;
contrast *= contrast;
int red, green, blue;
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(newRectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite,
PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte* p = (byte*)(void*)Scan0;
int nOffset = stride - b.Width * 3;
for (int y = 0; y < b.Height; ++y)
{
for (int x = 0; x < b.Width; ++x)
{
blue = p[0];
green = p[1];
red = p[2];
pixel = red / 255.0;
pixel -= 0.5;
pixel *= contrast;
pixel += 0.5;
pixel *= 255;
167
if (pixel < 0) pixel = 0;
if (pixel > 255) pixel = 255;
p[2] = (byte)pixel;
pixel = green / 255.0;
pixel -= 0.5;
pixel *= contrast;
pixel += 0.5;
pixel *= 255;
if (pixel < 0) pixel = 0;
if (pixel > 255) pixel = 255;
p[1] = (byte)pixel;
pixel = blue / 255.0;
pixel -= 0.5;
pixel *= contrast;
pixel += 0.5;
pixel *= 255;
if (pixel < 0) pixel = 0;
if (pixel > 255) pixel = 255;
p[0] = (byte)pixel;
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
returntrue;
}
168