-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbe_finger_an2kview_capture.h
263 lines (240 loc) · 6.59 KB
/
be_finger_an2kview_capture.h
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
/*
* 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.
*/
#ifndef __BE_FINGER_AN2KVIEW_CAPTURE_H__
#define __BE_FINGER_AN2KVIEW_CAPTURE_H__
#include <be_view_an2kview_varres.h>
#include <be_framework_enumeration.h>
namespace BiometricEvaluation
{
namespace Finger
{
/**
* @brief
* Represents an ANSI/NIST variable-resolution finger image.
* @details
* If the complete ANSI/NIST record contains a corresponding
* Type-9 (finger minutiae) record, an object of this class
* can be used to retrieve the minutiae set(s).
*/
class AN2KViewCapture : public View::AN2KViewVariableResolution {
public:
/**
* @brief
* Enumeration of the finger amuptated or bandaged
* code, a reason that a capture could not be made.
*/
enum class AmputatedBandaged
{
/** Amputation */
Amputated,
/** Unable to print (e.g., bandaged) */
Bandaged,
/** Optional field -- not specified */
NA
};
/**
* @brief
* Locations of an individual finger segment in a slap.
*/
struct FingerSegmentPosition {
/**
* @brief
* Create an FingerSegmentPosition struct.
*
* @param fingerPosition
* Finger depicted in this segment.
* @param coordinates
* Collection of coordinates that compose
* the segment bonding polygon.
*/
FingerSegmentPosition(
const Finger::Position fingerPosition,
const Image::CoordinateSet coordinates);
/** Finger depicted in this segment */
Finger::Position fingerPosition;
/** Points composing the segmented polygon */
Image::CoordinateSet coordinates;
};
using FingerSegmentPosition =
struct FingerSegmentPosition;
using FingerSegmentPositionSet =
std::vector<FingerSegmentPosition>;
/**
* @brief
* Construct an AN2K finger view from a file.
* @details
* The file must contain the entire AN2K record, not
* just the finger image and/or minutiae records.
* The object is constructed based on the nth variable
* resolution record found.
*
* @param[in] filename
* The name of the file containing the complete
* ANSI/NIST record.
* @param[in] recordNumber
* The number of variable resolution record to
* read from the complete AN2K record.
* @throw Error::ParameterError
* @throw Error::DataError
* @throw Error::FileError
* An error occurred when opening or reading
* the file.
*
*/
AN2KViewCapture(
const std::string &filename,
const uint32_t recordNumber);
/**
* @brief
* Construct an AN2K finger view using from a memory
* buffer.
* @details
* The buffer must contain the entire AN2K record, not
* just the finger image and/or minutiae records.
*/
AN2KViewCapture(
Memory::uint8Array &buf,
const uint32_t recordNumber);
/**
* @brief
* Extract the NQM information from an AN2K FIELD.
*
* @param field
* FIELD containing properly formatted NQM
* data
*
* @return
* QualityMetricSet representation of field.
*
* @throw Error::DataError
* Invalid format of field for NQM.
*/
QualityMetricSet
extractNISTQuality(
const FIELD *field);
/**
* @brief
* Obtain the finger position.
* @details
* An AN2K finger image record contains a single
* finger positions. Any minutiae record (Type-9)
* associated with this image will have its own set of
* positions.
*/
Finger::Position getPosition() const;
/**
* @brief
* Return search position descriptors.
*/
PositionDescriptors
getPrintPositionDescriptors()
const;
/**
* @brief
* Obtain print position coordinates
*
* @return
* Set of all PrintPositionCoordinates
*/
PrintPositionCoordinateSet
getPrintPositionCoordinates()
const;
/**
* @brief
* Obtain the NIST quality metric for all segmented
* finger images.
*
* @return
* QualityMetricSet containing the NIST quality
* metric for all segmented finger images.
*
* @details
* Vendor ID and Product Code are undefined, as
* they are unused by NQM.
*/
QualityMetricSet
getNISTQualityMetric()
const;
/**
* @brief
* Obtain the segmentation quality metric for all
* segmented finger images.
*
* @return
* QualityMetricSet containing the segmentation
* quality metric for all segmented finger images.
*/
QualityMetricSet
getSegmentationQualityMetric()
const;
/**
* @return
* Optional amputated or bandaged code.
*/
AmputatedBandaged
getAmputatedBandaged()
const;
/**
* @return
* Optional set of rectangular finger segment
* positions for all finger segments.
*/
FingerSegmentPositionSet
getFingerSegmentPositionSet()
const;
/**
* @return
* Optional set of polygonal finger segment
* positions for all finger segments.
*/
FingerSegmentPositionSet
getAlternateFingerSegmentPositionSet()
const;
/**
* @brief
* Obtain metrics for fingerprint image quality score
* data for the image stored in this record.
*
* @return
* Fingerprint quality metrics
*/
QualityMetricSet
getFingerprintQualityMetric()
const;
protected:
private:
/** Alternate finger segment position(s) */
FingerSegmentPositionSet _afsps;
/** Amputated or bandaged code */
AmputatedBandaged _amp;
/** Device monitoring mode */
DeviceMonitoringMode _dmm;
/** Finger segment position(s) */
FingerSegmentPositionSet _fsps;
/** NIST quality metric */
QualityMetricSet _nqm;
/** Segmentation quality metric */
QualityMetricSet _sqm;
void readImageRecord();
};
/**
* @brief
* Output stream overload for FingerSegmentPosition.
*/
std::ostream&
operator<<(
std::ostream &stream,
const AN2KViewCapture::FingerSegmentPosition &fsp);
}
}
BE_FRAMEWORK_ENUMERATION_DECLARATIONS(
BiometricEvaluation::Finger::AN2KViewCapture::AmputatedBandaged,
BE_Finger_AN2KViewCapture_AmputatedBandaged_EnumToStringMap);
#endif /* __BE_FINGER_AN2KVIEW_CAPTURE_H__ */