-
Notifications
You must be signed in to change notification settings - Fork 3
/
globals.c
289 lines (251 loc) · 8.82 KB
/
globals.c
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
/*******************************************************************************
License:
This software was developed at the National Institute of Standards and
Technology (NIST) by employees of the Federal Government in the course
of their official duties. Pursuant to title 17 Section 105 of the
United States Code, this software is not subject to copyright protection
and is in the public domain. NIST assumes no responsibility whatsoever for
its use by other parties, and makes no guarantees, expressed or implied,
about its quality, reliability, or any other characteristic.
Disclaimer:
This software was developed to promote biometric standards and biometric
technology testing for the Federal Government in accordance with the USA
PATRIOT Act and the Enhanced Border Security and Visa Entry Reform Act.
Specific hardware and software products identified in this software were used
in order to perform the software development. In no case does such
identification imply recommendation or endorsement by the National Institute
of Standards and Technology, nor does it imply that the products and equipment
identified are necessarily the best available for the purpose.
*******************************************************************************/
/***********************************************************************
LIBRARY: LFS - NIST Latent Fingerprint System
FILE: GLOBALS.C
AUTHOR: Michael D. Garris
DATE: 03/16/1999
UPDATED: 10/04/1999 Version 2 by MDG
Contains general global variable definitions required by the
NIST Latent Fingerprint System (LFS).
***********************************************************************/
#include "lfs.h"
/*************************************************************************/
/* GOBAL DECLARATIONS */
/*************************************************************************/
/* Constants (C) for defining 4 DFT frequencies, where */
/* frequency is defined as C*(PI_FACTOR). PI_FACTOR */
/* regulates the period of the function in x, so: */
/* 1 = one period in range X. */
/* 2 = twice the frequency in range X. */
/* 3 = three times the frequency in reange X. */
/* 4 = four times the frequency in ranage X. */
double dft_coefs[NUM_DFT_WAVES] = { 1,2,3,4 };
/* Allocate and initialize a global LFS parameters structure. */
LFSPARMS lfsparms = {
/* Image Controls */
PAD_VALUE,
JOIN_LINE_RADIUS,
/* Map Controls */
IMAP_BLOCKSIZE,
UNUSED_INT, /* windowsize */
UNUSED_INT, /* windowoffset */
NUM_DIRECTIONS,
START_DIR_ANGLE,
RMV_VALID_NBR_MIN,
DIR_STRENGTH_MIN,
DIR_DISTANCE_MAX,
SMTH_VALID_NBR_MIN,
VORT_VALID_NBR_MIN,
HIGHCURV_VORTICITY_MIN,
HIGHCURV_CURVATURE_MIN,
UNUSED_INT, /* min_interpolate_nbrs */
UNUSED_INT, /* percentile_min_max */
UNUSED_INT, /* min_contrast_delta */
/* DFT Controls */
NUM_DFT_WAVES,
POWMAX_MIN,
POWNORM_MIN,
POWMAX_MAX,
FORK_INTERVAL,
FORK_PCT_POWMAX,
FORK_PCT_POWNORM,
/* Binarization Controls */
DIRBIN_GRID_W,
DIRBIN_GRID_H,
ISOBIN_GRID_DIM,
NUM_FILL_HOLES,
/* Minutiae Detection Controls */
MAX_MINUTIA_DELTA,
MAX_HIGH_CURVE_THETA,
HIGH_CURVE_HALF_CONTOUR,
MIN_LOOP_LEN,
MIN_LOOP_ASPECT_DIST,
MIN_LOOP_ASPECT_RATIO,
/* Minutiae Link Controls */
LINK_TABLE_DIM,
MAX_LINK_DIST,
MIN_THETA_DIST,
MAXTRANS,
SCORE_THETA_NORM,
SCORE_DIST_NORM,
SCORE_DIST_WEIGHT,
SCORE_NUMERATOR,
/* False Minutiae Removal Controls */
MAX_RMTEST_DIST,
MAX_HOOK_LEN,
MAX_HALF_LOOP,
TRANS_DIR_PIX,
SMALL_LOOP_LEN,
SIDE_HALF_CONTOUR,
INV_BLOCK_MARGIN,
RM_VALID_NBR_MIN,
UNUSED_INT, /* max_overlap_dist */
UNUSED_INT, /* max_overlap_join_dist */
UNUSED_INT, /* malformation_steps_1 */
UNUSED_INT, /* malformation_steps_2 */
UNUSED_DBL, /* min_malformation_ratio */
UNUSED_INT, /* max_malformation_dist */
PORES_TRANS_R,
PORES_PERP_STEPS,
PORES_STEPS_FWD,
PORES_STEPS_BWD,
PORES_MIN_DIST2,
PORES_MAX_RATIO,
/* Ridge Counting Controls */
MAX_NBRS,
MAX_RIDGE_STEPS
};
/* Allocate and initialize VERSION 2 global LFS parameters structure. */
LFSPARMS lfsparms_V2 = {
/* Image Controls */
PAD_VALUE,
JOIN_LINE_RADIUS,
/* Map Controls */
MAP_BLOCKSIZE_V2,
MAP_WINDOWSIZE_V2,
MAP_WINDOWOFFSET_V2,
NUM_DIRECTIONS,
START_DIR_ANGLE,
RMV_VALID_NBR_MIN,
DIR_STRENGTH_MIN,
DIR_DISTANCE_MAX,
SMTH_VALID_NBR_MIN,
VORT_VALID_NBR_MIN,
HIGHCURV_VORTICITY_MIN,
HIGHCURV_CURVATURE_MIN,
MIN_INTERPOLATE_NBRS,
PERCENTILE_MIN_MAX,
MIN_CONTRAST_DELTA,
/* DFT Controls */
NUM_DFT_WAVES,
POWMAX_MIN,
POWNORM_MIN,
POWMAX_MAX,
FORK_INTERVAL,
FORK_PCT_POWMAX,
FORK_PCT_POWNORM,
/* Binarization Controls */
DIRBIN_GRID_W,
DIRBIN_GRID_H,
UNUSED_INT, /* isobin_grid_dim */
NUM_FILL_HOLES,
/* Minutiae Detection Controls */
MAX_MINUTIA_DELTA,
MAX_HIGH_CURVE_THETA,
HIGH_CURVE_HALF_CONTOUR,
MIN_LOOP_LEN,
MIN_LOOP_ASPECT_DIST,
MIN_LOOP_ASPECT_RATIO,
/* Minutiae Link Controls */
UNUSED_INT, /* link_table_dim */
UNUSED_INT, /* max_link_dist */
UNUSED_INT, /* min_theta_dist */
MAXTRANS, /* used for removing overlaps as well */
UNUSED_DBL, /* score_theta_norm */
UNUSED_DBL, /* score_dist_norm */
UNUSED_DBL, /* score_dist_weight */
UNUSED_DBL, /* score_numerator */
/* False Minutiae Removal Controls */
MAX_RMTEST_DIST_V2,
MAX_HOOK_LEN_V2,
MAX_HALF_LOOP_V2,
TRANS_DIR_PIX_V2,
SMALL_LOOP_LEN,
SIDE_HALF_CONTOUR,
INV_BLOCK_MARGIN_V2,
RM_VALID_NBR_MIN,
MAX_OVERLAP_DIST,
MAX_OVERLAP_JOIN_DIST,
MALFORMATION_STEPS_1,
MALFORMATION_STEPS_2,
MIN_MALFORMATION_RATIO,
MAX_MALFORMATION_DIST,
PORES_TRANS_R,
PORES_PERP_STEPS,
PORES_STEPS_FWD,
PORES_STEPS_BWD,
PORES_MIN_DIST2,
PORES_MAX_RATIO,
/* Ridge Counting Controls */
MAX_NBRS,
MAX_RIDGE_STEPS
};
/* Variables for conducting 8-connected neighbor analyses. */
/* Pixel neighbor offsets: 0 1 2 3 4 5 6 7 */ /* 7 0 1 */
int nbr8_dx[] = { 0, 1, 1, 1, 0,-1,-1,-1 }; /* 6 C 2 */
int nbr8_dy[] = { -1,-1, 0, 1, 1, 1, 0,-1 }; /* 5 4 3 */
/* The chain code lookup matrix for 8-connected neighbors. */
/* Should put this in globals. */
int chaincodes_nbr8[]={ 3, 2, 1,
4,-1, 0,
5, 6, 7};
/* Global array of feature pixel pairs. */
FEATURE_PATTERN feature_patterns[]=
{{RIDGE_ENDING, /* a. Ridge Ending (appearing) */
APPEARING,
{0,0},
{0,1},
{0,0}},
{RIDGE_ENDING, /* b. Ridge Ending (disappearing) */
DISAPPEARING,
{0,0},
{1,0},
{0,0}},
{BIFURCATION, /* c. Bifurcation (disappearing) */
DISAPPEARING,
{1,1},
{0,1},
{1,1}},
{BIFURCATION, /* d. Bifurcation (appearing) */
APPEARING,
{1,1},
{1,0},
{1,1}},
{BIFURCATION, /* e. Bifurcation (disappearing) */
DISAPPEARING,
{1,0},
{0,1},
{1,1}},
{BIFURCATION, /* f. Bifurcation (disappearing) */
DISAPPEARING,
{1,1},
{0,1},
{1,0}},
{BIFURCATION, /* g. Bifurcation (appearing) */
APPEARING,
{1,1},
{1,0},
{0,1}},
{BIFURCATION, /* h. Bifurcation (appearing) */
APPEARING,
{0,1},
{1,0},
{1,1}},
{BIFURCATION, /* i. Bifurcation (disappearing) */
DISAPPEARING,
{1,0},
{0,1},
{1,0}},
{BIFURCATION, /* j. Bifurcation (appearing) */
APPEARING,
{0,1},
{1,0},
{0,1}}};