Tech5 Client Edition SDK 2.7.0
coreSdk.h
1/*****************************************************************************
2 coreSdk.h - the common header file for all components of Core Matching SDKs
3
4 The Core Matching SDKs is the high-level tools, intended for easy creating
5 of your own scalable biometric applications that use the person's fingerprint for
6 identification or verification purpose.
7
8*******************************************************************************/
9
10#ifndef CORE_SDK_H__
11#define CORE_SDK_H__
12
13
14#ifdef __cplusplus
15 #include <set>
16 #include <string>
17#include <functional>
18 using namespace std;
19#endif
20
21#include "assert.h"
22
23#include "common.h"
24
25
26#ifdef __cplusplus
27 extern "C"{
28#endif
29
30
31/******************************************************************
32 THE CONSTANRS
33*****************************************************************/
34#pragma pack(push, _CORE_PACKING)
35
39ENUM_DECLARATION MATCHING_MODE
40{
42 NORMAL_MATCHING_MODE = 0,
45 CHECK_MIX_FINGER_MATCHING_MODE = 1,
47 CHECK_MIX_SLAP_MATCHING_MODE = 2,
49 CHECK_MIX_HAND_MATCHING_MODE = 3,
50};
51
56ENUM_DECLARATION FUSION_MODE
57{
59 OPTIMAL_FUSION_MODE = 0,
63 LOW_BINNING_FUSION_MODE = 1,
65 HIGH_BINNING_FUSION_MODE = 2,
66};
67
72ENUM_DECLARATION SINGULAR_TYPE
73{
75 WHORL = 1,
77 LOOP = 2,
79 DELTA = 8
80};
81
82
87ENUM_DECLARATION PATTERN_TYPE
88{
90 ARCHSC = 0x01,
92 ARCHSU = 0x02,
94 LOOPRC = 0x04,
96 LOOPRU = 0x08,
98 LOOPLC = 0x10,
100 LOOPLU = 0x20,
102 WHORLC = 0x40,
104 WHORLU = 0x80
105};
106
111ENUM_DECLARATION FP_TYPE
112{
114 UNKNOWN = 0,
116 ROLLED = 1,
118 FLAT = 2,
119 // latent
120 LATENT = 3,
121};
122
123
124#define MAX_PROTECT_LEN 512 // maximum lenght of protect buffer
125
126#define MAX_SINGULAR 16 // maximum number of singularity
127
128#define MIN_RESOLUTION 250 // minimum supported image resolution
129#define MAX_RESOLUTION 1000 // maximum supported image resolution
130// if source image dpi is different from 500 dpi more than DPI_TOL then image will be stretched
131// before image processing
132#define DPI_TOL 5
133
134
135#define MAX_SENSOR_NAME 50 // maximum length of sensor name
136#define MAX_SENSORS 50 // maximum number of supported sensors
137#define ENDLESSLY -1 // the special value for unlimited timeout
138
139#define MIN_REL_POINTS 32 // minimum number of reliable points
140#define MAX_SCORE 10000 // maximum value for score
141
142// default parameters
143#define SEARCH_SPEED_DEF LOWEST_MATCH_SPEED
144#define MAX_ANGLE_DEF 180
145#define MAX_DISP_DEF 400
146#define LOW_THRESHOLD_DEF 0
147#define HIGH_THRESHOLD_DEF MAX_SCORE
148#define MIN_MATCH_DEF 1
149#define MAX_MATCH_DEF 10
150
151#define DEF_MAX_FRAMES 8
152
153
154
155
156
162{
166 uint8_t *fpTemplate;
167
168#ifdef __cplusplus
170 {
171 numFinger = FINGERS::FINGPOS_UK;
172 fpTemplate = 0;
173 }
174#endif
175};
176
182{
186 uint8_t *dib;
187
188};
189
190#pragma pack (push, _CORE_TIGHT)
195struct P_PACKED_1 TemplHeader
196{
198 uint32_t size;
200 int8_t specialFields[7];
202 uint16_t points;
204 uint8_t relPoints;
206 uint8_t quality;
208 uint8_t reserved[5];
210 uint8_t version;
211#ifdef __cplusplus
213 {
214 memset (this, 0, sizeof(TemplHeader));
215 }
216#endif
217};
218
219
224struct P_PACKED_1 Frame
225{
227 int32_t left;
229 int32_t right;
231 int32_t top;
233 int32_t bottom;
234
235#ifdef __cplusplus
236 Frame()
237 {
238 left = right = top = bottom = 0;
239 }
240
241 Frame& operator= (Frame &frame)
242 {
243 left = frame.left;
244 right = frame.right;
245 top = frame.top;
246 bottom = frame.bottom;
247 return *this;
248 }
249
250 Frame(const Frame& frame)
251 {
252 this->left = frame.left;
253 this->right = frame.right;
254 this->top = frame.top;
255 this->bottom = frame.bottom;
256 }
257#endif
258};
259#pragma pack (pop)
260
266#ifdef __cplusplus
267struct Singular : public ::Feature
268{
271};
272#else
274{
276 int32_t x;
278 int32_t y;
280 uint8_t prob;
282 int32_t angle;
284 uint8_t density;
287};
288#endif
289
293ENUM_DECLARATION Sex
294{
296 SEX_X = 0,
298 SEX_M = 1,
300 SEX_F = 2,
302 SEX_G = 3,
304 SEX_N = 4,
306 SEX_Y = 5,
308 SEX_Z = 6,
309};
310
311
317{
321 uint32_t maxAngle;
323 uint32_t maxAngleThumbs;
325 uint32_t maxDisp;
342 uint32_t minMatch;
344 uint32_t maxMatch;
349
350#ifdef __cplusplus
352 {
353 searchSpeed = MATCH_SPEED::SEARCH_SPEED_DEF;
354 maxAngle = MAX_ANGLE_DEF;
355 maxAngleThumbs = MAX_ANGLE_DEF;
356 maxDisp = MAX_DISP_DEF;
357 lowThreshold = LOW_THRESHOLD_DEF;
358 highThreshold = HIGH_THRESHOLD_DEF;
359 minMatch = MIN_MATCH_DEF;
360 maxMatch = MAX_MATCH_DEF;
361 matchingMode = MATCHING_MODE::NORMAL_MATCHING_MODE;
362 fusionMode = FUSION_MODE::OPTIMAL_FUSION_MODE;
363 }
364#endif
365};
366
367
373{
397 uint32_t maxWidth;
400 uint32_t maxHeight;
403
404#ifdef __cplusplus
406 {
407 doSegmentation = true;
408 allowsIncreaseFrame = true;
409 isLatent = false;
410 ISO_compatible = false;
411 maxWidth = MAX_WIDTH;
412 maxHeight = MAX_HEIGHT;
413 }
414
415 ProcessParam& operator= (ProcessParam &param)
416 {
417 memcpy(this, &param, sizeof(ProcessParam));
418 return *this;
419 }
420
421 ProcessParam(const ProcessParam& param)
422 {
423 this->doSegmentation = param.doSegmentation;
424 this->allowsIncreaseFrame = param.allowsIncreaseFrame;
425 this->isLatent = param.isLatent;
426 this->ISO_compatible = param.ISO_compatible;
427 this->maxWidth = param.maxWidth;
428 this->maxHeight = param.maxHeight;
429 }
430#endif
431};
432
438{
440 int32_t fusionScore;
442 int32_t score[10];
447 int8_t galleryPair[10];
449 uint32_t numMatched;
450
451#ifdef __cplusplus
453 {
454 clear();
455 }
456 void clear()
457 {
458 fusionScore = 0;
459 numMatched = 0;
460 clearScore();
461 }
462 void clearScore()
463 {
464 for(int32_t pos = 0; pos < 10; pos++)
465 {
466 score [pos] = 0;
467 galleryPair[pos] = -1;
468 }
469 }
470#endif
471};
472
473ENUM_DECLARATION PalmPart
474{
475 UNKNOWN_PALM = 0,
476 RIGHT_LOWER_PALM = 1 ,
477 RIGHT_UPPER_PALM = 2 ,
478 RIGHT_WRITER_PALM = 3 ,
479 RIGHT_THENAR_PALM = 4 ,
480 RIGHT_HYPOTHENAR_PALM = 5 ,
481 RIGHT_INTERDIGITAL_PALM = 6 ,
482 LEFT_LOWER_PALM = 7 ,
483 LEFT_UPPER_PALM = 8 ,
484 LEFT_WRITER_PALM = 9 ,
485 LEFT_THENAR_PALM = 10 ,
486 LEFT_HYPOTHENAR_PALM = 11,
487 LEFT_INTERDIGITAL_PALM = 12
488};
489static const uint32_t NUM_PALM_PARTS = 12;
490
491static const int8_t* getPalmPartName(int32_t palmPartPos)
492{
493 switch (palmPartPos)
494 {
495 case 0:
496 return (int8_t*)"unknown palm";
497 break;
498 case 1:
499 return (int8_t*)"right lower palm";
500 break;
501 case 2:
502 return (int8_t*)"right upper palm";
503 break;
504 case 3:
505 return (int8_t*)"right writer's palm";
506 break;
507 case 4:
508 return (int8_t*)"right thenar palm";
509 break;
510 case 5:
511 return (int8_t*)"right hypothenar palm";
512 break;
513 case 6:
514 return (int8_t*)"right interdigital palm";
515 break;
516 case 7:
517 return (int8_t*)"left lower palm";
518 break;
519 case 8:
520 return (int8_t*)"left upper palm";
521 break;
522 case 9:
523 return (int8_t*)"left writer's palm";
524 break;
525 case 10:
526 return (int8_t*)"left thenar palm";
527 break;
528 case 11:
529 return (int8_t*)"left hypothenar palm";
530 break;
531 case 12:
532 return (int8_t*)"left interdigital palm";
533 break;
534 default:
535 assert(false);
536 }
537 return 0;
538}
539
540static const int8_t* getFingerName(enum FINGERS fingerPos)
541{
542 switch (fingerPos)
543 {
544#ifdef __cplusplus
545 case FINGERS::FINGPOS_RT :
546 return (int8_t*)"right thumb";
547 break;
548 case FINGERS::FINGPOS_RI :
549 return (int8_t*)"right index";
550 break;
551 case FINGERS::FINGPOS_RM :
552 return (int8_t*)"right middle";
553 break;
554 case FINGERS::FINGPOS_RR :
555 return (int8_t*)"right ring";
556 break;
557 case FINGERS::FINGPOS_RL :
558 return (int8_t*)"right lettle";
559 break;
560 case FINGERS::FINGPOS_LT :
561 return (int8_t*)"left thumb";
562 break;
563 case FINGERS::FINGPOS_LI :
564 return (int8_t*)"left index";
565 break;
566 case FINGERS::FINGPOS_LM :
567 return (int8_t*)"left middle";
568 break;
569 case FINGERS::FINGPOS_LR :
570 return (int8_t*)"left ring";
571 break;
572 case FINGERS::FINGPOS_LL :
573 return (int8_t*)"left lettle";
574 break;
575#else
576 case FINGPOS_RT :
577 return (int8_t*)"right thumb";
578 break;
579 case FINGPOS_RI :
580 return (int8_t*)"right index";
581 break;
582 case FINGPOS_RM :
583 return (int8_t*)"right middle";
584 break;
585 case FINGPOS_RR :
586 return (int8_t*)"right ring";
587 break;
588 case FINGPOS_RL :
589 return (int8_t*)"right lettle";
590 break;
591 case FINGPOS_LT :
592 return (int8_t*)"left thumb";
593 break;
594 case FINGPOS_LI :
595 return (int8_t*)"left index";
596 break;
597 case FINGPOS_LM :
598 return (int8_t*)"left middle";
599 break;
600 case FINGPOS_LR :
601 return (int8_t*)"left ring";
602 break;
603 case FINGPOS_LL :
604 return (int8_t*)"left lettle";
605 break;
606#endif
607 default:
608 assert(false);
609 }
610 return 0;
611}
612
613
619{
621 uint8_t *m_templ[20];
622
623#ifdef __cplusplus
624 TpTemplate()
625 {
626 memset(this, 0, sizeof(TpTemplate));
627 }
628 TpTemplate& operator= (const TpTemplate& tp)
629 {
630 for(uint32_t i = 0; i < 20; i++)
631 this->m_templ[i] = tp.m_templ[i];
632 return *this;
633 }
634 TpTemplate(const TpTemplate& tp)
635 {
636 *this = tp;
637 }
638 void clear()
639 {
640 for(uint32_t i = 0; i < 20; i++)
641 m_templ[i] = NULL;
642 }
643#endif
644};
645
650struct RL
651{
653 uint64_t regNum;
655 int32_t finger;
657 int32_t score;
658};
659
660#ifdef __cplusplus
665struct RLex : public RL
666{
667 RLex()
668 {
669 this->regNum = 0;
670 this->finger = 0;
671 this->score = 0;
672 }
673 RLex(int64_t regNum, int32_t finger, int32_t score)
674 {
675 this->regNum = regNum;
676 this->finger = finger;
677 this->score = score ;
678 }
679 bool operator< (const RLex &rl) const
680 {
681 return this->score < rl.score;
682 }
683 operator int32_t () const
684 {
685 return this->score;
686 }
687};
688typedef std::multiset <RLex, std::greater<int32_t> > RL_SET;
689
690
691struct Base_GalleryItem
692{
693 std::string m_id;
694 Base_GalleryItem()
695 {
696 }
697 Base_GalleryItem(std::string id)
698 {
699 m_id = id;
700 }
701 ~Base_GalleryItem() { }
702 Base_GalleryItem& operator= (const Base_GalleryItem& item)
703 {
704 m_id = item.m_id;
705 return *this;
706 }
707 Base_GalleryItem(const Base_GalleryItem& item)
708 {
709 *this = item;
710 }
711};
712
713/******************************************************************
714 FUNCTION TYPEDEF
715******************************************************************/
726typedef bool (*ON_PRE_PROCESS)(const LPVOID pContext, FINGERS finger, ::Frame &frame);
727
738typedef bool (*ON_GET_QUALITY)(const LPVOID pContext, FINGERS finger, int quality);
739
753typedef bool (*ON_PROCESS_1)(
754 const LPVOID pContext,
755 FINGERS finger,
756 unsigned int pattern,
757 unsigned int numSingularity,
758 const Singular singular[MAX_SINGULAR]);
759
773typedef bool (*ON_SKELETON)(const LPVOID pContext, FINGERS finger, uint8_t *skeleton, int skeletonSize);
774
775
776#endif //#ifdef __cplusplus
777
778#pragma pack(pop)
779#ifdef __cplusplus
780 } // extern "C"{
781#endif
782
783#endif // CORE_SDK_H__
784
785
786
FINGERSFinger position enumeration.
FP_TYPEFingerprint types enumeration.
FUSION_MODEenumeration for different modes of calculating fusion score.
MATCH_SPEEDMatching speed constants enumeration.
MATCHING_MODE.
PATTERN_TYPEFignerprint pattern type enumeration.
SINGULAR_TYPESingural types enumeration.
CaptureDatastructure keeps information about image for image processing functions.
Definition: coreSdk.h:182
uint8_t * dib
pointer to the buffer that contains the device independent bitmap (DIB)
Definition: coreSdk.h:186
enum FINGERS numFinger
finger number
Definition: coreSdk.h:184
Featurestructure keeps information about position any features (minutiae and singularity) NOTE: all c...
Definition: common.h:501
Framestructure keeps information about how image was segmented.
Definition: coreSdk.h:225
int32_t left
left coordinates of segmented rectangle
Definition: coreSdk.h:227
int32_t top
top coordinates of segmented rectangle
Definition: coreSdk.h:231
int32_t bottom
bottom coordinates of segmented rectangle
Definition: coreSdk.h:233
int32_t right
right coordinates of segmented rectangle
Definition: coreSdk.h:229
MatchResultTTkeeps information about TP-TP (tenprint to tenprint) matching results.
Definition: coreSdk.h:438
uint32_t numMatched
number of really matched finger pairs
Definition: coreSdk.h:449
int8_t galleryPair[10]
Definition: coreSdk.h:447
int32_t score[10]
score for each probe finger (if it was matched) in a range 0...MAX_SCORE
Definition: coreSdk.h:442
int32_t fusionScore
TP-TP fusion score in a range 0...MAX_SCORE.
Definition: coreSdk.h:440
ProcessParamdefine information about image processing parameters.
Definition: coreSdk.h:373
bool doSegmentation
Definition: coreSdk.h:381
bool isLatent
if image is latent
Definition: coreSdk.h:402
bool allowsIncreaseFrame
Definition: coreSdk.h:392
bool ISO_compatible
need generate template that can be converted to ISO/IEC 19794 or INCITS 378 template
Definition: coreSdk.h:394
uint32_t maxHeight
Definition: coreSdk.h:400
uint32_t maxWidth
Definition: coreSdk.h:397
RLkeeps information about recommended list.
Definition: coreSdk.h:651
int32_t score
similarity score in a range 0...MAX_SCORE
Definition: coreSdk.h:657
uint64_t regNum
TP (tenprint) number.
Definition: coreSdk.h:653
int32_t finger
finger number. NOTE: this parameter is not used in TP-TP matching
Definition: coreSdk.h:655
SearchParamdefine information about matching parameters.
Definition: coreSdk.h:317
uint32_t maxDisp
the maximum of the displacement between center of two fingerprint images, pixels
Definition: coreSdk.h:325
uint32_t maxAngle
the maximum of the finger turn angle for all fingers except thumbs, (0...180 degree)
Definition: coreSdk.h:321
uint32_t maxAngleThumbs
the maximum of the finger turn angle for thumbs, (0...180 degree)
Definition: coreSdk.h:323
enum MATCHING_MODE matchingMode
matching mode defined in MATCHING_MODE enum
Definition: coreSdk.h:346
enum MATCH_SPEED searchSpeed
matching speed defined in MATCH_SPEED enum
Definition: coreSdk.h:319
int32_t highThreshold
hight threshold
Definition: coreSdk.h:340
int32_t lowThreshold
Definition: coreSdk.h:338
uint32_t minMatch
minimum number of finger pairs that should be matched (see comments above)
Definition: coreSdk.h:342
uint32_t maxMatch
maximum number of finger pairs that can be matched (see comments above)
Definition: coreSdk.h:344
enum FUSION_MODE fusionMode
fusion mode defined in FUSION_MODE enum
Definition: coreSdk.h:348
Singularstructure keeps information about Singular NOTE: all coordinates is applied to 500 DPI finger...
Definition: coreSdk.h:274
int32_t y
y positionf rom top-left corner, pixels
Definition: coreSdk.h:278
uint8_t prob
probability, %
Definition: coreSdk.h:280
enum SINGULAR_TYPE type
singular type
Definition: coreSdk.h:286
int32_t angle
direction (clockwise from OX axis), degree (-180...180)
Definition: coreSdk.h:282
uint8_t density
distance between redges, pixels
Definition: coreSdk.h:284
int32_t x
x position from top-left corner, pixels
Definition: coreSdk.h:276
TemplHeaderstructure keeps information about template header.
Definition: coreSdk.h:196
uint8_t relPoints
number of reliable points in template
Definition: coreSdk.h:204
uint16_t points
number of points in template
Definition: coreSdk.h:202
uint32_t size
size of template
Definition: coreSdk.h:198
uint8_t quality
quality of fingerprint image
Definition: coreSdk.h:206
uint8_t version
template version
Definition: coreSdk.h:210
TemplateDatafingerprint template data.
Definition: coreSdk.h:162
enum FINGERS numFinger
finger number
Definition: coreSdk.h:164
uint8_t * fpTemplate
pointer to the fingerprint template
Definition: coreSdk.h:166
TpTemplatekeeps information about TP(tenprint) template.
Definition: coreSdk.h:619
uint8_t * m_templ[20]
TECH5 template each of 10 roll + 10 flat fingers or 12 palm parts. NULL means template for correspond...
Definition: coreSdk.h:621