BlinkID C SDK version 5.16.0
RecognizerRunner.h
Go to the documentation of this file.
1
14#ifndef RECOGNIZER_RUNNER_H_
15#define RECOGNIZER_RUNNER_H_
16
17#include "Export.h"
18#include "Recognizer.h"
19#include "RecognizerError.h"
20#include "RecognizerImage.h"
21#include "Rectangle.h"
22#include "Types.h"
23
24#include <stdlib.h>
25
26#ifdef __cplusplus
27extern "C"
28{
29#endif
30
39
43MB_EXPORTED_TYPE typedef struct MBRecognizerRunner MBRecognizerRunner;
44
46
51
58
65{
74
80
85
86#ifdef __cplusplus
88 {
90 }
91#endif
92};
93
98struct MBPoint
99{
101 int x;
103 int y;
104};
105
109typedef MB_EXPORTED_TYPE struct MBPoint MBPoint;
110
115struct MBSize
116{
118 int width;
121};
122
126typedef MB_EXPORTED_TYPE struct MBSize MBSize;
127
133{
149
153typedef MB_EXPORTED_TYPE enum MBDetectionStatus MBDetectionStatus;
154
160{
168
172typedef MB_EXPORTED_TYPE enum MBShowImageType MBShowImageType;
173
175
179typedef MB_EXPORTED_TYPE struct MBRecognitionCallback MBRecognitionCallback;
180
187
198{
199
202
215 void (*onDetectionMidway)( MBPoint const * points, size_t pointsSize );
216
228 MBBool (*onDetectedObject)( MBPoint const * points, size_t pointsSize, MBDetectionStatus detectionStatus );
229
241
244
247
257 void (*onShowImage)( MBRecognizerImage const * image, MBShowImageType showType, char const * name );
258
263
268 void (*onGlare)( MBBool hasGlare );
269
270#ifdef __cplusplus
275 {
277 }
278#endif
279};
280
291
303
319
334MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerSetROI( MBRecognizerRunner * recognizerRunner, MBRectangle const * regionOfInterest );
335
364(
365 MBRecognizerRunner * recognizerRunner,
366 MBRecognizerImage const * image,
367 MBBool imageIsVideoFrame,
368 MBRecognitionCallback const * callback
369);
370
371
389(
390 MBRecognizerRunner * recognizerRunner,
391 char const * string,
392 MBRecognitionCallback const * callback
393);
394
395
410
424
425#ifdef __cplusplus
426}
427#endif
428
429#endif
MBRecognizerResultState
Definition: Recognizer.h:39
void * MBRecognizerPtr
Typedef for pointer to generic Recognizer object.
Definition: Recognizer.h:32
MBRecognizerErrorStatus
Enumeration of all possible error statuses.
Definition: RecognizerError.h:28
MBDetectionStatus
Defines a status of the object detection process.
Definition: RecognizerRunner.h:133
@ DETECTION_STATUS_PARTIAL_OBJECT
Definition: RecognizerRunner.h:141
@ DETECTION_STATUS_CAMERA_AT_ANGLE
Definition: RecognizerRunner.h:143
@ DETECTION_STATUS_CAMERA_TOO_NEAR
Definition: RecognizerRunner.h:145
@ DETECTION_STATUS_DOCUMENT_TOO_CLOSE_TO_EDGE
Definition: RecognizerRunner.h:147
@ DETECTION_STATUS_CAMERA_TOO_HIGH
Definition: RecognizerRunner.h:139
@ DETECTION_STATUS_FAIL
Definition: RecognizerRunner.h:137
@ DETECTION_STATUS_SUCCESS
Definition: RecognizerRunner.h:135
MB_EXPORTED_TYPE struct MBRecognizerRunnerSettings MBRecognizerRunnerSettings
Typedef for MBRecognizerRunnerSettings structure.
Definition: RecognizerRunner.h:50
MB_EXPORTED_TYPE struct MBRecognitionCallback MBRecognitionCallback
Typedef for MBRecognitionCallback structure.
Definition: RecognizerRunner.h:179
MBShowImageType
Enumeration of types of images returned via onShowImage callback function.
Definition: RecognizerRunner.h:160
@ SHOW_IMAGE_TYPE_DEWARPED
Definition: RecognizerRunner.h:164
@ SHOW_IMAGE_TYPE_ORIGINAL
Definition: RecognizerRunner.h:162
@ SHOW_IMAGE_TYPE_SUCCESSFUL_SCAN
Definition: RecognizerRunner.h:166
unsigned char MBBool
Boolean type for C SDK.
Definition: Types.h:20
This structure represents the 2D point.
Definition: RecognizerRunner.h:99
int x
Definition: RecognizerRunner.h:101
int y
Definition: RecognizerRunner.h:103
The MBRecognitionCallback struct.
Definition: RecognizerRunner.h:198
void(* onDetectionFailed)()
Definition: RecognizerRunner.h:240
void(* onDetectionMidway)(MBPoint const *points, size_t pointsSize)
Definition: RecognizerRunner.h:215
void(* onGlare)(MBBool hasGlare)
Definition: RecognizerRunner.h:268
void(* onShowImage)(MBRecognizerImage const *image, MBShowImageType showType, char const *name)
Definition: RecognizerRunner.h:257
MB_API void MB_CALL recognitionCallbackDefaultInit(MBRecognitionCallback *)
Populate MBRecognitionCallback structure with default values.
void(* onRecognitionStarted)()
Definition: RecognizerRunner.h:243
MBBool(* onDetectedObject)(MBPoint const *points, size_t pointsSize, MBDetectionStatus detectionStatus)
Definition: RecognizerRunner.h:228
void(* onDetectionStarted)()
Definition: RecognizerRunner.h:201
void(* onFirstSideResult)()
Definition: RecognizerRunner.h:262
void(* onRecognitionFinished)()
Definition: RecognizerRunner.h:246
MBRecognizerImage data structure. Holds image on which recognition will bw performed.
MBRecognizerRunner data structure.
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerSetROI(MBRecognizerRunner *recognizerRunner, MBRectangle const *regionOfInterest)
Sets the scanning region of interest. All subsequent calls to recognizerRecognizeFromImage will perfo...
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerDelete(MBRecognizerRunner **recognizerRunner)
Deletes the recognizer runner object and sets a pointer to it to NULL. Note that recognizers that wer...
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerReset(MBRecognizerRunner *recognizerRunner)
Resets all recognizers used by the MBRecognizerRunner to the default state.
MB_API MBRecognizerResultState MB_CALL recognizerRunnerRecognizeFromImage(MBRecognizerRunner *recognizerRunner, MBRecognizerImage const *image, MBBool imageIsVideoFrame, MBRecognitionCallback const *callback)
Performs recognition of given image.
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerCreate(MBRecognizerRunner **recognizerRunner, MBRecognizerRunnerSettings const *settings)
Allocates and initializes the recognizer runner object.
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerCancelCurrentRecognition(MBRecognizerRunner *recognizerRunner)
Cancels the current recognition process (if any).
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerUpdateSettings(MBRecognizerRunner *recognizerRunner, MBRecognizerRunnerSettings const *settings)
Updates recognizer runner's settings. You can use this method to change what recognizers are active.
MB_API MBRecognizerResultState MB_CALL recognizerRunnerRecognizeFromString(MBRecognizerRunner *recognizerRunner, char const *string, MBRecognitionCallback const *callback)
Performs recognition of given string. Recognition from string is available only for US Driver's Licen...
Recognizer runner settings data structure.
Definition: RecognizerRunner.h:65
MBBool allowMultipleResults
Definition: RecognizerRunner.h:73
size_t numOfRecognizers
Definition: RecognizerRunner.h:84
MB_API void MB_CALL recognizerRunnerSettingsDefaultInit(MBRecognizerRunnerSettings *)
Populate MBRecognizerRunnerSettings structure with default values.
MBRecognizerPtr const * recognizers
Definition: RecognizerRunner.h:79
This structure represents the rectangle.
Definition: Rectangle.h:27
This structure represents the two-dimensional size of an object.
Definition: RecognizerRunner.h:116
int width
Definition: RecognizerRunner.h:118
int height
Definition: RecognizerRunner.h:120