20051739 Iris Recongition (1)
-
Upload
mohd-mubeen -
Category
Documents
-
view
225 -
download
0
Transcript of 20051739 Iris Recongition (1)
-
8/11/2019 20051739 Iris Recongition (1)
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 open source 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 thecornea 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/11/2019 20051739 Iris Recongition (1)
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 pre enrolled 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 samecharacteristic 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/11/2019 20051739 Iris Recongition (1)
3/60
1.3 TYPES OF BIOMETRICS:
4 hysical Biometrics 5inger print -ecognition
5acial -ecognition
6and 7eometry #-#8 -ecognition
9 A
4Behavioral Biometrics 8pea(er -ecognition
8ignature
:eystro(e ;al(ing style
1.4 IRIS RECOGNITION SYSTEM:
The purpose of
-
8/11/2019 20051739 Iris Recongition (1)
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/11/2019 20051739 Iris Recongition (1)
5/60
-
8/11/2019 20051739 Iris Recongition (1)
6/60
M!" o0 Co0!0 (""!#& Mi%i0!&"i i$("io&
#("!
S!$+#i"/ A )i$("io&%
I#i%
#!$o &i"io&
I#i% P(""!#& 1 1 266 666 Hi Hi -%!$+#i"/
($i)i"i!%
5ingerprinting 5ingerprints )1),''' !edium niversal6and shape 8i$e, length,
and thic(nessof hands
)1D'' "ow "ow security
facilities
5acial
recognition
utline, shapeanddistribution ofeyes and nose
)1)'' "ow "ow security
facilities
8ignature 8hape ofletters, writingorder, pen pressure
)1)'' "ow "ow security
facilities
@oice printing @oicecharacteristics
)13' "ow Telephone
service
TAB"/ 2.2 #-#8 -/ 7 #T# 8E8T/! A -A E
The comparison of various biometrics techniques is given in tables 2.)
and 2.2. The comparison shows that #-#8 recognition system is the most stable, precise
and the fastest biometric authentication method.
2.2 HUMAN IRIS:
The iris is a thin circular diaphragm, which lies between the cornea and
the lens of the human eye. A front on view of the iris is shown in 5igure ).). The iris is
perforated close to its centre by a circular aperture (nown as the pupil. The function of
the iris is to control the amount of light entering through the pupil, and this is done by the
sphincter and the dilator muscles, which adjust the si$e of the pupil. The average
diameter of the iris is )2 mm, and the pupil si$e can vary from )'F to G'F of the iris
diameter.
The iris consists of a number of layers0 the lowest is the epithelium layer,
which contains dense pigmentation cells. The stromal layer lies above the epithelium
T-- ollege of /ngineering ?
-
8/11/2019 20051739 Iris Recongition (1)
7/60
layer, and contains blood vessels, pigment cells and the two iris muscles. The density of
stromal pigmentation determines the color of the iris.
The e%ternally visible surface of the multi layered iris contains two $ones,
which often differ in color. An outer ciliary $one and an inner pupillary $one, and these
two $ones are divided by the collarette H which appears as a $ig$ag pattern
2.3 7OR8ING OF IRIS RECOGNITION SYSTEM:
#mage processing techniques can be employed to e%tract the unique iris
pattern from a digiti$ed image of the eye, and encode it into a biometric template, which
can be stored in a database. This biometric template contains an objective mathematical
representation of the unique information stored in the iris, and allows comparisons to be
made between templates. ;hen a subject wishes to be identified by iris recognitionsystem, their eye is first photographed, and then a template created for their iris region.
This template is then compared with the other templates stored in a database until either a
matching template is found and the subject is identified, or no match is found and the
subject remains unidentified.
5ig 2.) 6 !A /E/
2.4 FEATURES OF IRIS RECOGNITION:
T-- ollege of /ngineering D
-
8/11/2019 20051739 Iris Recongition (1)
8/60
M!(%+#(,)! P /%i$() F!("+#!%: 2&' degrees of freedom,2&' non related unique
features of a person=s iris U&i*+!: /very iris is absolutely unique. o two iris are the same
S"(,)!: iris remains stable from )styear till death. A$$+#("!: #ris recognition is the most accurate of the commonly used biometric
technologies. F(%": #ris recognition ta(es less than 2 seconds. 2' times more matches per
minute than its closest competitor. No&-I&'(%i'!: o bright lights or lasers are used in the imaging and iris
authentication process.
2.5 IRIS RECOGNITION SYSTEM STRENGTHS:
Hi )/ P#o"!$"!0: #nternal organ of the eye. /%ternally visible0 patterns imaged
from a distance M!(%+#(,)! F!("+#!% o i#i% (""!#&: #ris patterns possess a high degree of
randomness
@ariabilityI 2>> degrees of freedom
/ntropyI 3.2 bits per square millimeter U&i*+!&!%%:8et by combinatorial comple%ity
S"(,)!: atterns apparently stable throughout life
9+i$ (&0 ($$+#("! I /ncoding and decision ma(ing are tractable
#mage analysis and encoding timeI ) second
2.; IRIS RECOGNITION SYSTEM 7EA8NESS:
8ome difficulty in usage as individuals doesn=t (now e%actly where they should position themselves.
And if the person to be identified is not cooperating by holding the head still and
loo(ing into the camera.
T-- ollege of /ngineering G
-
8/11/2019 20051739 Iris Recongition (1)
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 9 cameras 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 9 chip. 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/ A C #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 eight bit to double precision thus facilitating the manipulation of the
images in subsequent steps.
T-- ollege of /ngineering
9 9/@# /T# A"
8E8T/!
A A" 7 T9#7#TA"
@/-T/-
-/A9 T! T/-
J
-
8/11/2019 20051739 Iris Recongition (1)
10/60
3.3 IRIS LOCALI then use the canny operator with the default threshold value given by !atlab,
to obtain the gradient image.
8ince the picture was acquired using an infrared camera the pupil is a
very distinct blac( circle. The pupil is in fact so blac( relative to everything else in the
picture simple edge detection should be able to find its outside edge very easily.
5urthermore, the thresholding on the edge detection can be set very high as to ignore
smaller less contrasting edges while still being able to retrieve the entire perimeter of the pupil. The best edge detection algorithm for outlining the pupil is canny edge detection.
This algorithm uses hori$ontal and vertical gradients in order to deduce edges in the
image. After running the canny edge detection on the image a circle is clearly present
along the pupil boundary.
anny /dge 9etector finds edges by loo(ing for the local ma%ima of the
gradient of the input image. #t calculates the gradient using the derivative of the 7aussian
filter. The anny method uses two thresholds to detect strong and wea( edges. #t includes
the wea( edges in the output only if they are connected to strong edges. As a result, the
method is more robust to noise, and more li(ely to detect true wea( edges.
3.4 EDGE DETECTION:
/dges often occur at points where there is a large variation in the luminance
values in an image, and consequently they often indicate the edges, or occluding
boundaries, of the objects in a scene. 6owever, large luminance changes can also
correspond to surface mar(ings on objects. oints of tangent discontinuity in the
luminance signal can also signal an object boundary in the scene.
T-- ollege of /ngineering )'
-
8/11/2019 20051739 Iris Recongition (1)
11/60
-
8/11/2019 20051739 Iris Recongition (1)
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 2 9
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 y direction *rows+.
T-- ollege of /ngineering )2
-
8/11/2019 20051739 Iris Recongition (1)
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 theclassical 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/11/2019 20051739 Iris Recongition (1)
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 one half 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 convolv
it with the gradient image to yield an accumulator array li(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/11/2019 20051739 Iris Recongition (1)
15/60
*3.3.)+ *3.3.2+ *3.3.3+ *3.3.>+
5ig 3.3 /97/ !A 8I
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/11/2019 20051739 Iris Recongition (1)
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 regio
requires repeated rectangular to polar 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 ) 2 3 >. 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/11/2019 20051739 Iris Recongition (1)
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/11/2019 20051739 Iris Recongition (1)
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/11/2019 20051739 Iris Recongition (1)
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:
Q ne 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/11/2019 20051739 Iris Recongition (1)
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 :eS*a2*%U%' +r 2Nb2*yUy' +r 2+
T-- ollege of /ngineering 2'
-
8/11/2019 20051739 Iris Recongition (1)
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 7A 88#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/11/2019 20051739 Iris Recongition (1)
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. ;eOllcall 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/11/2019 20051739 Iris Recongition (1)
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 QguaranteedRto 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/11/2019 20051739 Iris Recongition (1)
24/60
CHAPTER - ;
MATLAB
;.1 INTRODUCTION: !AT"AB W is a high performance language for technical computing. #t
integrates computation, visuali$ation, and programming in an easy to use 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"A A : and B"A8 libraries, embedding the state of the art in software for
matri% computation.
T-- ollege of /ngineering 2>
-
8/11/2019 20051739 Iris Recongition (1)
25/60
!AT"AB features a family of add on application specific 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 functionsli(e matri% inverse, matri% /igen values, Bessel functions, and fast 5ourier transforms.
$ THE MATLAB LANGUAGE:
This is a high level matri%1array language with control flow statements,
functions, data structures, input1output, and object oriented programming features. #t
allows both Vprogramming in the smallV to rapidly create quic( and dirty throw away
programs, and Vprogramming in the largeV to create large and comple% application programs.
T-- ollege of /ngineering 2&
-
8/11/2019 20051739 Iris Recongition (1)
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 high level functions
for two dimensional and three dimensional data visuali$ation, image processing,
animation, and presentation graphics. #t also includes low level 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 andwriting !AT files.
T-- ollege of /ngineering 2?
-
8/11/2019 20051739 Iris Recongition (1)
27/60
SOURCE CODE
function XB9, B;TY Mbandtrace *B;+B9 M XY0
B;T M B;0
8T M fnd st *B;T+0
dir M X ), )Y0
oint M 8T0
B9 M XB908TY0
e%t M oint N dir0
while * e%t *)+4 e%t *2+MM'+ L * e%t *)+ZMsi$e*B;T,)++ L
* e%t *2+ZMsi$e*B;T,2++
dir M dir ne%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 '0while *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 dir ne%t*dir,'+0
e%t M oint N dir0
else
j M '0
T-- ollege of /ngineering 2D
-
8/11/2019 20051739 Iris Recongition (1)
28/60
B9 M XB90 e%t Y0
B;T* e%t *)+, e%t *2++ M '0
oint M e%t 0
dir M dir ne%t*dir,)+0
e%t M oint N dir0
i M i N )0
end
while * e%t *)+4 e%t *2+MM'+ L * e%t *)+ZMsi$e*B;T,)++ L
* e%t *2+ZMsi$e*B;T,2++
dir M dir ne%t*dir,'+0
e%t M oint N dir0
endend
function XCYMcir quad*#,%c,yc,rc,t+
#t M #0
for r M ) I si$e*#,)+
for c M ) I si$e*#,2+
9ist*r,c+ M sqrt**r yc+^2N*c %c+^2+0
if abs*r yc+ Z abs*c %c+
#t*r,c+ M '0
end
end
end
C M sum*#t*find**9ist[MrcNt12+\*9istZMrc t12++++0
function varargout M ircl9etect*varargin+
F #- "9/T/ T ! file for ircl9etect.fig
gui 8ingleton M )0
gui 8tate M struct*Ogui ameO, mfilename, ...
Ogui 8ingletonO, gui 8ingleton, ...
Ogui pening5cnO, _ ircl9etect pening5cn, ...
T-- ollege of /ngineering 2G
-
8/11/2019 20051739 Iris Recongition (1)
29/60
Ogui utput5cnO, _ ircl9etect utput5cn, ...
Ogui "ayout5cnO, XY , ...
Ogui allbac(O, XY+0
if nargin \\ ischar*varargin`) +
gui 8tate.gui allbac( M str2func*varargin`) +0
end
F /%ecutes just before ircl9etect is made visible.
function ircl9etect pening5cn*h bject, eventdata, handles, varargin+
F This function has no output args, see utput5cn.
F h bject 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*h bject,OBac(ground olorO,OwhiteO+0
else
set*h bject,OBac(ground olorO,get*',Odefault icontrolBac(ground olorO++0
end
F /%ecutes on slider movement.
function -ad8et allbac(*h bject, eventdata, handles+
F h bject handle to -ad8et *see 7 B +
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*h bject,O@alueO+ returns position of slider
F get*h bject,O!inO+ and get*h bject,O!a%O+ to determine range of slider
T-- ollege of /ngineering 2J
-
8/11/2019 20051739 Iris Recongition (1)
30/60
-
8/11/2019 20051739 Iris Recongition (1)
31/60
F 6intsI get*h bject,O8tringO+ returns contents of -ad9et as te%t
F str2double*get*h bject,O8tringO++ returns contents of -ad9et as a double
F /%ecutes during object creation, after setting all properties.
function -ad9et reate5cn*h bject, eventdata, handles+
F h bject handle to -ad9et *see 7 B +
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*h bject,OBac(ground olorO,OwhiteO+0
else set*h bject,OBac(ground olorO,get*',Odefault icontrolBac(ground olorO++0
end
F /%ecutes on button press in pb8et.
function pb8et allbac(*h bject, eventdata, handles+
F h bject handle to pb8et *see 7 B +
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
output coord M plot circle*handles.set ,handles.setE,handles.set-+0
for iM)Isi$e*output coord,)+
handles.#mage*round*output coord*i,2++,round*output coord*i,)+++ M )0
end
a%es*handles.a%es)+0
imshow*handles.#mage+0
guidata*h bject, handles+0
function X e%tdirYMdir ne%t*dir,step+
T-- ollege of /ngineering 3)
-
8/11/2019 20051739 Iris Recongition (1)
32/60
-
8/11/2019 20051739 Iris Recongition (1)
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+M a 0
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/11/2019 20051739 Iris Recongition (1)
34/60
close*h+
function X8TY M fnd st *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+
F6 76 #- "/ 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/11/2019 20051739 Iris Recongition (1)
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!2 tmp M reshape*6! tmp,Xsy,s%Y+0
Fimshow*6!2,XY+0
ma%val M ma%*ma%*6!2 tmp++0
if ma%valZ6
6 M ma%val0
6! M 6!2 tmp0
-c M -0
T-- ollege of /ngineering 3&
-
8/11/2019 20051739 Iris Recongition (1)
36/60
end
end
XB,AY M find*6!MM6 +0
M Xmean*A+,mean*B+,-cY0
function varargout M hough7 #*varargin+
F 6 767 # ! file for hough7 #.fig
F 6 767 #, by itself, creates a new 6 767 # or raises the e%isting
F singleton4.
F Begin initiali$ation code 9 T /9#T
gui 8ingleton M )0
gui 8tate M struct*Ogui ameO, mfilename, ...
Ogui 8ingletonO, gui 8ingleton, ... Ogui pening5cnO, _hough7 # pening5cn, ...
Ogui utput5cnO, _hough7 # utput5cn, ...
Ogui "ayout5cnO, XY , ...
Ogui allbac(O, XY+0
if nargin \\ ischar*varargin`) +
gui 8tate.gui allbac( M str2func*varargin`) +0
end
if nargout
Xvarargout`)Inargout Y M gui mainfcn*gui 8tate, varargin`I +0
else
gui mainfcn*gui 8tate, varargin`I +0
end
F /nd initiali$ation code 9 T /9#T
F /%ecutes just before hough7 # is made visible.
function hough7 # pening5cn*h bject, eventdata, handles, varargin+
F This function has no output args, see utput5cn.
F h bject 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/11/2019 20051739 Iris Recongition (1)
37/60
F varargin command line arguments to hough7 # *see @A-A-7# +
F hoose default command line output for hough7 #
handles.output M h bject0
8 M repmat*logical*uintG*'++,>'',>''+0
output coord M plot circle*2'',2'',D&+0
for iM)Isi$e*output coord,)+
8*round*output coord*i,2++,round*output coord*i,)+++ M )0
end
a%es*handles.a%es)+0
imshow*8+0
handles.8 M 80
F pdate handles structureguidata*h bject, 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*h bject, eventdata, handles+
F varargout cell array for returning output args *see @A-A-7 T+0
F h bject 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"oad allbac(*h bject, eventdata, handles+
F h bject handle to pb"oad *see 7 B +
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/11/2019 20051739 Iris Recongition (1)
38/60
a%es*handles.a%es)+0
imshow*8+0
handles.output M h bject0
guidata*h bject, handles+0
F /%ecutes on button press in pb9etect.
function pb9etect allbac(*h bject, eventdata, handles+
F h bject handle to pb9etect *see 7 B +
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!++0a%es*handles.a%es2+0
imshow*6!+0
a%es*handles.a%es3+0
imshow*handles.8+0hold on0
output coord M plot circle* *)+, *2+, *3++0
plot*output coord*I,)+,output coord*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(*h bject, eventdata, handles+
F h bject handle to sld- *see 7 B +
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*h bject,O@alueO+ returns position of slider
F get*h bject,O!inO+ and get*h bject,O!a%O+ to determine range of slider
set*handles.t%t-,OstringO,get*h bject,O@alueO++0
F /%ecutes during object creation, after setting all properties.
T-- ollege of /ngineering 3G
-
8/11/2019 20051739 Iris Recongition (1)
39/60
function sld- reate5cn*h bject, eventdata, handles+
function t%t@al allbac(*h bject, eventdata, handles+
F h bject handle to t%t@al *see 7 B +
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*h bject,O8tringO+ returns contents of t%t@al as te%t
F str2double*get*h bject,O8tringO++ returns contents of t%t@al as a double
F /%ecutes during object creation, after setting all properties.
function t%t@al reate5cn*h bject, eventdata, handles+
F h bject handle to t%t@al *see 7 B +
F eventdata reserved to be defined in a future version of !AT"AB
F handles empty handles not created until after all reate5cns calledF 6intI edit controls usually have a white bac(ground on ;indows.
F 8ee #8 and ! T/-.
if ispc \\ isequal*get*h bject,OBac(ground olorO+,
get*',Odefault icontrolBac(ground olorO++
set*h bject,OBac(ground olorO,OwhiteO+0
end
F /%ecutes on button press in pb-eturn.
function pb-eturn allbac(*h bject, eventdata, handles+
F h bject handle to pb-eturn *see 7 B +
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;YMim2bw t*#,t+
if nargin MM )
t M t autoset*#+0
end
s$Msi$e*#+0
B;Mrepmat*logical*uintG*'++,s$*)+,s$*2++0
T-- ollege of /ngineering 3J
-
8/11/2019 20051739 Iris Recongition (1)
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
gui 8ingleton M )0
gui 8tate M struct*Ogui ameO, mfilename, ...
Ogui 8ingletonO, gui 8ingleton, ...
Ogui pening5cnO, _#ris"ocat pening5cn, ...
Ogui utput5cnO, _#ris"ocat utput5cn, ...
Ogui "ayout5cnO, XY , ...
T-- ollege of /ngineering >'
-
8/11/2019 20051739 Iris Recongition (1)
41/60
Ogui allbac(O, XY+0
if nargin \\ ischar*varargin`) +
gui 8tate.gui allbac( M str2func*varargin`) +0
end
if nargout
Xvarargout`)Inargout Y M gui mainfcn*gui 8tate, varargin`I +0
else
gui mainfcn*gui 8tate, varargin`I +0
end
F /%ecutes just before #ris"ocat is made visible.
function #ris"ocat pening5cn*h bject, eventdata, handles, varargin+
guidata*h bject, handles+0F #;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"ocat utput5cn*h bject, eventdata, handles+
F varargout cell array for returning output args *see @A-A-7 T+0
F h bject 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 edit3 allbac(*h bject, eventdata, handles+
F h bject handle to edit3 *see 7 B +
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*h bject,O8tringO+ returns contents of edit3 as te%t
F str2double*get*h bject,O8tringO++ returns contents of edit3 as a double
F /%ecutes during object creation, after setting all properties.
function edit3 reate5cn*h bject, eventdata, handles+
F h bject handle to edit3 *see 7 B +
T-- ollege of /ngineering >)
-
8/11/2019 20051739 Iris Recongition (1)
42/60
-
8/11/2019 20051739 Iris Recongition (1)
43/60
F 6intsI get*h bject,O8tringO+ returns contents of edit? as te%t
F str2double*get*h bject,O8tringO++ returns contents of edit? as a double
F /%ecutes during object creation, after setting all properties.
function edit? reate5cn*h bject, eventdata, handles+
F h bject handle to edit? *see 7 B +
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*h bject,OBac(ground olorO,OwhiteO+0
else set*h bject,OBac(ground olorO,get*',Odefault icontrolBac(ground olorO++0
end
function edit& allbac(*h bject, eventdata, handles+
F h bject handle to edit& *see 7 B +
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*h bject, eventdata, handles+
F h bject handle to edit& *see 7 B +
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*h bject,OBac(ground olorO,OwhiteO+0
else
set*h bject,OBac(ground olorO,get*',Odefault icontrolBac(ground olorO++0
end
function edit> allbac(*h bject, eventdata, handles+
F h bject handle to edit> *see 7 B +
T-- ollege of /ngineering >3
-
8/11/2019 20051739 Iris Recongition (1)
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*h bject,O8tringO+ returns contents of edit> as te%t
F str2double*get*h bject,O8tringO++ returns contents of edit> as a double
F /%ecutes during object creation, after setting all properties.
function edit> reate5cn*h bject, eventdata, handles+
F h bject handle to edit> *see 7 B +
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*h bject,OBac(ground olorO,OwhiteO+0
else
set*h bject,OBac(ground olorO,get*',Odefault icontrolBac(ground olorO++0
end
F /%ecutes on button press in pushbutton).
function pushbutton) allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton) *see 7 B +
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$e u2*8,'.G,'.G+0
handles.8 M 80
a%es*handles.a%es)+0
imshow*8+0
handles.output M h bject0
T-- ollege of /ngineering >>
-
8/11/2019 20051739 Iris Recongition (1)
45/60
guidata*h bject, handles+0
F /%ecutes on button press in pushbutton2.
function pushbutton2 allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton2 *see 7 B +
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 im2bw t*handles.8+0
B; M bandtrace*B;+0
tic0
M 6oughcircle*B;+0
t) M toc0
set*handles.te%t T),OstringO,t)+0handles. 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
output coord M plot circle* *)+, *2+, *3++0
plot*output coord*I,)+,output coord*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 X enter, entY0
end
end
T-- ollege of /ngineering >&
-
8/11/2019 20051739 Iris Recongition (1)
46/60
tic0
) M /locate*B;, enter, *3++0
t2 M toc0
set*handles.te%t T2,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
output coord M plot circle* )*)+, )*2+, )*3++0 plot*output coord*I,)+,output coord*I,2++0
hold off0
handles.output M h bject0
guidata*h bject, handles+0
F /%ecutes on button press in pushbutton>.
function pushbutton> allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton> *see 7 B +
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
fig2 handles M guihandles*fig+0
handles.figure2 M fig2 handles0
handles.output M h bject0
guidata*h bject, handles+0
F /%ecutes on button press in pushbutton?.
function pushbutton? allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton? *see 7 B +
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/11/2019 20051739 Iris Recongition (1)
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%t T),OstringO,OO+0
set*handles.te%t T2,OstringO,OO+0
if isfield*handles,O8O+ handles.8 M XY0
end
if isfield*handles,O O+
handles. M XY0
end
if isfield*handles,O )O+
handles. ) M XY0
end
handles.output M h bject0
guidata*h bject, handles+0
F /%ecutes on button press in pushbuttonD.
function pushbuttonD allbac(*h bject, eventdata, handles+
F h bject handle to pushbuttonD *see 7 B +
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/11/2019 20051739 Iris Recongition (1)
48/60
end
end
if isfield*handles,Ofigure3O+
if ishandle*handles.figure3.figure)+
close*handles.figure3.figure)+0
end
end
close*gcf+0
F /%ecutes on button press in pushbutton&.
function pushbutton& allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton& *see 7 B +
F eventdata reserved to be defined in a future version of !AT"ABF handles structure with handles and user data *see 7 #9ATA+
fig M ircl9etect0
fig3 handles M guihandles*fig+0
handles.figure3 M fig3 handles0
handles.output M h bject0
guidata*h bject, handles+0
function edit) allbac(*h bject, eventdata, handles+
F h bject handle to edit) *see 7 B +
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*h bject,O8tringO+ returns contents of edit) as te%t
F str2double*get*h bject,O8tringO++ returns contents of edit) as a double
F /%ecutes on button press in pushbutton)).
function pushbutton)) allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton)) *see 7 B +
F eventdata reserved to be defined in a future version of !AT"AB
F handles structure with handles and user data *see 7 #9ATA+
recogni$e
F /%ecutes on button press in pushbutton)2.
T-- ollege of /ngineering >G
-
8/11/2019 20051739 Iris Recongition (1)
49/60
function pushbutton)2 allbac(*h bject, eventdata, handles+
F h bject handle to pushbutton)2 *see 7 B +
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 im2bw t*handles.8+0
B; M bandtrace*B;+0
tic0
M 6oughcircle*B;+0
8T M fnd st *B;+0
prompt M `O/nter file nameIO 0
dlg title M O#nput for -adii e%portO0
num lines M )0def M `O9avidO 0
answer M inputdlg*prompt,dlg title,num lines,def+0
saveradii*answer`) , ,8T+0
F /%ecutes during object creation, after setting all properties.
function a%es3 reate5cn*h bject, eventdata, handles+
F h bject handle to a%es3 *see 7 B +
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,B9YM bandtrace*B;+
B9 M XY0
B;T tm M B;0
B9imMrepmat*logical*uintG*'++,si$e*B;,)+,si$e*B;,2++0
while sum*sum*B;T tm++ ]M '
XB9 tm,B;T tmY M bandtrace*B;T tm+0
if length*B9+ [ length*B9 tm+
B9 M B9 tm0
end
T-- ollege of /ngineering >J
-
8/11/2019 20051739 Iris Recongition (1)
50/60
end
for i M ) I length*B9+
B9im*B9*i,)+,B9*i,2++ M )0
/nd
function X Y M /locate*B;, enter,-+
M XY0
C M '0
totle M sum*sum*B;++0
delta r M X)Imin*si$e*B;++Y0
delta r M min*si$e*B;++.1delta rNdelta r0
delta r M find*delta r MM min*delta r++0
try -min M -*)+0
catch
-min M )0
end
try
-ma% M -*2+0
catch
-ma% M si$e*B;,)+0
end
for i M ) I si$e* enter,2+
%c M enter*),i+0
yc M enter*2,i+0
r M -minNdelta r120
while *ycNr delta r [M si$e*B;,)++ \ *%cNr delta r [M si$e*B;,2++ FL )
Ct M cir quad*B;,%c,yc,r,delta r+0
if C [ Ct
C M Ct0
M X%c,yc,rY0
T-- ollege of /ngineering &'
-
8/11/2019 20051739 Iris Recongition (1)
51/60
if C ZM '.&4totle
brea(0
end
end
r M r N delta r0
end
end
C M '0
for r M *3+ delta r12 I *3+Ndelta r12
Ct M cir quad*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 output coord M plot circle* ,E,-adius,varargin+
output M XY0
outputE M XY0
temp mod M )0
cal mode M OangleO0 Fdefault
intervals M a 0
T-- ollege of /ngineering &)
-
8/11/2019 20051739 Iris Recongition (1)
52/60
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F hec( optional inputs
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
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 )+...
+
cal mode M varargin`a 0
end
elseif isfinite*varargin`a + MM )
intervals M varargin`a 0
else
error*O#nvalid argumentsO+0
end
end
end
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F #nitiali$ation of OintervalO
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
if strcmp*cal mode,OintervalO+ MM )
T-- ollege of /ngineering &2
-
8/11/2019 20051739 Iris Recongition (1)
53/60
F 8atisfies requirement for calculation by the given intervals
if isnan*intervals+ MM )
error*O o interval givenO+0
end
temp mod M mod*intervals,2+0
interval M *intervals temp mod+ 1 20
interval si$e M *-adiusN-adius+1intervals0
value M '0
if temp mod MM )
output M X'Y0
outputE M X-adiusY0
else value M * )12+4interval si$e0
end
cal mode M OintervalO0
end
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F alculate the )st quardrant
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F 444444444444444444444444444444444444444444444444444444444444
F by the angle, scaled by the given radius
F 444444444444444444444444444444444444444444444444444444444444
if strcmp*cal mode,OangleO+ MM )
increment angle M pi4*)1-adius+0
curr angle M pi120
loopM'0
while curr angleZ'
loopMloopN)0
output M Xoutput *I+0sqrt*-adius^2 *-adius4sin*curr angle++^2+Y0
outputE M XoutputE*I+0sqrt*-adius^2 *-adius4cos*curr angle++^2+Y0
T-- ollege of /ngineering &3
-
8/11/2019 20051739 Iris Recongition (1)
54/60
curr angle M curr angle increment angle0
end
output M Xoutput *I+0-adiusY0
outputE M XoutputE*I+0'Y0
elseif strcmp*cal mode,OintervalO+ MM )
F 444444444444444444444444444444444444444444444444444444444444
F by the given % interval
F 444444444444444444444444444444444444444444444444444444444444
value M value N interval si$e0
while value [ -adius
output M Xoutput *I+0value Y0
outputE M XoutputE*I+0sqrt**-adius4-adius+ *value 4value ++Y0 value M value N interval si$e0
end
output M Xoutput *I+0-adiusY0
outputE M XoutputE*I+0'Y0
elseif *strcmp*cal mode,ObresenhamO+ MM )+ L *strcmp*cal mode,Obresenham8olid
)+
M round* +0
E M round*E+0
-adius M round*-adius+0
F 444444444444444444444444444444444444444444444444444444444444
% i M '0
y i M -adius0
theta iM24*) -adius+0
"imit M '0
while y i ZM "imit
F 8et i%el
if *strcmp*cal mode,ObresenhamO+ MM )+
F lot the circumference
T-- ollege of /ngineering &>
-
8/11/2019 20051739 Iris Recongition (1)
55/60
output M Xoutput *I+0% iY0
outputE M XoutputE*I+0y iY0
elseif *strcmp*cal mode,Obresenham8olidO+ MM )+
F reate a solid circle
tempE M X'I)Iy iYO0
temp M tempE0
temp *I+ M % i0
output M Xoutput *I+0temp Y0
outputE M XoutputE*I+0tempEY0
else
error*O#nvalid optionO+0
end F determine if case ) or 2, > or &, or 3
if theta i [ '
delta M 24*theta i N y i+ )0
F determine whether case ) or 2
if delta [M '
F move hori$ontally
% i M % i N )0
theta i M theta i N *24% i+ N )0
else
F move diagonally
% i M % i N )0
y i M y i )0
theta i M theta i N *24*% i y i++ N 20
end
elseif theta i Z '
end
elseif theta i MM '
F move diagonally
T-- ollege of /ngineering &&
-
8/11/2019 20051739 Iris Recongition (1)
56/60
% i M % i N )0
y i M y i )0
theta i M theta i N *24*% i y i++ N 20
end
end
end
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F alculate the 2nd quardrant
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMlength output M length*output +0
if temp mod MM )
F Avoids duplicate coordinates
output M Xoutput *Xlength output I )I2Y+4* )+0output *I+Y0
outputE M XoutputE*Xlength output I )I2Y+0outputE*I+Y0
else
output M Xoutput *Xlength output I )I)Y+4* )+0output *I+Y0
outputE M XoutputE*Xlength output I )I)Y+0outputE*I+Y0
end
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
F 8hift the circle to the desired center
F
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
output M output N 0
outputE M outputENE0
output coord M Xoutput ,outputEY0
F #f a solid is as(ed for ma(e sure there are no duplicates
if *strcmp*cal mode,Obresenham8olidO+ MM )+
output coord M unique*output coord,OrowsO+0
T-- ollege of /ngineering &?
-
8/11/2019 20051739 Iris Recongition (1)
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 !AT 6/8 ;#T6 T6/ --/ T /-8 O+0
end
end
function saveradii*name, ,8T+
nameMstrrep*name,O O,O O+0
dateMdatestr*now,2J+0
5ile ameMXname O O date O.t%tOY0
fileMfopen*5ile ame,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,O O+0
fprintf*file,OFs nO,O O+0
fclose*file+0
function XTYMt autoset*#+
F#Mimread*Oeye.jpgO+
graycountMimhist*#+0
s$Msi$e*#+0
TM'0
T-- ollege of /ngineering &D
-
8/11/2019 20051739 Iris Recongition (1)
58/60
graycountMfilter*X'.& ' '.&Y,),graycount+0
Ffigure,imhist*#+0
diff cntMdiff*graycount+0
pre ma% M graycount*)+0
for i M 2 I *length*diff cnt+ )+
if *graycount*i+Zgraycount*i )++\*graycount*iN)+[graycount*i++\*diff cnt*i
)+Z'+\*diff cnt*iN)+['+
F
pre ma%Mma%*graycount*i+,pre ma%+0
continue0
end
if *graycount*i+[graycount*i )++\*graycount*iN)+Zgraycount*i++\*diff cnt*i)+['+\*diff cnt*iN)+Z'+\*graycount*i+['.D&4pre ma%+\*pre ma%1*s$*)+4s$*2++Z'.'
'2&+
TMi0
brea(0
end
end
T-- ollege of /ngineering &G
-
8/11/2019 20051739 Iris Recongition (1)
59/60
CONCLUSION
;e have successfully developed a new #ris -ecognition system capable of
comparing two digital eye images. 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/11/2019 20051739 Iris Recongition (1)
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/