-
Notifications
You must be signed in to change notification settings - Fork 3
/
mindtct.c
72 lines (62 loc) · 1.71 KB
/
mindtct.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
#include <stdio.h>
#include <an2k.h>
#include <lfs.h>
#include <imgdecod.h>
#include <img_io.h>
#include <version.h>
int debug = 0;
int
extract_xyt (char *image_file, char *minutiae_file)
{
unsigned char *idata, *bdata;
int img_type;
int ilen, iw, ih, id, ippi, bw, bh, bd;
double ippmm;
int img_idc, img_imp;
int *direction_map, *low_contrast_map, *low_flow_map;
int *high_curve_map, *quality_map;
int map_w, map_h;
int ret;
MINUTIAE *minutiae;
/* Read the image data from file into memory */
if ((ret = read_and_decode_grayscale_image (image_file, &img_type,
&idata, &ilen, &iw, &ih, &id,
&ippi)))
{
return ret;
}
/* If image ppi not defined, then assume 500 */
if (ippi == UNDEFINED)
ippmm = DEFAULT_PPI / (double) MM_PER_INCH;
else
ippmm = ippi / (double) MM_PER_INCH;
/* 3. GET MINUTIAE & BINARIZED IMAGE. */
if ((ret = get_minutiae (&minutiae, &quality_map, &direction_map,
&low_contrast_map, &low_flow_map, &high_curve_map,
&map_w, &map_h, &bdata, &bw, &bh, &bd,
idata, iw, ih, id, ippmm, &lfsparms_V2)))
{
free (idata);
return ret;
}
/* Done with input image data */
free (idata);
/* Done with minutiae detection maps. */
free (quality_map);
free (direction_map);
free (low_contrast_map);
free (low_flow_map);
free (high_curve_map);
/* Done with binary image results */
free (bdata);
/* 4. WRITE MINUTIAE & MAP RESULTS TO TEXT FILES */
if ((ret = write_minutiae_XYTQ (minutiae_file, NIST_INTERNAL_XYT_REP,
minutiae, map_w, map_h)))
{
free_minutiae (minutiae);
return ret;
}
/* Done with minutiae and binary image results */
free_minutiae (minutiae);
return 0;
}