BlinkID C SDK version 5.16.0
Public Member Functions | Data Fields
MBRecognitionCallback Struct Reference

The MBRecognitionCallback struct. More...

#include <RecognizerRunner.h>

Public Member Functions

MB_API void MB_CALL recognitionCallbackDefaultInit (MBRecognitionCallback *)
 Populate MBRecognitionCallback structure with default values. More...
 

Data Fields

void(* onDetectionStarted )()
 
void(* onDetectionMidway )(MBPoint const *points, size_t pointsSize)
 
MBBool(* onDetectedObject )(MBPoint const *points, size_t pointsSize, MBDetectionStatus detectionStatus)
 
void(* onDetectionFailed )()
 
void(* onRecognitionStarted )()
 
void(* onRecognitionFinished )()
 
void(* onShowImage )(MBRecognizerImage const *image, MBShowImageType showType, char const *name)
 
void(* onFirstSideResult )()
 
void(* onGlare )(MBBool hasGlare)
 

Detailed Description

The MBRecognitionCallback struct.

This structure contains pointers to functions that can be called in various parts of the recognition process. Functions will be called only if non-NULL function pointer is given. All functions except onDetectionFailed may be called multiple times whilst processing a single image - each recognizer object will call them separately.

Member Function Documentation

◆ recognitionCallbackDefaultInit()

MB_API void MB_CALL recognitionCallbackDefaultInit ( MBRecognitionCallback )

Populate MBRecognitionCallback structure with default values.

Returns
Nothing

Field Documentation

◆ onDetectedObject

MBBool(* MBRecognitionCallback::onDetectedObject) (MBPoint const *points, size_t pointsSize, MBDetectionStatus detectionStatus)

Called when object detection on image finishes. If processing should proceed to recognition of the detected object, method must return MB_TRUE.

Parameters
pointsarray of points that represent the detected object (usually 4 points, but can be less or more for some specific object (for example: QR code)). Point coordinates are in image-based coordinate system, i.e. (0,0) is the coordinate of upper left corner and (width, height) is the coordinate of lower right corner of the image. If no points are given, this pointer is NULL.
pointsSizesize of the array points
detectionStatusstatus of the object detection. Can be any from the DetectionStatus enum.
Returns
MB_TRUE if recognition should proceed. MB_FALSE if recognition should not proceed.

◆ onDetectionFailed

void(* MBRecognitionCallback::onDetectionFailed) ()

Called when whole chain of recognizers failed and nothing has been detected on image. Note that this method is called only if all recognizers in recognizer chain fail to detect anything, while onDetectedObject will be called for each recognizer separately.

For example, if the image contains PDF417 code and both barcode recognizer (configured for QR code scanning only) and ID Barcode recognizer are in chain, then the barcode recognizer will call onDetectedObject with detection status DETECTION_STATUS_FAIL, while ID Barcode recognizer will call onDetectedObject with DETECTION_STATUS_SUCCESS and this method will not be called. On the other hand, if image doesn't contain anything, both barcode recognizer and ID Barcode recognizer will call onDetectedObject with DETECTION_STATUS_FAIL and then this method will be called.

◆ onDetectionMidway

void(* MBRecognitionCallback::onDetectionMidway) (MBPoint const *points, size_t pointsSize)

Called when the recognizer is midway the detection. At that point some points could be drawn on to the frame as a sign of something happening.

Parameters
pointsarray of points that represent the detected object (usually 4 points, but can be less or more for some specific object (for example: QR code)). Point coordinates are in image-based coordinate system, i.e. (0,0) is the coordinate of upper left corner and (width, height) is the coordinate of lower right corner of the image. If no points are given, this pointer is NULL.
pointsSizesize of the array points

◆ onDetectionStarted

void(* MBRecognitionCallback::onDetectionStarted) ()

Called when object detection on image starts.

◆ onFirstSideResult

void(* MBRecognitionCallback::onFirstSideResult) ()

Called when first side recognition with the combined recognizer completes.

◆ onGlare

void(* MBRecognitionCallback::onGlare) (MBBool hasGlare)

Called when glare detection has completed with result whether glare has been found or not.

Parameters
hasGlareindicates whether glare has been found on the input image or not

◆ onRecognitionFinished

void(* MBRecognitionCallback::onRecognitionFinished) ()

Called when recognition process ends, just before returning from the recognizerRecognizeFromImage method

◆ onRecognitionStarted

void(* MBRecognitionCallback::onRecognitionStarted) ()

Called when recognition process starts

◆ onShowImage

void(* MBRecognitionCallback::onShowImage) (MBRecognizerImage const *image, MBShowImageType showType, char const *name)

Called when recognition process produces an image in various stages of recognition. showType parameter can be used to differentiate between image types so only images that are needed are handled.

Parameters
imagereturned image. Image pointer is valid only during the scope of the function. If you need it later, you should copy the image with recognizerImageCreateCopyFromImage.
showTypetype of shown image.
nameimage name. Can be NULL.
See also
MBShowImageType for more information of what kinds of images are available

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