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