The MBRecognitionCallback struct.
More...
#include <RecognizerRunner.h>
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.
◆ recognitionCallbackDefaultInit()
◆ onDetectedObject
Called when object detection on image finishes. If processing should proceed to recognition of the detected object, method must return MB_TRUE.
- Parameters
-
points | array 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. |
pointsSize | size of the array points |
detectionStatus | status 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
-
points | array 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. |
pointsSize | size 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
-
hasGlare | indicates 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
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
-
image | returned image. Image pointer is valid only during the scope of the function. If you need it later, you should copy the image with recognizerImageCreateCopyFromImage. |
showType | type of shown image. |
name | image 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: