Upload
abhi-bhat
View
216
Download
0
Embed Size (px)
Citation preview
8/9/2019 20051739 Iris Recongition
1/60
1ABSTRACT
2 A biometric system provides automatic recognition of an individual based on some
sort of unique feature or characteristic possessed by the individual. Biometric systemshave been developed based on fingerprints, facial features, voice, hand geometry,
handwriting, the retina and the one presented in this thesis, the iris.
3 The objective of the project is to implement an opensource iris recognition system in
order to verify the claimed performance of the technology. The development tool used is
!AT"AB, and emphasis is on the software for performing recognition, and not hardware
for capturing an eye image.
#ris recognition analy$es the features that e%ist in the colored tissue
surrounding the pupil, which has 2&' points used for comparison, including rings,
furrows, and frec(les. #ris recognition uses a regular video camera system and can be
done from further away than a retinal scan. #t has the ability to create an accurate enough
measurement that can be used for #dentification purposes, not just verification.
The probability of finding two people with identical iris patterns is considered
to be appro%imately ) in )'&2*population of the earth is of the order )')'+. ot even one
egged twins or a future clone of a person will have the same iris patterns. The iris is
considered to be an internal organ because it is so well protected by the eyelid and the
cornea from environmental damage. #t is stable over time even though the person ages.
#ris recognition is the most precise and fastest of the biometric authentication methods.
T-- ollege of /ngineering )
8/9/2019 20051739 Iris Recongition
2/60
CHAPTER - 1
BIOMETRIC TECHNOLOGY
1.1 INTRODUCTION: A biometric system provides automatic recognition of an individual
based on some sort of unique feature or characteristic possessed by the individual.
Biometric systems have been developed based on fingerprints, facial features, voice, hand
geometry, handwriting, the retina and the one presented in this thesis, the iris.
Biometric systems wor( by first capturing a sample of the feature, such
as recording a digital sound signal for voice recognition, or ta(ing a digital colour image
for face recognition. The sample is then transformed using some sort of mathematical
function into a biometric template. The biometric template will provide a normalised,
efficient and highly discriminating representation of the feature, which can then be
objectively compared with other templates in order to determine identity. !ost biometric
systems allow two modes of operation. An enrolment mode for adding templates to a
database, and an identification mode, where a template is created for an individual and
then a match is searched for in the database of preenrolled templates.
A good biometric is characteri$ed by use of a feature that is0 highly
unique, stable and be easily captured and the chance of any two people having the same
characteristic will be minimal. Also the feature does not change over time .#n order to
provide convenience to the user, and prevent misrepresentation of the feature.
1.2 ADVANTAGES OF USING BIOMETRICS:
• /asier fraud detection
• Better than password1# or smart cards
• o need to memori$e passwords
• -equires physical presence of the person to be identified
• nique physical or behavioral characteristic
• annot be borrowed, stolen, or forgotten
• annot leave it at home
T-- ollege of /ngineering 2
8/9/2019 20051739 Iris Recongition
3/60
1.3 TYPES OF BIOMETRICS:
4 hysical Biometrics
• 5inger print -ecognition
• 5acial -ecognition
• 6and 7eometry
• #-#8 -ecognition
• 9A
4Behavioral Biometrics
• 8pea(er -ecognition
• 8ignature
• :eystro(e
• ;al(ing style
1.4 IRIS RECOGNITION SYSTEM:
The purpose of
8/9/2019 20051739 Iris Recongition
4/60
#n the chapter 2, we will discuss about the #-#8 -ecognition system, its
strengths and wea(ness. #n the chapter 3, we will discuss about the implementation of
#-#8 recognition system. #n chapter >, we will discuss about the unwrapping technology
.#n chapter &, about the wavelet analysis. #n chapter ?, about the software used for the
implementation.
T-- ollege of /ngineering >
8/9/2019 20051739 Iris Recongition
5/60
CHAPTER - 2
IRIS RECOGNITION
2.1 INTRODUCTION:
The iris is an e%ternally visible, yet protected organ whose unique
epigenetic pattern remains stable throughout adult life. These characteristics ma(e it very
attractive for use as a biometric for identifying individuals. The purpose of
8/9/2019 20051739 Iris Recongition
6/60
8/9/2019 20051739 Iris Recongition
7/60
8/9/2019 20051739 Iris Recongition
8/60
8/9/2019 20051739 Iris Recongition
9/60
CHAPTER - 3
IRIS SYSTEM IMPLEMENTATION
3.1 IMAGE AC9UISITION: #mage acquisition is considered the most critical step in the project
since all subsequent stages depend highly on the image quality. #n order to accomplish
this, we use a 9 camera. ;e set the resolution to ?>'%>G', the type of the image to
jpeg, and the mode to white and blac( for greater details. The camera is situated normally
between half a meter to one meter from the subject. *3 to )' inches+
The 9cameras job is to ta(e the image from the optical system and
convert it into electronic data. 5ind the iris image by a monochrome 9 *harged
couple 9evice+ camera transfer the value of the different pi%els out of the 9 chip.
-ead out the voltages from the 9chip. Thereafter the signals of each data are
amplified and sent to an A9 *Analog to 9igital onverter+.
5igs 3.) B": 9#A7-A! 5 #!A7/ AC#8#T# 8#7 9 A!/-A
3.2 IMAGE MANIPULATION:
#n the preprocessing stage, we transformed the images from -7B to gray
level and from eightbit to double precision thus facilitating the manipulation of the
images in subsequent steps.
T-- ollege of /ngineering
9 9/@#/T#A"
8E8T/!
AA"7 T9#7#TA"
@/-T/-
-/A9 T!T/-
J
8/9/2019 20051739 Iris Recongition
10/60
8/9/2019 20051739 Iris Recongition
11/60
8o the first problem encountered with modeling this biological process is
that of defining, precisely, what an edge might be. The usual approach is to simply define
edges as step discontinuities in the image signal. The method of locali$ing these
discontinuities often then becomes one of finding local ma%ima in the derivative of the
signal, or $erocrossings in the second derivative of the signal.
#n computer vision, edge detection is traditionally implemented by
convolving the signal with some form of linear filter, usually a filter that appro%imates a
first or second derivative operator. An odd symmetric filter will appro%imate a first
derivative, and pea(s in the convolution output will correspond to edges *luminance
discontinuities+ in the image.
An even symmetric filter will appro%imate a second derivative operator.
Kerocrossings in the output of convolution with an even symmetric filter will correspond
to edges0 ma%ima in the output of this operator will correspond to tangent discontinuities,
often referred to as bars or lines.
3.5 CANNY EDGE DETECTOR:
/dges characteri$e boundaries and are therefore a problem of fundamental
importance in image processing. /dges in images are areas with strong intensity contrasts
H a jump in intensity from one pi%el to the ne%t. /dge detecting an image significantly
reduces the amount of data and filters out useless information, while preserving the
important structural properties in an image.
The anny edge detection algorithm is (nown to many as the optimal edge
detector. A list of criteria to improve current methods of edge detection is the first and
most obvious is low error rate. #t is important that edges occurring in images should not
be missed and that there be responses to nonedges. The second criterion is that the
edge points be well locali$ed. #n other words, the distance between the edge pi%els as
found by the detector and the actual edge is to be at a minimum. A third criterion is to
have only one response to a single edge. This was implemented because the first 2 were
not substantial enough to completely eliminate the possibility of multiple responses to an
edge.
T-- ollege of /ngineering ))
8/9/2019 20051739 Iris Recongition
12/60
S"!1 :
#n order to implement the canny edge detector algorithm, a series of steps must
be followed. The first step is to filter out any noise in the original image before trying to
locate and detect any edges. And because the 7aussian filter can be computed using a
simple mas(, it is used e%clusively in the anny algorithm. nce a suitable mas( has
been calculated, the 7aussian smoothing can be performed using standard convolution
methods. The 7aussian mas( used is shown below.
S"!2:
After smoothing the image and eliminating the noise, the ne%t step is to find the
edge strength by ta(ing the gradient of the image. The 8obel operator performs a 29
spatial gradient measurement on an image. Then, the appro%imate absolute gradient
magnitude *edge strength+ at each point can be found. The 8obel operator uses a pair of
3%3 convolution mas(s, one estimating the gradient in the %direction *columns+ and the
other estimating the gradient in the ydirection *rows+.
T-- ollege of /ngineering )2
8/9/2019 20051739 Iris Recongition
13/60
They are shown belowI
The magnitude, or /97/ 8T-/7T6, of the gradient is then
appro%imated using the formulaI
L7L M L7%L N L7yL
3.; HOUGH TRANSFORM:
The 6ough transform is a technique which can be used to isolate features of
a particular shape within an image. Because it requires that the desired features be
specified in some parametric form, the classical 6ough transform is most commonly used
for the detection of regular curves such as lines, circles, ellipses, etc. A generali$ed
6ough transform can be employed in applications where a simple analytic description ofa feature*s+ is not possible. 9ue to the computational comple%ity of the generali$ed
6ough algorithm, we restrict the main focus of this discussion to the classical 6ough
transform.
9espite its domain restrictions, the classical 6ough transform *hereafter
referred to without the classical prefi%+ retains many applications0 as most manufactured
parts contain feature boundaries which can be described by regular curves. The main
advantage of the 6ough transform technique is that it is tolerant of gaps in feature
boundary descriptions and is relatively unaffected by image noise.
The 6ough transform is computed by ta(ing the gradient of the original
image and accumulating each non$ero point from the gradient image into every point
that is one radius distance away from it.
T-- ollege of /ngineering )3
8/9/2019 20051739 Iris Recongition
14/60
That way, edge points that lie along the outline of a circle of the given radius
all contribute to the transform at the center of the circle, and so pea(s in the transformed
image correspond to the centers of circular features of the given si$e in the original
image. nce a pea( is detected and a circle OfoundO at a particular point, nearby points
*within onehalf of the original radius+ are e%cluded as possible circle centers to avoid
detecting the same circular feature repeatedly.
5ig 3.2I 6ough
circle detection
with gradientinformation.
ne
way of reducing
the computation required to perform the 6ough transform is to ma(e use of gradient
information which is often available as output from an edge detector. #n the case of the
6ough circle detector, the edge gradient tells us in which direction a circle must lie from
a given edge coordinate point.
The 6ough transform can be seen as an efficient implementation of a
generali$ed matched filter strategy. #n other words, if we created a template composed of
a circle of )Os *at a fi%ed + and 'Os everywhere else in the image, then we could convolve
it with the gradient image to yield an accumulator arrayli(e description of all the circles
of radius in the image. 8how formally that the basic 6ough transforms * i.e. the
algorithm with no use of gradient direction information+ is equivalent to templatematching.
T-- ollege of /ngineering )>
8/9/2019 20051739 Iris Recongition
15/60
*3.3.)+ *3.3.2+ *3.3.3+ *3.3.>+
5ig 3.3 /97/ !A8I
3.3.)+ an eye image 3.3.2+ corresponding edge map 3.3.3+ edge map with only hori$ontal
gradients 3.3.>+ edge map with only vertical gradients.
3.= NORMALISATION:
nce the iris region is successfully segmented from an eye image, the ne%t
stage is to transform the iris region so that it has fi%ed dimensions in order to allow
comparisons. The dimensional inconsistencies between eye images are mainly due to thestretching of the iris caused by pupil dilation from varying levels of illumination. ther
sources of inconsistency include, varying imaging distance, rotation of the camera, head
tilt, and rotation of the eye within the eye soc(et. The normalisation process will produce
iris regions, which have the same constant dimensions, so that two photographs of the
same iris under different conditions will have characteristic features at the same spatial
location. Another point of note is that the pupil region is not always concentric within the
iris region, and is usually slightly nasal. This must be ta(en into account if trying to
normali$e the
8/9/2019 20051739 Iris Recongition
16/60
UN7RAPPING
4.1 INTRODUCTION:
#mage processing of the iris region is computationally e%pensive. #n additionthe area of interest in the image is a OdonutO shape, and grabbing pi%els in this region
requires repeated rectangulartopolar conversions. To ma(e things easier, the iris region
is first unwrapped into a rectangular region using simple trigonometry. This allows the
iris decoding algorithm to address pi%els in simple *row, column+ format.
4.2 ASYMMETRY OF THE EYE:
Although the pupil and iris circles appear to be perfectly concentric, they rarely
are. #n fact, the pupil and iris regions each have their own bounding circle radius and
center location. This means that the unwrapped region between the pupil and iris
bounding does not map perfectly to a rectangle. This is easily ta(en care of with a little
trigonometry. There is also the matter of the pupil, which grows and contracts its area to
control the amount of light entering the eye. Between any two images of the same
personOs eye, the pupil will li(ely have a different radius. ;hen the pupil radius changes,
the iris stretches with it li(e a rubber sheet. "uc(ily, this stretching is almost linear, and
can be compensated bac( to a standard dimension before further processing.
4.3 THE UN7RAPPING ALGORITHM:
#n fig >.), points p and i are the detected centers of the pupil and iris
respectively. ;e e%tend a wedge of angle dP starting at an angle P, from both points p
and i, with radii -p and -i, respectively. The intersection points of these wedges with
the pupil and iris circles form a s(ewed wedge polygon )23>. The s(ewed wedge is
subdivided radially into bloc(s and the image pi%el values in each bloc( are averaged
to form a pi%el *j,(+ in the unwrapped iris image, where j is the current angle number and
( is the current radius number.
T-- ollege of /ngineering )?
8/9/2019 20051739 Iris Recongition
17/60
5ig >.)I Algorithm
for unwrapping the
iris region.
5or
this project, the
standard
dimensions of the
e%tracted iris
rectangle are )2G rows and G columns *see 5igure >.)+. This corresponds to M)2G
wedges, each of angle , with each wedge divided radially into G sections. The
equations below define the important points mar(ed in 5igure ). oints a through d are
interpolated along line segments )3 and 2>.
4.4 CONTRAST AD>USTMENT:
T-- ollege of /ngineering )D
8/9/2019 20051739 Iris Recongition
18/60
5ig >.2I #mage before ontrast Adjustment
Fig 4.3: Image after Contrast Adjustment
otice that figures >.2 and >.3 appear to be better contrasted than figure >.)
These images have been equali$ed in contrast to ma%imi$e the range of luminance values
T-- ollege of /ngineering )G
8/9/2019 20051739 Iris Recongition
19/60
in the iris image. This ma(es it numerically easier to encode the iris data. The equali$ing
is done by acquiring a luminance histogram of the image and stretching the upper and
lower boundaries of the histogram to span the entire range of luminance values '2&&.
5igure >.) demonstrates an e%ample of this process.
4.5 FEATURE E?TRACTION:
Qne of the most interesting aspects of the world is that it can be considered
to be made up of patterns. A pattern is essentially an arrangement. #t is characteri$ed by
the order of the elements of which it is made, rather than by the intrinsic nature of these
elementsR *obert ;iener+. This definition summari$es our purpose in this part. #n fact,
this step is responsible of e%tracting the patterns of the iris ta(ing into account the
correlation between adjacent pi%els. 5or this we use wavelets transform, and more
specifically the Q7abor 5ilteringR.
CHAPTER @ 5
7AVELET ANALYSIS
T-- ollege of /ngineering )J
8/9/2019 20051739 Iris Recongition
20/60
5.1 GABOR FILTERING:
To understand the concept of 7abor filtering, we must first start with 7abor
wavelets. 7abor wavelets are formed from two components, a comple% sinusoidal carrier
and a 7aussian envelope.
g *%, y+ M s *%, y+ wr *%, y+
The comple% carrier ta(es the formI
s *%, y+ M e j*2S*u'%Nv'y+N+
;e can visuali$e the real and imaginary parts of this function separately as
shown in this figure. The real part of the function is given byI
-e *s *%, y++ M cos *2S *u'% N v'y+ N +
*&.&.)+ *&.&.2+
5ig &.) #!A7/ 8-/
&.&.)+-eal art &.&.2+#maginary art
and the imaginaryI
#m *s *%, y++ M sin *2 *u'% N v'y+ N +
The parameters u' and v' represent the frequency of the hori$ontal and vertical
sinusoids respectively. represents an arbitrary phase shift. The second component of a
7abor wavelet is its envelope. The resulting wavelet is the product of the sinusoidal
carrier and this envelope. The envelope has a 7aussian profile and is described by the
following equationI
g *%, y+ M :e S*a2*%U%'+r 2Nb2*yUy'+r 2+
T-- ollege of /ngineering 2'
8/9/2019 20051739 Iris Recongition
21/60
;hereI *% U %'+r M *% U %'+ cos *P+ N *y U y'+ sin *P+
*y U y'+r M U*% U %'+ sin *P+ N *y U y'+ cos *P+
The parameters used above areI
: a scaling constant
*a, b+ /nvelope a%is scaling constants,
P envelope rotation constant,
*%', y'+ 7aussian envelope pea(.
5ig &.2 7A88#A /@/"/
To put it all together, we multiply s *%, y+ by wr *%, y+. This produces a wavelet li(e this
oneI
5ig &.3 7AB- ;A@/"/T
5.2 GENERATING AN IRIS CODE:
T-- ollege of /ngineering 2)
8/9/2019 20051739 Iris Recongition
22/60
After performing unwrapping algorithm it maps the image to artesian coordinates so we
have something li(e the followingI
5ig &.> -""/9 #-#8
;hat we want to do is somehow e%tract a set of unique features from this iris
and then store them. That way if we are presented with an un(nown iris, we can compare
the stored features to the features in the un(nown iris to see if they are the same. ;eOll
call this set of features an V#ris ode.V
Any given iris has a unique te%ture that is generated through a random process
before birth. 5ilters based on 7abor wavelets turn out to be very good at detecting
patterns in images. ;eOll use a fi%ed frequency )9 7abor filter to loo( for patterns in our
unrolled image.
5irst, weOll ta(e a one pi%el wide column from our unrolled image and
convolve it with a )9 7abor wavelet. Because the 7abor filter is comple%, the result willhave real and imaginary parts which are treated separately. ;e only want to store a small
number of bits for each iris code, so the real and imaginary parts are each quanti$ed. #f a
given value in the result vector is greater than $ero, a one is stored0 otherwise $ero is
stored. nce all the columns of the image have been filtered and quanti$ed, we can form
a new blac( and white image by putting all of the columns side by side. The real and
imaginary parts of this image *a matri%+, the iris code, are shown hereI
T-- ollege of /ngineering 22
8/9/2019 20051739 Iris Recongition
23/60
*&.&.)+ *&.&.2+
5ig &.& #!A7/ 5 #-#8 9/
&.&.)+ -/A" A-T &.&.2+ #!A7#A-E A-T
5.3 TEST OF STATISTICAL INDEPENDANCE:
This test enables the comparison of two iris patterns. This test is based on
the idea that the greater the 6amming distance between two feature vectors, the greater
the difference between them. Two similar irises will fail this test since the distance
between them will be small. #n fact, any two different irises are statistically QguaranteedR
to pass this test as already proven. The 6amming distance *69+ between two Boolean
vectors is defined as followsI
;here, A and B are the coefficients of two iris images and is the si$e of the feature
vector *in our case M D'2+. The is the (nown Boolean operator that gives a binary )
if the bits at position j in A and B are different and ' if they are similar.
5ig &.& 6A!!#7 9#8TA/8 A""AT#I
T-- ollege of /ngineering 23
8/9/2019 20051739 Iris Recongition
24/60
CHAPTER - ;
MATLAB
;.1 INTRODUCTION: !AT"ABW is a highperformance language for technical computing. #t
integrates computation, visuali$ation, and programming in an easytouse environment
where problems and solutions are e%pressed in familiar mathematical notation. Typical
uses include
• !ath and computation
• Algorithm development
• 9ata acquisition
• !odeling, simulation, and prototyping
• 9ata analysis, e%ploration, and visuali$ation
• 8cientific and engineering graphics
• Application development, including graphical user interface
building.
!AT"AB is an interactive system whose basic data element is an
array that does not require dimensioning. This allows you to solve many technical
computing problems, especially those with matri% and vector formulations, in a
fraction of the time it would ta(e to write a program in a scalar non interactive
language such as or 5-T-A.
The name !AT"AB stands for matrix laboratory. !AT"AB was
originally written to provide easy access to matri% software developed by the
"#A: and /#8A: projects. Today, !AT"AB engines incorporate the"AA: and B"A8 libraries, embedding the state of the art in software for
matri% computation.
T-- ollege of /ngineering 2>
8/9/2019 20051739 Iris Recongition
25/60
!AT"AB features a family of addon applicationspecific solutions called
toolbo%es. @ery important to most users of !AT"AB, toolbo%es allow you to and apply
speciali$ed technology. Toolbo%es are comprehensive collections of !AT"AB functions
*!files+ that e%tend the !AT"AB environment to solve particular classes of problems.
Areas in which toolbo%es are available include signal processing, control systems, neural
networ(s, fu$$y logic, wavelets, simulation, and many others.
;.2 THE MATLAB SYSTEM:
The !AT"AB system consists of five main partsI
( DEVELOPMENT ENVIRONMENT:
This is the set of tools and facilities that help you use !AT"AB functions
and files. !any of these tools are graphical user interfaces. #t includes the !AT"AB
des(top and ommand ;indow, a command history, an editor and debugger, and
browsers for viewing help, the wor(space, files, and the search path.
, THE MATLAB MATHEMATICAL FUNCTION LIBRARY:
This is a vast collection of computational algorithms ranging from elementary
functions, li(e sum, sine, cosine, and comple% arithmetic, to more sophisticated functions
li(e matri% inverse, matri% /igen values, Bessel functions, and fast 5ourier transforms.
$ THE MATLAB LANGUAGE:
This is a highlevel matri%1array language with control flow statements,
functions, data structures, input1output, and objectoriented programming features. #t
allows both Vprogramming in the smallV to rapidly create quic( and dirty throwaway
programs, and Vprogramming in the largeV to create large and comple% application programs.
T-- ollege of /ngineering 2&
8/9/2019 20051739 Iris Recongition
26/60
0 GRAPHICS:
!AT"AB has e%tensive facilities for displaying vectors and matrices as
graphs, as well as annotating and printing these graphs. #t includes highlevel functions
for twodimensional and threedimensional data visuali$ation, image processing,
animation, and presentation graphics. #t also includes lowlevel functions that allow you
to fully customi$e the appearance of graphics as well as to build complete graphical user
interfaces on your !AT"AB applications.
! THE MATLAB APPLICATION PROGRAM INTERFACE:
This is a library that allows you to write and 5-T-A programs that
interact with !AT"AB. #t includes facilities for calling routines from !AT"AB
*dynamic lin(ing+, calling !AT"AB as a computational engine, and for reading and
writing !ATfiles.
T-- ollege of /ngineering 2?
8/9/2019 20051739 Iris Recongition
27/60
SOURCE CODE
function XB9, B;TY Mbandtrace *B;+B9 M XY0
B;T M B;0
8T M fndst *B;T+0
dir M X),)Y0
oint M 8T0
B9 M XB908TY0
e%t M oint N dir0
while *e%t*)+4e%t*2+MM'+ L *e%t*)+ZMsi$e*B;T,)++ L
*e%t*2+ZMsi$e*B;T,2++
dir M dirne%t*dir,'+0
e%t M oint N dir0
end
B;T*oint*)+,oint*2++ M '0
totle M sum*sum*B;T++0
i M )0j M '0
while *i[Mtotle+ \ **e%t*)+]M8T*)++ L *e%t*2+]M8T*2+++
if B;T*e%t*)+,e%t*2++ MM '
if j ZM G
e%t M oint0
brea(0
end
j M j N )0 dir M dirne%t*dir,'+0
e%t M oint N dir0
else
j M '0
T-- ollege of /ngineering 2D
8/9/2019 20051739 Iris Recongition
28/60
8/9/2019 20051739 Iris Recongition
29/60
Oguiutput5cnO, _ircl9etectutput5cn, ...
Ogui"ayout5cnO, XY , ...
Oguiallbac(O, XY+0
if nargin \\ ischar*varargin`)+
gui8tate.guiallbac( M str2func*varargin`)+0
end
F /%ecutes just before ircl9etect is made visible.
function ircl9etectpening5cn*hbject, eventdata, handles, varargin+
F This function has no output args, see utput5cn.
F hbject handle to figure
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F varargin command line arguments to ircl9etect *see @A-A-7#+
F hoose default command line output for ircl9etect
#mage M repmat*logical*uintG*'++,2'',2''+0
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
F /%ecutes on slider movement.
function -ad8etallbac(*hbject, eventdata, handles+
F hbject handle to -ad8et *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 6intsI get*hbject,O@alueO+ returns position of slider
F get*hbject,O!inO+ and get*hbject,O!a%O+ to determine range of slider
T-- ollege of /ngineering 2J
8/9/2019 20051739 Iris Recongition
30/60
set*handles.te%t-,OstringO,get*hbject,O@alueO++0
F /%ecutes during object creation, after setting all properties.
function -ad8etreate5cn*hbject, eventdata, handles+
F hbject handle to -ad8et *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI slider controls usually have a light gray bac(ground, change
F OusewhitebgO to ' to use default. 8ee #8 and !T/-.
usewhitebg M )0
if usewhitebg
set*hbject,OBac(groundolorO,X.J .J .JY+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
F /%ecutes on button press in pushbutton).
function pushbutton)allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton) *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
M /locate*handles.#mage,Xhandles.set0handles.setEY+0
set*handles.-ad9et,O8tringO,*3++0
F /%ecutes on button press in pushbutton).
function pushbutton2allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton) *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
close*gcf+0
function -ad9etallbac(*hbject, eventdata, handles+
F hbject handle to -ad9et *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
T-- ollege of /ngineering 3'
8/9/2019 20051739 Iris Recongition
31/60
F 6intsI get*hbject,O8tringO+ returns contents of -ad9et as te%t
F str2double*get*hbject,O8tringO++ returns contents of -ad9et as a double
F /%ecutes during object creation, after setting all properties.
function -ad9etreate5cn*hbject, eventdata, handles+
F hbject handle to -ad9et *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
F /%ecutes on button press in pb8et.
function pb8etallbac(*hbject, eventdata, handles+
F hbject handle to pb8et *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
handles.set M str2double*get*handles.ent,O8tringO++0
handles.setE M str2double*get*handles.entE,O8tringO++0
handles.set- M get*handles.-ad8et,O@alueO+0
handles.#mage M handles.#mage4'0
outputcoord M plotcircle*handles.set,handles.setE,handles.set-+0
for iM)Isi$e*outputcoord,)+
handles.#mage*round*outputcoord*i,2++,round*outputcoord*i,)+++ M )0
end
a%es*handles.a%es)+0
imshow*handles.#mage+0
guidata*hbject, handles+0
function Xe%tdirYMdirne%t*dir,step+
T-- ollege of /ngineering 3)
8/9/2019 20051739 Iris Recongition
32/60
if stepMM'
dirMXX),)YO,X),'YO,X),)YO,X',)YO,X),)YO,X),'YO,X),)YO,X',)YOY0
for i M )IG
if dirO MM dir*I,i+
try e%tdirMdir*I,iN)+0
catch e%tdirMdir*I,)+0
end
e%tdirMe%tdirO0
end
end
elseif stepMM)
dirEMXX),)YO,X),)YO,X),)YO,X),)YO0X),'YO,X',)YO,X),'YO,X',)YOY0
9*i,j+Msqrt**dataset)*i,)+dataset)*j,)++^2N*dataset)*i,2+dataset)*j,2++^2+0
end
end
end
case 2
Xm),n)YMsi$e*dataset)+0
Xm2,n2YMsi$e*dataset2+0
9M$eros*m),m2+0
for iM)Im)
waitbar*i1m)+
for jM)Im2
9*i,j+Msqrt**dataset)*i,)+ dataset2*j,)++^2N*dataset)*i,2+ dataset2*j,2++^2+0
end
end
otherwise
error*Oonly one or two input argumentsO+
end
close*h+
function 9M/uclidian*dataset),dataset2+
T-- ollege of /ngineering 32
8/9/2019 20051739 Iris Recongition
33/60
h M waitbar*',O9istance omputationO+0
switch nargin
case )
Xm),n)YMsi$e*dataset)+0
m2Mm)0
9M$eros*m),m2+0
for iM)Im)
waitbar*i1m)+
for jM)Im2
if iMMj
9*i,j+Ma0
else
9*i,j+Msqrt**dataset)*i,)+dataset)*j,)++^2N*dataset)*i,2+
dataset)*j,2++^2+0
end
end
end
case 2
Xm),n)YMsi$e*dataset)+0
Xm2,n2YMsi$e*dataset2+0
9M$eros*m),m2+0
for iM)Im)
waitbar*i1m)+
for jM)Im2
9*i,j+Msqrt**dataset)*i,)+ dataset2*j,)++^2N*dataset)*i,2+
dataset2*j,2++^2+0
end
end
otherwise
error*Oonly one or two input argumentsO+
end
T-- ollege of /ngineering 33
8/9/2019 20051739 Iris Recongition
34/60
close*h+
function X8TY M fndst*B;+
s$ M si$e*B;+0
r M '0c M '0
sign M '0
for i M ) I s$*)+
for j M ) I s$*2+
if B;*i,j+ MM )
r M i0c M j0
sign M )0
brea(0
end
end
if sign MM ),brea(,end
end
if *rMM'+ L *cMM'+
error*OThere is no white point in VB;V.O+0
else
8T M Xr,cY0
/nd
function X,6!YM6oughcircle*B;,-p+
F676#-"/ detects circles in a binary image.
# M B;0
Xsy,s%YMsi$e*#+0
Xy,%YMfind*#+0
totalpi% M length*%+0
6!tmp M $eros*sy4s%,)+0
b M )Isy0
a M $eros*sy,totalpi%+0
if nargin MM )
-min M )0
T-- ollege of /ngineering 3>
8/9/2019 20051739 Iris Recongition
35/60
-ma% M ma%*ma%*%+,ma%*y++0
else
-min M -p*)+0
-ma% M -p*2+0
end
y M repmat*yO,Xsy,)Y+0
% M repmat*%O,Xsy,)Y+0
6 M '0
for - M -min I -ma%
-2 M -^20
b) M repmat*bO,X),totalpi%Y+0
b2 M b)0
a) M *round*% sqrt*-2 *y b)+.^2+++0
a2 M *round*% N sqrt*-2 *y b2+.^2+++0
b) M b)*imag*a)+MM' \ a)Z' \ a)[s%+0
a) M a)*imag*a)+MM' \ a)Z' \ a)[s%+0
b2 M b2*imag*a2+MM' \ a2Z' \ a2[s%+0
a2 M a2*imag*a2+MM' \ a2Z' \ a2[s%+0
ind) M sub2ind*Xsy,s%Y,b),a)+0
ind2 M sub2ind*Xsy,s%Y,b2,a2+0
ind M Xind)0 ind2Y0
val M ones*length*ind+,)+0
dataMaccumarray*ind,val+0
6!tmp*)Ilength*data++ M data0
6!2tmp M reshape*6!tmp,Xsy,s%Y+0
Fimshow*6!2,XY+0
ma%val M ma%*ma%*6!2tmp++0
if ma%valZ6
6 M ma%val0
6! M 6!2tmp0
-c M -0
T-- ollege of /ngineering 3&
8/9/2019 20051739 Iris Recongition
36/60
end
end
XB,AY M find*6!MM6+0
M Xmean*A+,mean*B+,-cY0
function varargout M hough7#*varargin+
F 6767# !file for hough7#.fig
F 6767#, by itself, creates a new 6767# or raises the e%isting
F singleton4.
F Begin initiali$ation code 9 T /9#T
gui8ingleton M )0
gui8tate M struct*OguiameO, mfilename, ...
Ogui8ingletonO, gui8ingleton, ...
Oguipening5cnO, _hough7#pening5cn, ...
Oguiutput5cnO, _hough7#utput5cn, ...
Ogui"ayout5cnO, XY , ...
Oguiallbac(O, XY+0
if nargin \\ ischar*varargin`)+
gui8tate.guiallbac( M str2func*varargin`)+0
end
if nargout
Xvarargout`)InargoutY M guimainfcn*gui8tate, varargin`I+0
else
guimainfcn*gui8tate, varargin`I+0
end
F /nd initiali$ation code 9 T /9#T
F /%ecutes just before hough7# is made visible.
function hough7#pening5cn*hbject, eventdata, handles, varargin+
F This function has no output args, see utput5cn.
F hbject handle to figure
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
T-- ollege of /ngineering 3?
8/9/2019 20051739 Iris Recongition
37/60
F varargin command line arguments to hough7# *see @A-A-7#+
F hoose default command line output for hough7#
handles.output M hbject0
8 M repmat*logical*uintG*'++,>'',>''+0
outputcoord M plotcircle*2'',2'',D&+0
for iM)Isi$e*outputcoord,)+
8*round*outputcoord*i,2++,round*outputcoord*i,)+++ M )0
end
a%es*handles.a%es)+0
imshow*8+0
handles.8 M 80
F pdate handles structure
guidata*hbject, handles+0
F #;A#T ma(es hough7# wait for user response *see #-/8!/+
F uiwait*handles.figure)+0
F utputs from this function are returned to the command line.
function varargout M hough7#utput5cn*hbject, eventdata, handles+
F varargout cell array for returning output args *see @A-A-7T+0
F hbject handle to figure
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 7et default command line output from handles structure
varargout`) M handles.output0
F /%ecutes on button press in pb"oad.
function pb"oadallbac(*hbject, eventdata, handles+
F hbject handle to pb"oad *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
Xfilename, pathnameY M uigetfile*`O4.bmpO0O4.jpgO0O4.tifO+0
8 M imread*Xpathname filenameY+0
handles.8 M 80
T-- ollege of /ngineering 3D
8/9/2019 20051739 Iris Recongition
38/60
a%es*handles.a%es)+0
imshow*8+0
handles.output M hbject0
guidata*hbject, handles+0
F /%ecutes on button press in pb9etect.
function pb9etectallbac(*hbject, eventdata, handles+
F hbject handle to pb9etect *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
- M get*handles.sld-,O@alueO+0
X,6!Y M 6oughcircle*handles.8,X-,-Y+0
Xma%val,ma%indY M ma%*ma%*6!++0
a%es*handles.a%es2+0
imshow*6!+0
a%es*handles.a%es3+0
imshow*handles.8+0hold on0
outputcoord M plotcircle**)+,*2+,*3++0
plot*outputcoord*I,)+,outputcoord*I,2++0
plot**)+,*)+,Or4O+0hold off0
set*handles.t%t,OstringO,*)++0
set*handles.t%tE,OstringO,*2++0
set*handles.t%t@al,OstringO,ma%val+0
F /%ecutes on slider movement.
function sld-allbac(*hbject, eventdata, handles+
F hbject handle to sld- *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 6intsI get*hbject,O@alueO+ returns position of slider
F get*hbject,O!inO+ and get*hbject,O!a%O+ to determine range of slider
set*handles.t%t-,OstringO,get*hbject,O@alueO++0
F /%ecutes during object creation, after setting all properties.
T-- ollege of /ngineering 3G
8/9/2019 20051739 Iris Recongition
39/60
function sld-reate5cn*hbject, eventdata, handles+
function t%t@alallbac(*hbject, eventdata, handles+
F hbject handle to t%t@al *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 6intsI get*hbject,O8tringO+ returns contents of t%t@al as te%t
F str2double*get*hbject,O8tringO++ returns contents of t%t@al as a double
F /%ecutes during object creation, after setting all properties.
function t%t@alreate5cn*hbject, eventdata, handles+
F hbject handle to t%t@al *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc \\ isequal*get*hbject,OBac(groundolorO+,
get*',OdefaulticontrolBac(groundolorO++
set*hbject,OBac(groundolorO,OwhiteO+0
end
F /%ecutes on button press in pb-eturn.
function pb-eturnallbac(*hbject, eventdata, handles+
F hbject handle to pb-eturn *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F lose urrent figure window.
close*gcf+0
function XB;YMim2bwt*#,t+
if nargin MM )
t M tautoset*#+0
end
s$Msi$e*#+0
B;Mrepmat*logical*uintG*'++,s$*)+,s$*2++0
T-- ollege of /ngineering 3J
8/9/2019 20051739 Iris Recongition
40/60
for r M 3 I s$*)+2
for c M 3 I s$*2+2
if #*r,c+[t
if *#*r),c)+[t+\*#*r),c+[t+\*#*r),cN)+[t+\*#*r,c
)+[t+\*#*r,cN)+[t+\*#*rN),c)+[t+\*#*rN),c+[t+\*#*rN),cN)+[t+
B;*r,c+ M '0
else
B;*r,c+ M )0
end
else
B;*r,c+ M '0
end
end
end
for r M ) I s$*)+
B;*r,)I2+ M '0
B;*r,*si$e*B;,2+)+Isi$e*B;,2++ M '0
end
for c M ) I s$*2+
B;*)I2,c+ M '0
B;**si$e*B;,)+)+Isi$e*B;,)+,c+ M '0
end
function varargout M #ris"ocat*varargin+
F #-#8"AT !file for #ris"ocat.fig
F
gui8ingleton M )0
gui8tate M struct*OguiameO, mfilename, ...
Ogui8ingletonO, gui8ingleton, ...
Oguipening5cnO, _#ris"ocatpening5cn, ...
Oguiutput5cnO, _#ris"ocatutput5cn, ...
Ogui"ayout5cnO, XY , ...
T-- ollege of /ngineering >'
8/9/2019 20051739 Iris Recongition
41/60
Oguiallbac(O, XY+0
if nargin \\ ischar*varargin`)+
gui8tate.guiallbac( M str2func*varargin`)+0
end
if nargout
Xvarargout`)InargoutY M guimainfcn*gui8tate, varargin`I+0
else
guimainfcn*gui8tate, varargin`I+0
end
F /%ecutes just before #ris"ocat is made visible.
function #ris"ocatpening5cn*hbject, eventdata, handles, varargin+
guidata*hbject, handles+0
F #;A#T ma(es #ris"ocat wait for user response *see #-/8!/+
F uiwait*handles.figure)+0
F utputs from this function are returned to the command line.
function varargout M #ris"ocatutput5cn*hbject, eventdata, handles+
F varargout cell array for returning output args *see @A-A-7T+0
F hbject handle to figure
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 7et default command line output from handles structure
varargout`) M handles.output0
function edit3allbac(*hbject, eventdata, handles+
F hbject handle to edit3 *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 6intsI get*hbject,O8tringO+ returns contents of edit3 as te%t
F str2double*get*hbject,O8tringO++ returns contents of edit3 as a double
F /%ecutes during object creation, after setting all properties.
function edit3reate5cn*hbject, eventdata, handles+
F hbject handle to edit3 *see 7B+
T-- ollege of /ngineering >)
8/9/2019 20051739 Iris Recongition
42/60
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
function edit2allbac(*hbject, eventdata, handles+
F hbject handle to edit2 *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 6intsI get*hbject,O8tringO+ returns contents of edit2 as te%t
F str2double*get*hbject,O8tringO++ returns contents of edit2 as a double
F /%ecutes during object creation, after setting all properties.
function edit2reate5cn*hbject, eventdata, handles+
F hbject handle to edit2 *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
function edit?allbac(*hbject, eventdata, handles+
F hbject handle to edit? *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
T-- ollege of /ngineering >2
8/9/2019 20051739 Iris Recongition
43/60
F 6intsI get*hbject,O8tringO+ returns contents of edit? as te%t
F str2double*get*hbject,O8tringO++ returns contents of edit? as a double
F /%ecutes during object creation, after setting all properties.
function edit?reate5cn*hbject, eventdata, handles+
F hbject handle to edit? *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
function edit&allbac(*hbject, eventdata, handles+
F hbject handle to edit& *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
function edit&reate5cn*hbject, eventdata, handles+
F hbject handle to edit& *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
function edit>allbac(*hbject, eventdata, handles+
F hbject handle to edit> *see 7B+
T-- ollege of /ngineering >3
8/9/2019 20051739 Iris Recongition
44/60
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
F 6intsI get*hbject,O8tringO+ returns contents of edit> as te%t
F str2double*get*hbject,O8tringO++ returns contents of edit> as a double
F /%ecutes during object creation, after setting all properties.
function edit>reate5cn*hbject, eventdata, handles+
F hbject handle to edit> *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and !T/-.
if ispc
set*hbject,OBac(groundolorO,OwhiteO+0
else
set*hbject,OBac(groundolorO,get*',OdefaulticontrolBac(groundolorO++0
end
F /%ecutes on button press in pushbutton).
function pushbutton)allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton) *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
Xfilename, pathnameY M uigetfile*`O4.bmpO0O4.jpgO0O4.tifO+0
8 M imread*Xpathname filenameY+0
if isrgb*8+
8 M rgb2gray*8+0
end
F8Mresi$eu2*8,'.G,'.G+0
handles.8 M 80
a%es*handles.a%es)+0
imshow*8+0
handles.output M hbject0
T-- ollege of /ngineering >>
8/9/2019 20051739 Iris Recongition
45/60
guidata*hbject, handles+0
F /%ecutes on button press in pushbutton2.
function pushbutton2allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton2 *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
B; M im2bwt*handles.8+0
B; M bandtrace*B;+0
tic0
M 6oughcircle*B;+0
t) M toc0
set*handles.te%tT),OstringO,t)+0
handles. M 0
set*handles.edit),OstringO,*)++0
set*handles.edit2,OstringO,*2++0
set*handles.edit3,OstringO,*3++0
a%es*handles.a%es2+0
imshow*handles.8+0 hold on0
plot**)+,*2+,O%rO+0
outputcoord M plotcircle**)+,*2+,*3++0
plot*outputcoord*I,)+,outputcoord*I,2++0
hold off0
M handles.
B; M ]*im2bw*handles.8++0
enter M X*)+0*2+Y0
for i M & I &
for j M & I &
ent M X*)+Ni0*2+NjY0
enter M Xenter,entY0
end
end
T-- ollege of /ngineering >&
8/9/2019 20051739 Iris Recongition
46/60
tic0
) M /locate*B;,enter,*3++0
t2 M toc0
set*handles.te%tT2,OstringO,t2+0
handles.) M )0
set*handles.edit>,OstringO,)*)++0
set*handles.edit&,OstringO,)*2++0
set*handles.edit?,OstringO,)*3++0
a%es*handles.a%es3+0
imshow*handles.8+0 hold on0
plot*)*)+,)*2+,O4gO+0
outputcoord M plotcircle*)*)+,)*2+,)*3++0
plot*outputcoord*I,)+,outputcoord*I,2++0
hold off0
handles.output M hbject0
guidata*hbject, handles+0
F /%ecutes on button press in pushbutton>.
function pushbutton>allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton> *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
fig M hough7#0
fig2handles M guihandles*fig+0
handles.figure2 M fig2handles0
handles.output M hbject0
guidata*hbject, handles+0
F /%ecutes on button press in pushbutton?.
function pushbutton?allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton? *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
T-- ollege of /ngineering >?
8/9/2019 20051739 Iris Recongition
47/60
a%es*handles.a%es)+0imshow*X2&&Y+0
a%es*handles.a%es2+0imshow*X2&&Y+0
a%es*handles.a%es3+0imshow*X2&&Y+0
set*handles.edit),OstringO,OO+0
set*handles.edit2,OstringO,OO+0
set*handles.edit3,OstringO,OO+0
set*handles.edit>,OstringO,OO+0
set*handles.edit&,OstringO,OO+0
set*handles.edit?,OstringO,OO+0
set*handles.te%tT),OstringO,OO+0
set*handles.te%tT2,OstringO,OO+0
if isfield*handles,O8O+
handles.8 M XY0
end
if isfield*handles,OO+
handles. M XY0
end
if isfield*handles,O)O+
handles.) M XY0
end
handles.output M hbject0
guidata*hbject, handles+0
F /%ecutes on button press in pushbuttonD.
function pushbuttonDallbac(*hbject, eventdata, handles+
F hbject handle to pushbuttonD *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
if isfield*handles,Ofigure2O+
if ishandle*handles.figure2.figure)+
close*handles.figure2.figure)+0
T-- ollege of /ngineering >D
8/9/2019 20051739 Iris Recongition
48/60
8/9/2019 20051739 Iris Recongition
49/60
function pushbutton)2allbac(*hbject, eventdata, handles+
F hbject handle to pushbutton)2 *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7#9ATA+
B; M im2bwt*handles.8+0
B; M bandtrace*B;+0
tic0
M 6oughcircle*B;+0
8T M fndst*B;+0
prompt M `O/nter file nameIO0
dlgtitle M O#nput for -adii e%portO0
numlines M )0
def M `O9avidO0
answer M inputdlg*prompt,dlgtitle,numlines,def+0
saveradii*answer`),,8T+0
F /%ecutes during object creation, after setting all properties.
function a%es3reate5cn*hbject, eventdata, handles+
F hbject handle to a%es3 *see 7B+
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns called
F 6intI place code in pening5cn to populate a%es3
function XB9im,B9YMbandtrace*B;+
B9 M XY0
B;Ttm M B;0
B9imMrepmat*logical*uintG*'++,si$e*B;,)+,si$e*B;,2++0
while sum*sum*B;Ttm++ ]M '
XB9tm,B;TtmY M bandtrace*B;Ttm+0
if length*B9+ [ length*B9tm+
B9 M B9tm0
end
T-- ollege of /ngineering >J
8/9/2019 20051739 Iris Recongition
50/60
8/9/2019 20051739 Iris Recongition
51/60
if C ZM '.&4totle
brea(0
end
end
r M r N deltar0
end
end
C M '0
for r M *3+deltar12 I *3+Ndeltar12
Ct M cirquad*B;,*)+,*2+,r,)+0
if C [ Ct
C M Ct0
*3+ M r0
Fbrea(0
end
end
F
F #nputs I
F The coordinates of the center of this circle
F E The E coordinates of the center of this circle
F -adius The radius of this circle ZM '
F intervals *optional+ The number of evenly spaced points along the a%is
F inclusive of the start and end coordinates
F *needed by OintervalO algorithm+
function outputcoord M plotcircle*,E,-adius,varargin+
output M XY0
outputE M XY0
tempmod M )0
calmode M OangleO0 Fdefault
intervals M a0
T-- ollege of /ngineering &)
8/9/2019 20051739 Iris Recongition
52/60
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F hec( optional inputs
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
if *length*varargin+ Z '+
for a M )I)Ilength*varargin+
if isstr*varargin`a+ MM )
if **strcmp*varargin`a,OangleO+ MM )+L...
*strcmp*varargin`a,OintervalO+ MM )+L...
*strcmp*varargin`a,ObresenhamO+ MM )+L...
*strcmp*varargin`a,Obresenham8olidO+ MM )+...
+
calmode M varargin`a0
end
elseif isfinite*varargin`a+ MM )
intervals M varargin`a0
else
error*O#nvalid argumentsO+0
end
end
end
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F #nitiali$ation of OintervalO
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
if strcmp*calmode,OintervalO+ MM )
T-- ollege of /ngineering &2
8/9/2019 20051739 Iris Recongition
53/60
F 8atisfies requirement for calculation by the given intervals
if isnan*intervals+ MM )
error*Oo interval givenO+0
end
tempmod M mod*intervals,2+0
interval M *intervals tempmod+ 1 20
intervalsi$e M *-adiusN-adius+1intervals0
value M '0
if tempmod MM )
output M X'Y0
outputE M X-adiusY0
else
value M *)12+4intervalsi$e0
end
calmode M OintervalO0
end
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F alculate the )st quardrant
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F 444444444444444444444444444444444444444444444444444444444444
F by the angle, scaled by the given radius
F 444444444444444444444444444444444444444444444444444444444444
if strcmp*calmode,OangleO+ MM )
incrementangle M pi4*)1-adius+0
currangle M pi120
loopM'0
while currangleZ'
loopMloopN)0
output M Xoutput*I+0sqrt*-adius^2*-adius4sin*currangle++^2+Y0
outputE M XoutputE*I+0sqrt*-adius^2*-adius4cos*currangle++^2+Y0
T-- ollege of /ngineering &3
8/9/2019 20051739 Iris Recongition
54/60
currangle M currangleincrementangle0
end
output M Xoutput*I+0-adiusY0
outputE M XoutputE*I+0'Y0
elseif strcmp*calmode,OintervalO+ MM )
F 444444444444444444444444444444444444444444444444444444444444
F by the given %interval
F 444444444444444444444444444444444444444444444444444444444444
value M value N intervalsi$e0
while value [ -adius
output M Xoutput*I+0valueY0
outputE M XoutputE*I+0sqrt**-adius4-adius+*value4value++Y0
value M value N intervalsi$e0
end
output M Xoutput*I+0-adiusY0
outputE M XoutputE*I+0'Y0
elseif *strcmp*calmode,ObresenhamO+ MM )+ L *strcmp*calmode,Obresenham8olidO+ MM
)+
M round*+0
E M round*E+0
-adius M round*-adius+0
F 444444444444444444444444444444444444444444444444444444444444
%i M '0
yi M -adius0
thetaiM24*)-adius+0
"imit M '0
while yi ZM "imit
F 8et i%el
if *strcmp*calmode,ObresenhamO+ MM )+
F lot the circumference
T-- ollege of /ngineering &>
8/9/2019 20051739 Iris Recongition
55/60
output M Xoutput*I+0%iY0
outputE M XoutputE*I+0yiY0
elseif *strcmp*calmode,Obresenham8olidO+ MM )+
F reate a solid circle
tempE M X'I)IyiYO0
temp M tempE0
temp*I+ M %i0
output M Xoutput*I+0tempY0
outputE M XoutputE*I+0tempEY0
else
error*O#nvalid optionO+0
end
F determine if case ) or 2, > or &, or 3
if thetai [ '
delta M 24*thetai N yi+ )0
F determine whether case ) or 2
if delta [M '
F move hori$ontally
%i M %i N )0
thetai M thetai N *24%i+ N )0
else
F move diagonally
%i M %i N )0
yi M yi )0
thetai M thetai N *24*%i yi++ N 20
end
elseif thetai Z '
end
elseif thetai MM '
F move diagonally
T-- ollege of /ngineering &&
8/9/2019 20051739 Iris Recongition
56/60
%i M %i N )0
yi M yi )0
thetai M thetai N *24*%i yi++ N 20
end
end
end
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F alculate the 2nd quardrant
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
lengthoutput M length*output+0
if tempmod MM )
F Avoids duplicate coordinates
output M Xoutput*XlengthoutputI)I2Y+4*)+0output*I+Y0
outputE M XoutputE*XlengthoutputI)I2Y+0outputE*I+Y0
else
output M Xoutput*XlengthoutputI)I)Y+4*)+0output*I+Y0
outputE M XoutputE*XlengthoutputI)I)Y+0outputE*I+Y0
end
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F 8hift the circle to the desired center
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
output M outputN0
outputE M outputENE0
outputcoord M Xoutput,outputEY0
F #f a solid is as(ed for ma(e sure there are no duplicates
if *strcmp*calmode,Obresenham8olidO+ MM )+
outputcoord M unique*outputcoord,OrowsO+0
T-- ollege of /ngineering &?
8/9/2019 20051739 Iris Recongition
57/60
end
function recogni$e
dat)Minput*Oenter the path of te%t file )O+0
dat2Minput*Oenter the path of te%t file 2O+0
a M te%tread*dat) , OFsO, OwhitespaceO, O O +0
b M te%tread*dat2 , OFsO, OwhitespaceO, O O +0
FdM/uclidian*a,b+0
if *cell2mat*a*J,)++]Mcell2mat*b*J,)+++
disp*O#-#8 does not matches with the current personO+0
else if *cell2mat*a*)',)++]Mcell2mat*b*)',)+++
disp*O#-#8 does not matches with the current personO+ 0
else
disp*O#-#8 9/8 !AT6/8 ;#T6 T6/ --/T /-8O+0
end
end
function saveradii*name,,8T+
nameMstrrep*name,O O,OO+0
dateMdatestr*now,2J+0
5ileameMXname OO date O.t%tOY0
fileMfopen*5ileame,OwtO+0
fprintf*file,OF2.'f nO,si$e*,)++0
fprintf*file,OFsO,O-adiusI O+0
fprintf*file,OF2.'f nO,X8TY+0
fprintf*file,OFs nO,OO+0
fprintf*file,OFs nO,OO+0
fclose*file+0
function XTYMtautoset*#+
F#Mimread*Oeye.jpgO+
graycountMimhist*#+0
s$Msi$e*#+0
TM'0
T-- ollege of /ngineering &D
8/9/2019 20051739 Iris Recongition
58/60
graycountMfilter*X'.& ' '.&Y,),graycount+0
Ffigure,imhist*#+0
diffcntMdiff*graycount+0
prema% M graycount*)+0
for i M 2 I *length*diffcnt+)+
if *graycount*i+Zgraycount*i)++\*graycount*iN)+[graycount*i++\*diffcnt*i
)+Z'+\*diffcnt*iN)+['+
F
prema%Mma%*graycount*i+,prema%+0
continue0
end
if *graycount*i+[graycount*i)++\*graycount*iN)+Zgraycount*i++\*diffcnt*i
)+['+\*diffcnt*iN)+Z'+\*graycount*i+['.D&4prema%+\*prema%1*s$*)+4s$*2++Z'.'
'2&+
TMi0
brea(0
end
end
T-- ollege of /ngineering &G
8/9/2019 20051739 Iris Recongition
59/60
CONCLUSION
;e have successfully developed a new #ris -ecognition system capable of
comparing two digital eyeimages. This identification system is quite simple requiring
few components and is effective enough to be integrated within security systems that
require an identity chec(. The errors that occurred can be easily overcome by the use of
stable equipment. udging by the clear distinctiveness of the iris patterns we can e%pect
iris recognition systems to become the leading technology in identity verification.
T-- ollege of /ngineering &J
8/9/2019 20051739 Iris Recongition
60/60
BIBLOGRAPHY
• QThe Biometrics technologyR Third /dition.
by 7uodong 7uo.
• Q#-#8 -ecognitionR 8econd /dition.
by -oy :aushi( and rabir Bhattacharya.
• QThe #-#8 -ecognition 8ystemR
by (shvi( 9ouglas.
• QBiometric systemsR
by ;ayle ;olf
• www.alibris.com
• www.adaptiveoptics.org
• www.icdri.org
• www.sans.org
• www.google.co.in
• www.wi(ipedia.com
http://www.alibris.com/http://www.adaptiveoptics.org/http://www.icdri.org/http://www.sans.org/http://www.google.co.in/http://www.wikipedia.com/http://www.alibris.com/http://www.adaptiveoptics.org/http://www.icdri.org/http://www.sans.org/http://www.google.co.in/http://www.wikipedia.com/