BlinkID C SDK version 5.16.0
Public Member Functions
MBRecognizerRunner Struct Reference

MBRecognizerRunner data structure. More...

#include <RecognizerRunner.h>

Public Member Functions

MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerCreate (MBRecognizerRunner **recognizerRunner, MBRecognizerRunnerSettings const *settings)
 Allocates and initializes the recognizer runner object. More...
 
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. More...
 
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 were in use by the MBRecognizerRunner remain alive, but are no longer used by the (now destroyed) MBRecognizerRunner. To avoid memory leaks you should destroy each recognizer using its appropriate delete method. Also note that if you destroy any of the recognizers that are in use by the recognizer runner before deleting the runner, you will crash your app. The reason for this is that during deletion of the runner, it needs to perform some termination tasks on each of the recognizers it used. More...
 
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerSetROI (MBRecognizerRunner *recognizerRunner, MBRectangle const *regionOfInterest)
 Sets the scanning region of interest. All subsequent calls to recognizerRecognizeFromImage will perform scans only in given ROI. ROI must be given with relative dimensions, i.e. all dimensinos of given rectangle must be from interval [0.f, 1.f], where for x coordinate and rectangle width dimension represents the percentage of image widht, and for y coordinate and rectangle height dimension represents the percentage of image height. Call this function with NULL to disable current ROI settings. If any dimension in ROI is larger than 1.f or smaller than 0.f, they will be clamped to interval [0.f, 1.f]. More...
 
MB_API MBRecognizerResultState MB_CALL recognizerRunnerRecognizeFromImage (MBRecognizerRunner *recognizerRunner, MBRecognizerImage const *image, MBBool imageIsVideoFrame, MBRecognitionCallback const *callback)
 Performs recognition of given image. More...
 
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 License recognizer. More...
 
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerCancelCurrentRecognition (MBRecognizerRunner *recognizerRunner)
 Cancels the current recognition process (if any). More...
 
MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerReset (MBRecognizerRunner *recognizerRunner)
 Resets all recognizers used by the MBRecognizerRunner to the default state. More...
 

Detailed Description

MBRecognizerRunner data structure.

Recognizer object specializes in finding elements (e.g. barcodes) on the image. Which elements are being found is specified by RecognizerSettings object

Member Function Documentation

◆ recognizerRunnerCancelCurrentRecognition()

MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerCancelCurrentRecognition ( MBRecognizerRunner recognizerRunner)

Cancels the current recognition process (if any).

If there is a ongoing recognition process (i.e. ongoing call to recognizerRecognizeFromImage), this function will cancel the process. The recognizers used by the MBRecognizerRunner will contain results they had at the time of cancelling. If there is no ongoing recognition process, this function does nothing (it WILL NOT prevent recognition of next image given with call to recognizerRunnerRecognizeFromImage that follows at any time after calling this function).

Parameters
recognizerRunnerRecognizer runner object whose recognition process should be cancelled
Returns
status of the operation

◆ recognizerRunnerCreate()

MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerCreate ( MBRecognizerRunner **  recognizerRunner,
MBRecognizerRunnerSettings const *  settings 
)

Allocates and initializes the recognizer runner object.

Parameters
recognizerRunnerPointer to pointer referencing the created recognizer runner object
settingsRequired for initializing the recognizer runner
Returns
status of the operation. The operation might fail, so please check the returned status for possible errors.

◆ recognizerRunnerDelete()

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 were in use by the MBRecognizerRunner remain alive, but are no longer used by the (now destroyed) MBRecognizerRunner. To avoid memory leaks you should destroy each recognizer using its appropriate delete method. Also note that if you destroy any of the recognizers that are in use by the recognizer runner before deleting the runner, you will crash your app. The reason for this is that during deletion of the runner, it needs to perform some termination tasks on each of the recognizers it used.

Parameters
recognizerRunnerDouble Pointer to the recognizer runner object which is to be deleted
Returns
status of the operation.

◆ recognizerRunnerRecognizeFromImage()

MB_API MBRecognizerResultState MB_CALL recognizerRunnerRecognizeFromImage ( MBRecognizerRunner recognizerRunner,
MBRecognizerImage const *  image,
MBBool  imageIsVideoFrame,
MBRecognitionCallback const *  callback 
)

Performs recognition of given image.

Parameters
recognizerRunnerobject which performs recognition. Only recognizers given in MBRecognizerRunnerSettings will be used for performing the recognition.
imageMBRecognizerImage object which holds image on which recognition will be performed. See MBRecognizerImage to see details on supported image formats.
imageIsVideoFrameIf MB_TRUE is given, image is treated as video frame. When treating image as video frame, multiple consecutive frame may be combined to yield better recognition result. Note that if consecutive calls to this method with this parameter set as MB_TRUE expect the consecutive frames obtained from camera - all these frames should contain the same object that needs to be recognised. If one of this frames contain different object, total recognition result may be corrupted. To reset recognizer to initial setting, call recognizerRunnerReset. Also note that returned recognition status may be MB_RECOGNIZER_RESULT_STATE_EMPTY or RECOGNIZER_RESULT_STATE_UNCERTAIN for frames for which library concludes are too poor to be processed. Note: If you want to force the library to process every frame independently, you have to call the recognizerRunnerReset between every invocation of this function.
callbackPointer to structure that contains pointer to callback functions. If given NULL, no callback will be called. If given non-NULL, only non-NULL function pointers will be called.
Returns
General state of the recognition run. If MB_RECOGNIZER_RESULT_STATE_EMPTY is returned, this means that no recognizer used by the MBRecognizerRunner recognised anything. If RECOGNIZER_RESULT_STATE_UNCERTAIN is returned, this means that at least one recognizer used by the MBRecognizerRunner changed its result's state into RECOGNIZER_RESULT_STATE_UNCERTAIN. If MB_RECOGNIZER_RESULT_STATE_VALID is returned, this means that at least one recognizer used by the MBRecognizerRunner changed its result's state into MB_RECOGNIZER_RESULT_STATE_VALID.

◆ recognizerRunnerRecognizeFromString()

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 License recognizer.

Parameters
recognizerRunnerobject which performs recognition. Only recognizers given in MBRecognizerRunnerSettings will be used for performing the recognition.
stringString on which recognition will be performed.
callbackPointer to structure that contains pointer to callback functions. If given NULL, no callback will be called. If given non-NULL, only non-NULL function pointers will be called.
Returns
General state of the recognition run. If MB_RECOGNIZER_RESULT_STATE_EMPTY is returned, this means that no recognizer used by the MBRecognizerRunner recognised anything. If RECOGNIZER_RESULT_STATE_UNCERTAIN is returned, this means that at least one recognizer used by the MBRecognizerRunner changed its result's state into RECOGNIZER_RESULT_STATE_UNCERTAIN. If MB_RECOGNIZER_RESULT_STATE_VALID is returned, this means that at least one recognizer used by the MBRecognizerRunner changed its result's state into MB_RECOGNIZER_RESULT_STATE_VALID.

◆ recognizerRunnerReset()

MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerReset ( MBRecognizerRunner recognizerRunner)

Resets all recognizers used by the MBRecognizerRunner to the default state.

When using method recognizerRunnerRecognizeFromImage, multiple consecutive images are used to obtain time redundancy information and yield better recognition results. To be able to do that, library will cache some information from each frame that is later used for boosting the recognition quality. This method will purge that cache. In Microblink's * mobile SDKs this method is usually called when the device gets shaken or new camera session starts.

Parameters
recognizerRunnerobject which performs recognition.
Returns
status of the operation.

◆ recognizerRunnerSetROI()

MB_API MBRecognizerErrorStatus MB_CALL recognizerRunnerSetROI ( MBRecognizerRunner recognizerRunner,
MBRectangle const *  regionOfInterest 
)

Sets the scanning region of interest. All subsequent calls to recognizerRecognizeFromImage will perform scans only in given ROI. ROI must be given with relative dimensions, i.e. all dimensinos of given rectangle must be from interval [0.f, 1.f], where for x coordinate and rectangle width dimension represents the percentage of image widht, and for y coordinate and rectangle height dimension represents the percentage of image height. Call this function with NULL to disable current ROI settings. If any dimension in ROI is larger than 1.f or smaller than 0.f, they will be clamped to interval [0.f, 1.f].

Parameters
recognizerRunnerPointer to the recognizer runner object to which ROI will be set
regionOfInterestPointer to rectangle that represents the ROI, or NULL to disable ROI.
Returns
Status of the operation.

◆ recognizerRunnerUpdateSettings()

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.

Parameters
recognizerRunnerrecognizer runner object that will be updated with new settings
settingssettings that will be applied
Returns
status of the operation. The operation might fail, so please check returned status for possible errors.

The documentation for this struct was generated from the following file: