VLDOCRControllerDelegate
Objective-C
@protocol VLDOCRControllerDelegate <NSObject>
Swift
protocol VLDOCRControllerDelegate : NSObjectProtocol
The VLDOCRControllerDelegate protocol provides callbacks to show live OCR results and to provide the final record created by the OCR process and the final image used to create the record.
-
Callback giving live results for each camera frame processed by OCR.
Declaration
Objective-C
- (void)ocrController:(VLDOCRController *_Nonnull)ocrController didProcessResult:(VLDOCRResult *_Nullable)result;
Swift
func ocrController(_ ocrController: VLDOCRController, didProcessResult result: VLDOCRResult?)
Parameters
ocrController
The VLDOCRController instance that processed the image.
result
A VLDOCRResult object that contains an output string for display to the user so they can see the OCR being performed in real time. It also contains the image that was processed as well as a set of glare areas for indicating to the user where glare is on the screen.
-
Callback passing back the VLDRecord object with the measurement data received from the OCR process. The reading can then be presented to the user for verification and then should be submitted to the session for upload by calling submitRecord:image: on VLDSession or you can submit a record without the image by calling submitRecord: on VLDSession.
Declaration
Objective-C
- (void)ocrController:(VLDOCRController *_Nonnull)ocrController didCompleteReading:(VLDRecord *_Nullable)record image:(UIImage *_Nullable)image forPeripheral:(VLDOCRPeripheral *_Nonnull)peripheral metadata:(NSDictionary *_Nonnull)metadata;
Swift
func ocrController(_ ocrController: VLDOCRController, didCompleteReading record: VLDRecord?, image: UIImage?, for peripheral: VLDOCRPeripheral, metadata: [AnyHashable : Any])
Parameters
ocrController
The VLDOCRController instance that processed the image.
record
The VLDRecord object with the measurement data received from the OCR process.
image
The final UIImage that was processed to produce the record.
peripheral
The peripheral that the readings came from.
metadata
A dictionary containing additional metadata from the OCR process. The dictionary should contain the final full screen camera preview processed by the OCR engine, identified with the key
kVLDOCRMetadataFinalPreviewKey
. The dictionary will also contain the frame of the image inside the camera preview identified by the keykVLDOCRMetadataImageFrameKey
. The coordinate space of this frame will be the screen’s coordinate space.