-
Notifications
You must be signed in to change notification settings - Fork 7
/
RubbersheetModel.m
71 lines (57 loc) · 1.96 KB
/
RubbersheetModel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
%% Simple Usage - - - - - - - - - - - - - - - - - -
% Load the image
img = imread('example.jpg');
% Input parameters
xPosPupil = 625;
yPosPupil = 306;
rPupil = 70;
xPosIris = 625;
yPosIris = 306;
rIris = 250;
% Normalize the iris region according to daugmans model
irisRegion = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris, 'DebugMode', 1 );
% Show Resulting image
figure(2);
imshow(irisRegion);
%% Control Radial and Angular Samples - - - - - - - - - - - - - - - - - -
% The following example show you how to define the number of samples in
% angular and radial direction. Note that the number of the radial and
% angular samples is unusable low, but good to demonstrate the parameters.
% Load the image
img = imread('example.jpg');
% Input parameters
xPosPupil = 625;
yPosPupil = 306;
rPupil = 70;
xPosIris = 625;
yPosIris = 306;
rIris = 250;
% Normalize the iris region according to daugmans model and defining the
% number of samples in radial and angular direction
irisRegion = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris, ...
'DebugMode', 1,'RadiusSamples', 5,'AngleSamples', 10 ...
);
% Show Resulting image
figure(2);
imshow(irisRegion);
%% Turn Interpolation off - - - - - - - - - - - - - - - - - -
% By default the samples are interpolated, however it is also possible to
% use neirest neighbor interpolation (no interpolation). This speeds up
% the computation, but is less preciese.
% Load the image
img = imread('example.jpg');
% Input parameters
xPosPupil = 625;
yPosPupil = 306;
rPupil = 70;
xPosIris = 625;
yPosIris = 306;
rIris = 250;
% Normalize the iris region according to daugmans model and defining the
% number of samples in radial and angular direction
irisRegion = rubberSheetNormalisation( img, xPosPupil, yPosPupil, rPupil , xPosIris , yPosIris , rIris, ...
'DebugMode', 0,'UseInterpolation', 0 ...
);
% Show Resulting image
figure(2);
imshow(irisRegion);