GCC Code Coverage Report


Directory: ./
File: libfprint/nbis/bozorth3/bz_drvrs.c
Date: 2024-05-04 14:54:39
Exec Total Coverage
Lines: 28 30 93.3%
Functions: 3 3 100.0%
Branches: 2 4 50.0%

Line Branch Exec Source
1 /*******************************************************************************
2
3 License:
4 This software and/or related materials was developed at the National Institute
5 of Standards and Technology (NIST) by employees of the Federal Government
6 in the course of their official duties. Pursuant to title 17 Section 105
7 of the United States Code, this software is not subject to copyright
8 protection and is in the public domain.
9
10 This software and/or related materials have been determined to be not subject
11 to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 a publicly available technology and software, and is freely distributed
13 to any interested party with no licensing requirements. Therefore, it is
14 permissible to distribute this software as a free download from the internet.
15
16 Disclaimer:
17 This software and/or related materials was developed to promote biometric
18 standards and biometric technology testing for the Federal Government
19 in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 and Visa Entry Reform Act. Specific hardware and software products identified
21 in this software were used in order to perform the software development.
22 In no case does such identification imply recommendation or endorsement
23 by the National Institute of Standards and Technology, nor does it imply that
24 the products and equipment identified are necessarily the best available
25 for the purpose.
26
27 This software and/or related materials are provided "AS-IS" without warranty
28 of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 licensed product, however used. In no event shall NIST be liable for any
32 damages and/or costs, including but not limited to incidental or consequential
33 damages of any kind, including economic damage or injury to property and lost
34 profits, regardless of whether NIST shall be advised, have reason to know,
35 or in fact shall know of the possibility.
36
37 By using this software, you agree to bear all risk relating to quality,
38 use and performance of the software and/or related materials. You agree
39 to hold the Government harmless from any claim arising from your use
40 of the software.
41
42 *******************************************************************************/
43
44 /***********************************************************************
45 LIBRARY: FING - NIST Fingerprint Systems Utilities
46
47 FILE: BZ_DRVRS.C
48 ALGORITHM: Allan S. Bozorth (FBI)
49 MODIFICATIONS: Michael D. Garris (NIST)
50 Stan Janet (NIST)
51 DATE: 09/21/2004
52
53 Contains driver routines responsible for kicking off matches
54 using the Bozorth3 fingerprint matching algorithm.
55
56 ***********************************************************************
57
58 ROUTINES:
59 #cat: bozorth_probe_init - creates the pairwise minutia comparison
60 #cat: table for the probe fingerprint
61 #cat: bozorth_gallery_init - creates the pairwise minutia comparison
62 #cat: table for the gallery fingerprint
63 #cat: bozorth_to_gallery - supports the matching scenario where the
64 #cat: same probe fingerprint is matches repeatedly
65 #cat: to multiple gallery fingerprints as in
66 #cat: identification mode
67 #cat: bozorth_main - supports the matching scenario where a
68 #cat: single probe fingerprint is to be matched
69 #cat: to a single gallery fingerprint as in
70 #cat: verificaiton mode
71
72 ***********************************************************************/
73
74 #include <stdio.h>
75 #include <stdlib.h>
76 #include <string.h>
77 #include <bozorth.h>
78
79 /**************************************************************************/
80
81 9 int bozorth_probe_init( struct xyt_struct * pstruct )
82 {
83 9 int sim; /* number of pointwise comparisons for Subject's record*/
84 9 int msim; /* Pruned length of Subject's comparison pointer list */
85
86
87
88 /* Take Subject's points and compute pointwise comparison statistics table and sorted row-pointer list. */
89 /* This builds a "Web" of relative edge statistics between points. */
90 9 bz_comp(
91 pstruct->nrows,
92 9 pstruct->xcol,
93 9 pstruct->ycol,
94 9 pstruct->thetacol,
95 &sim,
96 scols,
97 scolpt );
98
99 9 msim = sim; /* Init search to end of Subject's pointwise comparison table (last edge in Web) */
100
101
102
103 9 bz_find( &msim, scolpt );
104
105
106
107
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
9 if ( msim < FDD ) /* Makes sure there are a reasonable number of edges (at least 500, if possible) to analyze in the Web */
108 msim = ( sim > FDD ) ? FDD : sim;
109
110
111
112
113
114 9 return msim;
115 }
116
117 /**************************************************************************/
118
119 26 int bozorth_gallery_init( struct xyt_struct * gstruct )
120 {
121 26 int fim; /* number of pointwise comparisons for On-File record*/
122 26 int mfim; /* Pruned length of On-File Record's pointer list */
123
124
125 /* Take On-File Record's points and compute pointwise comparison statistics table and sorted row-pointer list. */
126 /* This builds a "Web" of relative edge statistics between points. */
127 26 bz_comp(
128 gstruct->nrows,
129 26 gstruct->xcol,
130 26 gstruct->ycol,
131 26 gstruct->thetacol,
132 &fim,
133 fcols,
134 fcolpt );
135
136 26 mfim = fim; /* Init search to end of On-File Record's pointwise comparison table (last edge in Web) */
137
138
139
140 26 bz_find( &mfim, fcolpt );
141
142
143
144
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 26 times.
26 if ( mfim < FDD ) /* Makes sure there are a reasonable number of edges (at least 500, if possible) to analyze in the Web */
145 mfim = ( fim > FDD ) ? FDD : fim;
146
147
148
149
150
151 26 return mfim;
152 }
153
154 /**************************************************************************/
155
156 26 int bozorth_to_gallery(
157 int probe_len,
158 struct xyt_struct * pstruct,
159 struct xyt_struct * gstruct
160 )
161 {
162 26 int np;
163 26 int gallery_len;
164
165 26 gallery_len = bozorth_gallery_init( gstruct );
166 26 np = bz_match( probe_len, gallery_len );
167 26 return bz_match_score( np, pstruct, gstruct );
168 }
169
170 /**************************************************************************/
171
172